diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 51d0d717f..70dc76bb2 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -9637,7 +9637,7 @@ int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx, /* build DER formatted ECC key, include optional public key if requested, * return length on success, negative on error */ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen, - int public) + int pubIn) { byte curve[MAX_ALGO_SZ+2]; byte ver[MAX_VERSION_SZ]; @@ -9678,8 +9678,8 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen, } prvidx += privSz; - /* public */ - if (public) { + /* pubIn */ + if (pubIn) { ret = wc_ecc_export_x963(key, NULL, &pubSz); if (ret != LENGTH_ONLY_E) { XFREE(prv, key->heap, DYNAMIC_TYPE_TMP_BUFFER); @@ -9717,7 +9717,7 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen, totalSz = prvidx + pubidx + curveidx + verSz + seqSz; if (totalSz > (int)inLen) { XFREE(prv, key->heap, DYNAMIC_TYPE_TMP_BUFFER); - if (public) { + if (pubIn) { XFREE(pub, key->heap, DYNAMIC_TYPE_TMP_BUFFER); } return BAD_FUNC_ARG; @@ -9741,8 +9741,8 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen, XMEMCPY(output + idx, curve, curveidx); idx += curveidx; - /* public */ - if (public) { + /* pubIn */ + if (pubIn) { XMEMCPY(output + idx, pub, pubidx); /* idx += pubidx; not used after write, if more data remove comment */ XFREE(pub, key->heap, DYNAMIC_TYPE_TMP_BUFFER); diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index d3c9338a0..e21525bfd 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -834,8 +834,7 @@ static int wc_PKCS7_SignedDataBuildSignature(PKCS7* pkcs7, * type - [OUT] pointer to wc_HashType for output * * returns hash digest size on success, negative on error */ -static enum wc_HashType wc_PKCS7_SetHashType(PKCS7* pkcs7, - enum wc_HashType* type) +static int wc_PKCS7_SetHashType(PKCS7* pkcs7, enum wc_HashType* type) { if (pkcs7 == NULL || type == NULL) return BAD_FUNC_ARG; diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index edec68237..45a2634b7 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -761,15 +761,15 @@ int wc_scrypt(byte* output, const byte* passwd, int passLen, bSz = 128 * blockSize; blocksSz = bSz * parallel; - blocks = XMALLOC(blocksSz, NULL, DYNAMIC_TYPE_TMP_BUFFER); + blocks = (byte*)XMALLOC(blocksSz, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (blocks == NULL) goto end; /* Temporary for scryptROMix. */ - v = XMALLOC((1 << cost) * bSz, NULL, DYNAMIC_TYPE_TMP_BUFFER); + v = (byte*)XMALLOC((1 << cost) * bSz, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (v == NULL) goto end; /* Temporary for scryptBlockMix. */ - y = XMALLOC(blockSize * 128, NULL, DYNAMIC_TYPE_TMP_BUFFER); + y = (byte*)XMALLOC(blockSize * 128, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (y == NULL) goto end;