check on RNG init return with test, and make input const

pull/7954/head
JacobBarthelmeh 2024-09-18 15:17:53 -06:00
parent 5adad7d869
commit 8017c816bb
3 changed files with 5 additions and 4 deletions

View File

@ -51097,11 +51097,11 @@ static int test_wc_PKCS7_signed_enveloped(void)
{
/* arbitrary custom SKID */
byte customSKID[] = {
const byte customSKID[] = {
0x40, 0x25, 0x77, 0x56
};
wc_InitRng(&rng);
ExpectIntEQ(wc_InitRng(&rng), 0);
sigSz = FOURK_BUF * 2;
ExpectNotNull(pkcs7 = wc_PKCS7_New(HEAP_HINT, testDevId));
if (pkcs7 != NULL) {

View File

@ -3443,7 +3443,7 @@ int wc_PKCS7_EncodeSignedData_ex(PKCS7* pkcs7, const byte* hashBuf,
/* Sets a custom SKID in PKCS7 struct, used before calling an encode operation
* Returns 0 on success, negative upon error. */
int wc_PKCS7_SetCustomSKID(PKCS7* pkcs7, byte* in, word16 inSz)
int wc_PKCS7_SetCustomSKID(PKCS7* pkcs7, const byte* in, word16 inSz)
{
int ret = 0;

View File

@ -395,7 +395,8 @@ WOLFSSL_API int wc_PKCS7_EncodeData(PKCS7* pkcs7, byte* output,
word32 outputSz);
/* CMS/PKCS#7 SignedData */
WOLFSSL_API int wc_PKCS7_SetCustomSKID(PKCS7* pkcs7, byte* in, word16 inSz);
WOLFSSL_API int wc_PKCS7_SetCustomSKID(PKCS7* pkcs7, const byte* in,
word16 inSz);
WOLFSSL_API int wc_PKCS7_SetDetached(PKCS7* pkcs7, word16 flag);
WOLFSSL_API int wc_PKCS7_NoDefaultSignedAttribs(PKCS7* pkcs7);
WOLFSSL_API int wc_PKCS7_SetDefaultSignedAttribs(PKCS7* pkcs7, word16 flag);