mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
Added deallocator function for PKCS7 initializer data.
This commit is contained in:
@@ -177,6 +177,13 @@ int PKCS7_InitWithCert(PKCS7* pkcs7, byte* cert, word32 certSz)
|
||||
}
|
||||
|
||||
|
||||
/* releases any memory allocated by a PKCS7 initializer */
|
||||
void PKCS7_Free(PKCS7* pkcs7)
|
||||
{
|
||||
(void)pkcs7;
|
||||
}
|
||||
|
||||
|
||||
/* build PKCS#7 data content type */
|
||||
int PKCS7_EncodeData(PKCS7* pkcs7, byte* output, word32 outputSz)
|
||||
{
|
||||
|
@@ -4114,6 +4114,7 @@ int pkcs7enveloped_test(void)
|
||||
|
||||
free(cert);
|
||||
free(privKey);
|
||||
PKCS7_Free(&pkcs7);
|
||||
|
||||
if (ret > 0)
|
||||
return 0;
|
||||
@@ -4233,6 +4234,10 @@ int pkcs7signed_test(void)
|
||||
}
|
||||
ret = PKCS7_EncodeSignedData(&msg, out, outSz);
|
||||
if (ret < 0) {
|
||||
free(certDer);
|
||||
free(keyDer);
|
||||
free(out);
|
||||
PKCS7_Free(&msg);
|
||||
return -210;
|
||||
}
|
||||
else
|
||||
@@ -4244,6 +4249,7 @@ int pkcs7signed_test(void)
|
||||
free(certDer);
|
||||
free(keyDer);
|
||||
free(out);
|
||||
PKCS7_Free(&msg);
|
||||
return -211;
|
||||
}
|
||||
ret = (int)fwrite(out, outSz, 1, file);
|
||||
@@ -4252,6 +4258,7 @@ int pkcs7signed_test(void)
|
||||
free(certDer);
|
||||
free(keyDer);
|
||||
free(out);
|
||||
PKCS7_Free(&msg);
|
||||
|
||||
if (ret > 0)
|
||||
return 0;
|
||||
|
@@ -99,6 +99,7 @@ CYASSL_LOCAL int CreateRecipientInfo(const byte* cert, word32 certSz,
|
||||
int* keyEncSz, byte* out, word32 outSz);
|
||||
|
||||
CYASSL_API int PKCS7_InitWithCert(PKCS7* pkcs7, byte* cert, word32 certSz);
|
||||
CYASSL_API void PKCS7_Free(PKCS7* pkcs7);
|
||||
CYASSL_API int PKCS7_EncodeData(PKCS7* pkcs7, byte* output, word32 outputSz);
|
||||
CYASSL_API int PKCS7_EncodeSignedData(PKCS7* pkcs7,
|
||||
byte* output, word32 outputSz);
|
||||
|
Reference in New Issue
Block a user