wc_PKCS7_KeyWrap(): mark pointers as to const and check for NULL

This commit is contained in:
Josh Holtrop
2025-07-14 17:28:23 -04:00
parent 429ccd5456
commit af3296a836

View File

@@ -6816,13 +6816,13 @@ static int PKCS7_GenerateContentEncryptionKey(wc_PKCS7* pkcs7, word32 len)
/* wrap CEK (content encryption key) with KEK, returns output size (> 0) on
* success, < 0 on error */
static int wc_PKCS7_KeyWrap(wc_PKCS7 * pkcs7, byte* cek, word32 cekSz, byte* kek,
word32 kekSz, byte* out, word32 outSz,
int keyWrapAlgo, int direction)
static int wc_PKCS7_KeyWrap(wc_PKCS7 const * pkcs7, byte const * cek,
word32 cekSz, byte const * kek, word32 kekSz, byte * out, word32 outSz,
int keyWrapAlgo, int direction)
{
int ret = 0;
if (cek == NULL || kek == NULL || out == NULL)
if (pkcs7 == NULL || cek == NULL || kek == NULL || out == NULL)
return BAD_FUNC_ARG;
switch (keyWrapAlgo) {