11/* signedData-stream.c
22 *
3- * Copyright (C) 2006-2020 wolfSSL Inc.
3+ * Copyright (C) 2006-2024 wolfSSL Inc.
44 *
55 * This file is part of wolfSSL. (formerly known as CyaSSL)
66 *
2020 */
2121
2222
23- #include <wolfssl/options.h>
23+ #ifndef WOLFSSL_USER_SETTINGS
24+ #include <wolfssl/options.h>
25+ #endif
2426#include <wolfssl/wolfcrypt/settings.h>
2527#include <wolfssl/wolfcrypt/pkcs7.h>
2628#include <wolfssl/wolfcrypt/error-crypt.h>
@@ -115,10 +117,10 @@ static int signedData(byte* cert, word32 certSz, byte* key, word32 keySz,
115117 WC_RNG rng ;
116118 word32 outputSz ;
117119
118- static byte messageTypeOid [] =
120+ byte messageTypeOid [] =
119121 { 0x06 , 0x0a , 0x60 , 0x86 , 0x48 , 0x01 , 0x86 , 0xF8 , 0x45 , 0x01 ,
120122 0x09 , 0x02 };
121- static byte messageType [] = { 0x13 , 2 , '1' , '9' };
123+ byte messageType [] = { 0x13 , 2 , '1' , '9' };
122124
123125 PKCS7Attrib attribs [] =
124126 {
@@ -215,6 +217,7 @@ static int signedData_verify(byte* in, word32 inSz, byte* cert,
215217}
216218
217219#ifdef HAVE_PKCS7
220+ #define DEFAULT_EXAMPLE_BUFFER_SIZE 2048
218221
219222int main (int argc , char * * argv )
220223{
@@ -223,8 +226,8 @@ int main(int argc, char** argv)
223226 word32 certSz , keySz ;
224227
225228 byte contentHash [WC_SHA256_DIGEST_SIZE ];
226- byte cert [2048 ];
227- byte key [2048 ];
229+ byte cert [DEFAULT_EXAMPLE_BUFFER_SIZE ];
230+ byte key [DEFAULT_EXAMPLE_BUFFER_SIZE ];
228231 byte * encrypted = NULL ;
229232 byte * decrypted = NULL ;
230233
0 commit comments