Skip to content

Commit

Permalink
Merge branch 'main' into ci-more-macos
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth authored Apr 29, 2024
2 parents ca535b9 + 9a4b43e commit b8e75ae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 8 additions & 0 deletions crypto/asn1/a_mbstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,22 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in,
utf8_len += cbb_get_utf8_len(c);
if (maxsize > 0 && nchar > (size_t)maxsize) {
OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_LONG);
#if defined(OPENSSL_WINDOWS)
ERR_add_error_dataf("maxsize=%lu", (unsigned long)maxsize);
#else
ERR_add_error_dataf("maxsize=%zu", (size_t)maxsize);
#endif
return -1;
}
}

if (minsize > 0 && nchar < (size_t)minsize) {
OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_SHORT);
#if defined(OPENSSL_WINDOWS)
ERR_add_error_dataf("minsize=%lu", (unsigned long)minsize);
#else
ERR_add_error_dataf("minsize=%zu", (size_t)minsize);
#endif
return -1;
}

Expand Down
8 changes: 6 additions & 2 deletions crypto/curve25519/x25519_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ TEST(X25519Test, SmallOrder) {

TEST(X25519Test, Iterated) {
// Taken from https://tools.ietf.org/html/rfc7748#section-5.2.
uint8_t scalar[32] = {9}, point[32] = {9}, out[32];
uint8_t scalar[32] = {}, point[32] = {}, out[32];
scalar[0] = 9;
point[0] = 9;

for (unsigned i = 0; i < 1000; i++) {
EXPECT_TRUE(ctwrapX25519(out, scalar, point));
Expand All @@ -176,7 +178,9 @@ TEST(X25519Test, Iterated) {

TEST(X25519Test, DISABLED_IteratedLarge) {
// Taken from https://tools.ietf.org/html/rfc7748#section-5.2.
uint8_t scalar[32] = {9}, point[32] = {9}, out[32];
uint8_t scalar[32] = {}, point[32] = {}, out[32];
scalar[0] = 9;
point[0] = 9;

for (unsigned i = 0; i < 1000000; i++) {
EXPECT_TRUE(ctwrapX25519(out, scalar, point));
Expand Down
6 changes: 0 additions & 6 deletions include/openssl/x509.h
Original file line number Diff line number Diff line change
Expand Up @@ -3279,12 +3279,6 @@ OPENSSL_EXPORT int X509_LOOKUP_add_dir(X509_LOOKUP *lookup, const char *path,
(X509_V_FLAG_POLICY_CHECK | X509_V_FLAG_EXPLICIT_POLICY | \
X509_V_FLAG_INHIBIT_ANY | X509_V_FLAG_INHIBIT_MAP)

// X509_OBJECT_new allocates an |X509_OBJECT| on the heap.
OPENSSL_EXPORT X509_OBJECT *X509_OBJECT_new(void);

// X509_OBJECT_free frees an |X509_OBJECT| from the heap.
OPENSSL_EXPORT void X509_OBJECT_free(X509_OBJECT *a);

// X509_OBJECT_new returns a newly-allocated, empty |X509_OBJECT| or NULL on
// error.
OPENSSL_EXPORT X509_OBJECT *X509_OBJECT_new(void);
Expand Down

0 comments on commit b8e75ae

Please sign in to comment.