Fixes from review

This commit is contained in:
Eric Blankenhorn
2019-12-18 13:25:25 -06:00
parent 774a758f59
commit 52893877d7
4 changed files with 19 additions and 10 deletions

View File

@@ -768,10 +768,11 @@ int wc_i2d_PKCS12(WC_PKCS12* pkcs12, byte** der, int* derSz)
byte ar[MAX_LENGTH_SZ + 2];
tmpSz = SetShortInt(ar, &tmpIdx, mac->itt, MAX_LENGTH_SZ + 2);
if (tmpSz < 0) {
WOLFSSL_MSG("Error returned by SetShortInt");
return tmpSz;
ret = tmpSz;
}
else {
XMEMCPY(&sdBuf[idx], ar, tmpSz);
}
XMEMCPY(&sdBuf[idx], ar, tmpSz);
}
totalSz += sdBufSz;

View File

@@ -3504,6 +3504,9 @@ static int wc_PKCS7_VerifyContentMessageDigest(PKCS7* pkcs7,
digestSz = wc_HashGetDigestSize(hashType);
if (digestSz < 0) {
WOLFSSL_MSG("Invalid hash type");
#ifdef WOLFSSL_SMALL_STACK
XFREE(digest, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
#endif
return digestSz;
}
} else {