Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkiDev committed Feb 25, 2025
1 parent 9aada6f commit 074ca78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wolfcrypt/src/pkcs7.c
Original file line number Diff line number Diff line change
Expand Up @@ -8706,7 +8706,10 @@ int wc_PKCS7_SetContentType(wc_PKCS7* pkcs7, byte* contentType, word32 sz)
/* return size of padded data, padded to blockSz chunks, or negative on error */
int wc_PKCS7_GetPadSize(word32 inputSz, word32 blockSz)
{
return wc_PkcsPad(NULL, inputSz, blockSz);
if (blockSz == 0)
return BAD_FUNC_ARG;

return (int)(blockSz - (inputSz % blockSz));
}


Expand All @@ -8715,9 +8718,6 @@ int wc_PKCS7_GetPadSize(word32 inputSz, word32 blockSz)
int wc_PKCS7_PadData(byte* in, word32 inSz, byte* out, word32 outSz,
word32 blockSz)
{
int ret;
word32 i;

if (in == NULL || inSz == 0 ||
out == NULL || outSz == 0)
return BAD_FUNC_ARG;
Expand Down

0 comments on commit 074ca78

Please sign in to comment.