mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
wc_PKCS7_KeyWrap(): mark pointers as to const and check for NULL
This commit is contained in:
@@ -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
|
/* wrap CEK (content encryption key) with KEK, returns output size (> 0) on
|
||||||
* success, < 0 on error */
|
* success, < 0 on error */
|
||||||
static int wc_PKCS7_KeyWrap(wc_PKCS7 * pkcs7, byte* cek, word32 cekSz, byte* kek,
|
static int wc_PKCS7_KeyWrap(wc_PKCS7 const * pkcs7, byte const * cek,
|
||||||
word32 kekSz, byte* out, word32 outSz,
|
word32 cekSz, byte const * kek, word32 kekSz, byte * out, word32 outSz,
|
||||||
int keyWrapAlgo, int direction)
|
int keyWrapAlgo, int direction)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (cek == NULL || kek == NULL || out == NULL)
|
if (pkcs7 == NULL || cek == NULL || kek == NULL || out == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
switch (keyWrapAlgo) {
|
switch (keyWrapAlgo) {
|
||||||
|
Reference in New Issue
Block a user