mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Regression test fixes
pkcs7.c: pkcs7->stream must be restored or there will be a leak. test.c: when compiled for compression, compiler warning about const
This commit is contained in:
@ -6183,6 +6183,9 @@ static int PKCS7_VerifySignedData(PKCS7* pkcs7, const byte* hashBuf,
|
|||||||
contentDynamic = (byte*)XMALLOC(contentSz,
|
contentDynamic = (byte*)XMALLOC(contentSz,
|
||||||
pkcs7->heap, DYNAMIC_TYPE_PKCS7);
|
pkcs7->heap, DYNAMIC_TYPE_PKCS7);
|
||||||
if (contentDynamic == NULL) {
|
if (contentDynamic == NULL) {
|
||||||
|
#ifndef NO_PKCS7_STREAM
|
||||||
|
pkcs7->stream = stream;
|
||||||
|
#endif
|
||||||
ret = MEMORY_E;
|
ret = MEMORY_E;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -44891,7 +44891,7 @@ static wc_test_ret_t pkcs7signed_run_SingleShotVectors(
|
|||||||
|
|
||||||
/* encode Signed Encrypted Compressed FirmwarePkgData */
|
/* encode Signed Encrypted Compressed FirmwarePkgData */
|
||||||
encodedSz = wc_PKCS7_EncodeSignedEncryptedCompressedFPD(pkcs7,
|
encodedSz = wc_PKCS7_EncodeSignedEncryptedCompressedFPD(pkcs7,
|
||||||
testVectors[i].encryptKey, testVectors[i].encryptKeySz,
|
(byte*)testVectors[i].encryptKey, testVectors[i].encryptKeySz,
|
||||||
testVectors[i].privateKey, testVectors[i].privateKeySz,
|
testVectors[i].privateKey, testVectors[i].privateKeySz,
|
||||||
testVectors[i].encryptOID, testVectors[i].signOID,
|
testVectors[i].encryptOID, testVectors[i].signOID,
|
||||||
testVectors[i].hashOID, (byte*)testVectors[i].content,
|
testVectors[i].hashOID, (byte*)testVectors[i].content,
|
||||||
@ -45000,7 +45000,7 @@ static wc_test_ret_t pkcs7signed_run_SingleShotVectors(
|
|||||||
XMEMSET(encryptedTmp, 0, encryptedTmpSz);
|
XMEMSET(encryptedTmp, 0, encryptedTmpSz);
|
||||||
|
|
||||||
/* decrypt inner encryptedData */
|
/* decrypt inner encryptedData */
|
||||||
pkcs7->encryptionKey = testVectors[i].encryptKey;
|
pkcs7->encryptionKey = (byte*)testVectors[i].encryptKey;
|
||||||
pkcs7->encryptionKeySz = testVectors[i].encryptKeySz;
|
pkcs7->encryptionKeySz = testVectors[i].encryptKeySz;
|
||||||
|
|
||||||
encryptedTmpSz = wc_PKCS7_DecodeEncryptedData(pkcs7, pkcs7->content,
|
encryptedTmpSz = wc_PKCS7_DecodeEncryptedData(pkcs7, pkcs7->content,
|
||||||
|
Reference in New Issue
Block a user