forked from wolfSSL/wolfssl
update test case to account for NO_DES3 build and resolve clang tidy warnings
This commit is contained in:
@@ -39268,7 +39268,11 @@ static int test_wc_PKCS7_DecodeEnvelopedData_stream(void)
|
||||
ret = wc_PKCS7_DecodeEnvelopedData(pkcs7, testStreamBuffer,
|
||||
testStreamBufferSz, NULL, 0);
|
||||
} while (ret == WC_NO_ERR_TRACE(WC_PKCS7_WANT_READ_E));
|
||||
#ifdef NO_DES3
|
||||
ExpectIntEQ(ret, ALGO_ID_E);
|
||||
#else
|
||||
ExpectIntGT(ret, 0);
|
||||
#endif
|
||||
|
||||
if (f != XBADFILE) {
|
||||
XFCLOSE(f);
|
||||
|
@@ -12832,11 +12832,17 @@ WOLFSSL_API int wc_PKCS7_DecodeEnvelopedData(wc_PKCS7* pkcs7, byte* in,
|
||||
if (pkcs7->streamOutCb) {
|
||||
ret = pkcs7->streamOutCb(pkcs7, encryptedContent,
|
||||
encryptedContentSz - padLen, pkcs7->streamCtx);
|
||||
if (ret != 0) {
|
||||
WOLFSSL_MSG("Stream out callback returned failure");
|
||||
ret = BUFFER_E;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* ASN_BER_TO_DER */
|
||||
{
|
||||
if ((word32)(encryptedContentSz - padLen) > outputSz) {
|
||||
if (output == NULL || (word32)(encryptedContentSz - padLen) >
|
||||
outputSz) {
|
||||
ret = BUFFER_E;
|
||||
break;
|
||||
}
|
||||
@@ -13813,7 +13819,6 @@ WOLFSSL_API int wc_PKCS7_DecodeAuthEnvelopedData(wc_PKCS7* pkcs7, byte* in,
|
||||
if (ret == 0 && GetASNTag(pkiMsg, &localIdx, &tag, pkiMsgSz) == 0 &&
|
||||
tag == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 1)) {
|
||||
encodedAttribIdx = idx;
|
||||
encodedAttribs = pkiMsg + idx;
|
||||
idx++;
|
||||
|
||||
if (GetLength_ex(pkiMsg, &idx, &length, pkiMsgSz, 0) <= 0) {
|
||||
|
Reference in New Issue
Block a user