Merge pull request #4018 from SparkiDev/jenkins-nightly-1

Fixes from nightly builds
This commit is contained in:
David Garske
2021-05-11 09:11:42 -07:00
committed by GitHub
2 changed files with 18 additions and 11 deletions

View File

@ -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;
}

View File

@ -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();