From 525f1cc39e0b683173367578bcce970bff280ee5 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 22 Jul 2025 08:19:01 -0400 Subject: [PATCH] Update style per code review comments --- doc/dox_comments/header_files/pkcs7.h | 15 +++++++++------ wolfcrypt/src/pkcs7.c | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/dox_comments/header_files/pkcs7.h b/doc/dox_comments/header_files/pkcs7.h index 577ae7c11..5884b97f7 100644 --- a/doc/dox_comments/header_files/pkcs7.h +++ b/doc/dox_comments/header_files/pkcs7.h @@ -3,13 +3,16 @@ \brief Callback used for a custom AES key wrap/unwrap operation. - key/keySz specify the key to use. - in/inSz specify the input data to wrap/unwrap. - out/outSz specify the output buffer. + \return The size of the wrapped/unwrapped key written to the output buffer + should be returned on success. A 0 return value or error code (< 0) + indicates a failure. - The size of the wrapped/unwrapped key written to the output buffer should - be returned on success. A 0 return value or error code (< 0) indicates a - failure. + \param[in] key Specify the key to use. + \param[in] keySz Size of the key to use. + \param[in] in Specify the input data to wrap/unwrap. + \param[in] inSz Size of the input data. + \param[out] out Specify the output buffer. + \param[out] outSz Size of the output buffer. */ typedef int (*CallbackAESKeyWrap)(const byte* key, word32 keySz, const byte* in, word32 inSz, byte* out, word32 outSz); diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index dfad85fb3..7a910c833 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -6816,7 +6816,7 @@ 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 const * pkcs7, byte const * cek, +static int wc_PKCS7_KeyWrap(const wc_PKCS7 * pkcs7, byte const * cek, word32 cekSz, byte const * kek, word32 kekSz, byte * out, word32 outSz, int keyWrapAlgo, int direction) {