From 0c1af66843523e822619b4af1013f6b08d9ffc5a Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Mon, 10 May 2021 11:59:52 +1000 Subject: [PATCH] Fixes from nightly builds output not read. g++ realloc cast. curve25519 - no fix, only format changes --- src/ssl.c | 6 +++--- wolfcrypt/src/curve25519.c | 23 +++++++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 8e536ad33..fd36abba2 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -42474,7 +42474,7 @@ int wolfSSL_i2d_X509_NAME(WOLFSSL_X509_NAME* name, unsigned char** out) return MEMORY_E; } } - output = *out; + /* header */ idx = SetSequence(totalBytes, temp); if (totalBytes + idx > ASN_NAME_MAX) { @@ -54573,8 +54573,8 @@ WOLFSSL_API PKCS7* wolfSSL_SMIME_read_PKCS7(WOLFSSL_BIO* in, * exceeded. */ if ((canonPos + XSTRLEN(canonLine) + 1) >= canonSize) { canonSize = canonPos + XSTRLEN(canonLine) + 1; - canonSection = XREALLOC(canonSection, canonSize, NULL, - DYNAMIC_TYPE_PKCS7); + canonSection = (char*)XREALLOC(canonSection, canonSize, + NULL, DYNAMIC_TYPE_PKCS7); if (canonSection == NULL) { goto error; } diff --git a/wolfcrypt/src/curve25519.c b/wolfcrypt/src/curve25519.c index a7d67b2cd..6132e7017 100644 --- a/wolfcrypt/src/curve25519.c +++ b/wolfcrypt/src/curve25519.c @@ -55,11 +55,12 @@ static const unsigned char kCurve25519BasePoint[CURVE25519_KEYSIZE] = {9}; /* compute the public key from an existing private key, using bare vectors. * - * return value is propagated from curve25519() (0 on success), or ECC_BAD_ARG_E, - * and the byte vectors are little endian. + * return value is propagated from curve25519() (0 on success), or + * ECC_BAD_ARG_E, and the byte vectors are little endian. */ int wc_curve25519_make_pub(int public_size, byte* pub, int private_size, - const byte* priv) { + const byte* priv) +{ int ret; if ((public_size != CURVE25519_KEYSIZE) || @@ -79,7 +80,8 @@ int wc_curve25519_make_pub(int public_size, byte* pub, int private_size, { const ECPoint* basepoint = nxp_ltc_curve25519_GetBasePoint(); ECPoint wc_pub; - ret = nxp_ltc_curve25519(&wc_pub, priv, basepoint, kLTC_Weierstrass); /* input basepoint on Weierstrass curve */ + /* input basepoint on Weierstrass curve */ + ret = nxp_ltc_curve25519(&wc_pub, priv, basepoint, kLTC_Weierstrass); if (ret == 0) XMEMCPY(pub, wc_pub.point, CURVE25519_KEYSIZE); } @@ -100,14 +102,16 @@ int wc_curve25519_make_pub(int public_size, byte* pub, int private_size, return ret; } -/* compute the public key from an existing private key, with supplied basepoint, using bare vectors. +/* compute the public key from an existing private key, with supplied basepoint, + * using bare vectors. * * return value is propagated from curve25519() (0 on success), * and the byte vectors are little endian. */ int wc_curve25519_generic(int public_size, byte* pub, int private_size, const byte* priv, - int basepoint_size, const byte* basepoint) { + int basepoint_size, const byte* basepoint) +{ int ret; #ifdef FREESCALE_LTC_ECC @@ -191,7 +195,8 @@ int wc_curve25519_make_key(WC_RNG* rng, int keysize, curve25519_key* key) ret = wc_curve25519_make_priv(rng, keysize, key->k.point); if (ret < 0) return ret; - return wc_curve25519_make_pub((int)sizeof key->p.point, key->p.point, sizeof key->k.point, key->k.point); + return wc_curve25519_make_pub((int)sizeof(key->p.point), key->p.point, + (int)sizeof(key->k.point), key->k.point); } #ifdef HAVE_CURVE25519_SHARED_SECRET @@ -225,7 +230,9 @@ int wc_curve25519_shared_secret_ex(curve25519_key* private_key, return ECC_BAD_ARG_E; #ifdef FREESCALE_LTC_ECC - ret = nxp_ltc_curve25519(&o, private_key->k.point, &public_key->p, kLTC_Curve25519 /* input point P on Curve25519 */); + /* input point P on Curve25519 */ + ret = nxp_ltc_curve25519(&o, private_key->k.point, &public_key->p, + kLTC_Curve25519); #else #if defined(USE_INTEL_SPEEDUP) || defined(WOLFSSL_ARMASM) SAVE_VECTOR_REGISTERS();