diff --git a/doc/dox_comments/header_files/pkcs7.h b/doc/dox_comments/header_files/pkcs7.h index 60b2cc698..3923aec68 100644 --- a/doc/dox_comments/header_files/pkcs7.h +++ b/doc/dox_comments/header_files/pkcs7.h @@ -734,8 +734,8 @@ int wc_PKCS7_DecodeEncryptedKeyPackage(wc_PKCS7 * pkcs7, \param[out] attrSz Buffer in which to store the size of the requested attribute object. */ -int wc_PKCS7_DecodeSymmetricKeyPackageAttribute(byte const * skp, - word32 skpSz, size_t index, byte const ** attr, word32 * attrSz); +int wc_PKCS7_DecodeSymmetricKeyPackageAttribute(const byte * skp, + word32 skpSz, size_t index, const byte ** attr, word32 * attrSz); /*! \ingroup PKCS7 @@ -758,8 +758,8 @@ int wc_PKCS7_DecodeSymmetricKeyPackageAttribute(byte const * skp, \param[out] keySz Buffer in which to store the size of the requested key object. */ -int wc_PKCS7_DecodeSymmetricKeyPackageKey(byte const * skp, - word32 skpSz, size_t index, byte const ** key, word32 * keySz); +int wc_PKCS7_DecodeSymmetricKeyPackageKey(const byte * skp, + word32 skpSz, size_t index, const byte ** key, word32 * keySz); /*! \ingroup PKCS7 @@ -782,8 +782,8 @@ int wc_PKCS7_DecodeSymmetricKeyPackageKey(byte const * skp, \param[out] attrSz Buffer in which to store the size of the requested attribute object. */ -int wc_PKCS7_DecodeOneSymmetricKeyAttribute(byte const * osk, - word32 oskSz, size_t index, byte const ** attr, word32 * attrSz); +int wc_PKCS7_DecodeOneSymmetricKeyAttribute(const byte * osk, + word32 oskSz, size_t index, const byte ** attr, word32 * attrSz); /*! \ingroup PKCS7 @@ -804,5 +804,5 @@ int wc_PKCS7_DecodeOneSymmetricKeyAttribute(byte const * osk, \param[out] keySz Buffer in which to store the size of the requested key object. */ -int wc_PKCS7_DecodeOneSymmetricKeyKey(byte const * osk, - word32 oskSz, byte const ** key, word32 * keySz); +int wc_PKCS7_DecodeOneSymmetricKeyKey(const byte * osk, + word32 oskSz, const byte ** key, word32 * keySz); diff --git a/tests/api/test_asn.c b/tests/api/test_asn.c index 2c36989c0..520150a8f 100644 --- a/tests/api/test_asn.c +++ b/tests/api/test_asn.c @@ -184,20 +184,20 @@ int test_IndexSequenceOf(void) EXPECT_DECLS; #ifndef NO_ASN - static const byte int_seq[] = { + const byte int_seq[] = { 0x30, 0x0A, 0x02, 0x01, 0x0A, 0x02, 0x02, 0x00, 0xF0, 0x02, 0x01, 0x7F, }; - static const byte bad_seq[] = { + const byte bad_seq[] = { 0xA0, 0x01, 0x01, }; - static const byte empty_seq[] = { + const byte empty_seq[] = { 0x30, 0x00, }; - byte const * element; + const byte * element; word32 elementSz; ExpectIntEQ(IndexSequenceOf(int_seq, sizeof(int_seq), 0U, &element, &elementSz), 0); diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 16f9b7927..6866ac152 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -15305,8 +15305,8 @@ int wc_PKCS7_DecodeCompressedData(wc_PKCS7* pkcs7, byte* pkiMsg, #endif /* HAVE_LIBZ && !NO_PKCS7_COMPRESSED_DATA */ -static int wc_PKCS7_DecodeSymmetricKeyPackage(byte const * skp, word32 skpSz, - size_t index, byte const ** out, word32 * outSz, int getKey) +static int wc_PKCS7_DecodeSymmetricKeyPackage(const byte * skp, word32 skpSz, + size_t index, const byte ** out, word32 * outSz, int getKey) { word32 skpIndex = 0; int length = 0; @@ -15335,7 +15335,8 @@ static int wc_PKCS7_DecodeSymmetricKeyPackage(byte const * skp, word32 skpSz, } else { /* sKeyPkgAttrs is present at &skp[skpIndex], length in length */ - return IndexSequenceOf(&skp[skpIndex], (word32)length, index, out, outSz); + return IndexSequenceOf(&skp[skpIndex], (word32)length, index, out, + outSz); } } @@ -15348,20 +15349,21 @@ static int wc_PKCS7_DecodeSymmetricKeyPackage(byte const * skp, word32 skpSz, return IndexSequenceOf(&skp[skpIndex], skpSz - skpIndex, index, out, outSz); } -int wc_PKCS7_DecodeSymmetricKeyPackageAttribute(byte const * skp, - word32 skpSz, size_t index, byte const ** attr, word32 * attrSz) +int wc_PKCS7_DecodeSymmetricKeyPackageAttribute(const byte * skp, + word32 skpSz, size_t index, const byte ** attr, word32 * attrSz) { - return wc_PKCS7_DecodeSymmetricKeyPackage(skp, skpSz, index, attr, attrSz, 0); + return wc_PKCS7_DecodeSymmetricKeyPackage(skp, skpSz, index, attr, attrSz, + 0); } -int wc_PKCS7_DecodeSymmetricKeyPackageKey(byte const * skp, - word32 skpSz, size_t index, byte const ** key, word32 * keySz) +int wc_PKCS7_DecodeSymmetricKeyPackageKey(const byte * skp, + word32 skpSz, size_t index, const byte ** key, word32 * keySz) { return wc_PKCS7_DecodeSymmetricKeyPackage(skp, skpSz, index, key, keySz, 1); } -int wc_PKCS7_DecodeOneSymmetricKeyAttribute(byte const * osk, - word32 oskSz, size_t index, byte const ** attr, word32 * attrSz) +int wc_PKCS7_DecodeOneSymmetricKeyAttribute(const byte * osk, + word32 oskSz, size_t index, const byte ** attr, word32 * attrSz) { word32 oskIndex = 0; word32 tmpIndex; @@ -15382,11 +15384,12 @@ int wc_PKCS7_DecodeOneSymmetricKeyAttribute(byte const * osk, } /* Index the sKeyAttrs SEQUENCE OF object with the given index. */ - return IndexSequenceOf(&osk[oskIndex], oskSz - oskIndex, index, attr, attrSz); + return IndexSequenceOf(&osk[oskIndex], oskSz - oskIndex, index, attr, + attrSz); } -int wc_PKCS7_DecodeOneSymmetricKeyKey(byte const * osk, - word32 oskSz, byte const ** key, word32 * keySz) +int wc_PKCS7_DecodeOneSymmetricKeyKey(const byte * osk, + word32 oskSz, const byte ** key, word32 * keySz) { word32 oskIndex = 0; int length = 0; diff --git a/wolfssl/wolfcrypt/pkcs7.h b/wolfssl/wolfcrypt/pkcs7.h index 8a8eed11f..617ff5177 100644 --- a/wolfssl/wolfcrypt/pkcs7.h +++ b/wolfssl/wolfcrypt/pkcs7.h @@ -552,14 +552,14 @@ WOLFSSL_API int wc_PKCS7_DecodeCompressedData(wc_PKCS7* pkcs7, byte* pkiMsg, word32 outputSz); #endif /* HAVE_LIBZ && !NO_PKCS7_COMPRESSED_DATA */ -WOLFSSL_API int wc_PKCS7_DecodeSymmetricKeyPackageAttribute(byte const * skp, - word32 skpSz, size_t index, byte const ** attr, word32 * attrSz); -WOLFSSL_API int wc_PKCS7_DecodeSymmetricKeyPackageKey(byte const * skp, - word32 skpSz, size_t index, byte const ** key, word32 * keySz); -WOLFSSL_API int wc_PKCS7_DecodeOneSymmetricKeyAttribute(byte const * osk, - word32 oskSz, size_t index, byte const ** attr, word32 * attrSz); -WOLFSSL_API int wc_PKCS7_DecodeOneSymmetricKeyKey(byte const * osk, - word32 oskSz, byte const ** key, word32 * keySz); +WOLFSSL_API int wc_PKCS7_DecodeSymmetricKeyPackageAttribute(const byte * skp, + word32 skpSz, size_t index, const byte ** attr, word32 * attrSz); +WOLFSSL_API int wc_PKCS7_DecodeSymmetricKeyPackageKey(const byte * skp, + word32 skpSz, size_t index, const byte ** key, word32 * keySz); +WOLFSSL_API int wc_PKCS7_DecodeOneSymmetricKeyAttribute(const byte * osk, + word32 oskSz, size_t index, const byte ** attr, word32 * attrSz); +WOLFSSL_API int wc_PKCS7_DecodeOneSymmetricKeyKey(const byte * osk, + word32 oskSz, const byte ** key, word32 * keySz); #ifdef __cplusplus } /* extern "C" */