Skip to content

Commit 26a4ea9

Browse files
committed
Allow building with HAVE_PKCS7 set and HAVE_AES_KEYWRAP unset
1 parent cc2f792 commit 26a4ea9

File tree

5 files changed

+64
-37
lines changed

5 files changed

+64
-37
lines changed

doc/dox_comments/header_files/pkcs7.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,13 @@ int wc_PKCS7_EncodeEnvelopedData(PKCS7* pkcs7,
573573
type, decoding the message into output. It uses the private key of the
574574
PKCS7 object passed in to decrypt the message.
575575
576+
Note that if the EnvelopedData is encrypted using an ECC key and the
577+
KeyAgreementRecipientInfo structure, then either the HAVE_AES_KEYWRAP
578+
build option should be enabled to enable the wolfcrypt built-in AES key
579+
wrap/unwrap functionality, or a custom AES key wrap/unwrap callback should
580+
be set with wc_PKCS7_SetAESKeyWrapUnwrapCb(). If neither of these is true,
581+
decryption will fail.
582+
576583
\return On successfully extracting the information from the message,
577584
returns the bytes written to output
578585
\return BAD_FUNC_ARG Returned if one of the input parameters is invalid

tests/api.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17487,7 +17487,7 @@ static int test_wc_PKCS7_VerifySignedData_ECC(void)
1748717487

1748817488

1748917489
#if defined(HAVE_PKCS7) && !defined(NO_AES) && defined(HAVE_AES_CBC) && \
17490-
defined(WOLFSSL_AES_256)
17490+
defined(WOLFSSL_AES_256) && defined(HAVE_AES_KEYWRAP)
1749117491
static const byte defKey[] = {
1749217492
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
1749317493
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
@@ -17496,6 +17496,7 @@ static const byte defKey[] = {
1749617496
};
1749717497
static byte aesHandle[32]; /* simulated hardware key handle */
1749817498

17499+
1749917500
/* return 0 on success */
1750017501
static int myDecryptionFunc(PKCS7* pkcs7, int encryptOID, byte* iv, int ivSz,
1750117502
byte* aad, word32 aadSz, byte* authTag, word32 authTagSz,
@@ -17585,7 +17586,8 @@ static int myCEKwrapFunc(PKCS7* pkcs7, byte* cek, word32 cekSz, byte* keyId,
1758517586
return BAD_KEYWRAP_ALG_E;
1758617587
};
1758717588
}
17588-
#endif /* HAVE_PKCS7 && !NO_AES && HAVE_AES_CBC && WOLFSSL_AES_256 */
17589+
#endif /* HAVE_PKCS7 && !NO_AES && HAVE_AES_CBC && WOLFSSL_AES_256 &&
17590+
HAVE_AES_KEYWRAP */
1758917591

1759017592

1759117593
#if defined(HAVE_PKCS7) && defined(ASN_BER_TO_DER)
@@ -17691,8 +17693,10 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
1769117693
#ifdef ECC_TIMING_RESISTANT
1769217694
WC_RNG rng;
1769317695
#endif
17696+
#ifdef HAVE_AES_KEYWRAP
1769417697
word32 tempWrd32 = 0;
1769517698
byte* tmpBytePtr = NULL;
17699+
#endif
1769617700
const char input[] = "Test data to encode.";
1769717701
int i;
1769817702
int testSz = 0;
@@ -17842,7 +17846,7 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
1784217846
{(byte*)input, (word32)(sizeof(input)/sizeof(char)), DATA, DES3b, 0, 0,
1784317847
rsaCert, rsaCertSz, rsaPrivKey, rsaPrivKeySz},
1784417848
#endif /* NO_DES3 */
17845-
#if !defined(NO_AES) && defined(HAVE_AES_CBC)
17849+
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(HAVE_AES_KEYWRAP)
1784617850
#ifdef WOLFSSL_AES_128
1784717851
{(byte*)input, (word32)(sizeof(input)/sizeof(char)), DATA, AES128CBCb,
1784817852
0, 0, rsaCert, rsaCertSz, rsaPrivKey, rsaPrivKeySz},
@@ -17859,7 +17863,7 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
1785917863

1786017864
#endif /* NO_RSA */
1786117865
#if defined(HAVE_ECC)
17862-
#if !defined(NO_AES) && defined(HAVE_AES_CBC)
17866+
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(HAVE_AES_KEYWRAP)
1786317867
#if !defined(NO_SHA) && defined(WOLFSSL_AES_128)
1786417868
{(byte*)input, (word32)(sizeof(input)/sizeof(char)), DATA,
1786517869
AES128CBCb, AES128_WRAP, dhSinglePass_stdDH_sha1kdf_scheme,
@@ -17875,7 +17879,7 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
1787517879
AES256CBCb, AES256_WRAP, dhSinglePass_stdDH_sha512kdf_scheme,
1787617880
eccCert, eccCertSz, eccPrivKey, eccPrivKeySz},
1787717881
#endif
17878-
#endif /* NO_AES && HAVE_AES_CBC*/
17882+
#endif /* NO_AES && HAVE_AES_CBC && HAVE_AES_KEYWRAP */
1787917883
#endif /* END HAVE_ECC */
1788017884
}; /* END pkcs7EnvelopedVector */
1788117885

@@ -18031,7 +18035,8 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
1803118035
ExpectIntEQ(wc_PKCS7_DecodeEnvelopedData(pkcs7, output, 0, decoded,
1803218036
(word32)sizeof(decoded)), WC_NO_ERR_TRACE(BAD_FUNC_ARG));
1803318037
/* Should get a return of BAD_FUNC_ARG with structure data. Order matters.*/
18034-
#if defined(HAVE_ECC) && !defined(NO_AES) && defined(HAVE_AES_CBC)
18038+
#if defined(HAVE_ECC) && !defined(NO_AES) && defined(HAVE_AES_CBC) && \
18039+
defined(HAVE_AES_KEYWRAP)
1803518040
/* only a failure for KARI test cases */
1803618041
if (pkcs7 != NULL) {
1803718042
tempWrd32 = pkcs7->singleCertSz;
@@ -18069,11 +18074,11 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
1806918074
pkcs7->singleCert = tmpBytePtr;
1807018075
}
1807118076
#endif
18077+
#ifdef HAVE_AES_KEYWRAP
1807218078
if (pkcs7 != NULL) {
1807318079
tempWrd32 = pkcs7->privateKeySz;
1807418080
pkcs7->privateKeySz = 0;
1807518081
}
18076-
1807718082
ExpectIntEQ(wc_PKCS7_DecodeEnvelopedData(pkcs7, output,
1807818083
(word32)sizeof(output), decoded, (word32)sizeof(decoded)),
1807918084
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
@@ -18089,11 +18094,13 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
1808918094
if (pkcs7 != NULL) {
1809018095
pkcs7->privateKey = tmpBytePtr;
1809118096
}
18097+
#endif
1809218098

1809318099
wc_PKCS7_Free(pkcs7);
1809418100
pkcs7 = NULL;
1809518101

18096-
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_256)
18102+
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_256) && \
18103+
defined(HAVE_AES_KEYWRAP)
1809718104
/* test of decrypt callback with KEKRI enveloped data */
1809818105
{
1809918106
int envelopedSz = 0;
@@ -18124,7 +18131,7 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
1812418131
wc_PKCS7_Free(pkcs7);
1812518132
pkcs7 = NULL;
1812618133
}
18127-
#endif /* !NO_AES && WOLFSSL_AES_256 */
18134+
#endif /* !NO_AES && HAVE_AES_CBC && WOLFSSL_AES_256 && HAVE_AES_KEYWRAP */
1812818135

1812918136
#ifndef NO_RSA
1813018137
XFREE(rsaCert, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);

wolfcrypt/src/pkcs7.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6843,8 +6843,12 @@ static int wc_PKCS7_KeyWrap(const wc_PKCS7 * pkcs7, const byte * cek,
68436843
out, outSz);
68446844
}
68456845
else {
6846+
#ifdef HAVE_AES_KEYWRAP
68466847
ret = wc_AesKeyWrap(kek, kekSz, cek, cekSz,
68476848
out, outSz, NULL);
6849+
#else
6850+
ret = NOT_COMPILED_IN;
6851+
#endif
68486852
}
68496853

68506854
} else if (direction == AES_DECRYPTION) {
@@ -6853,8 +6857,12 @@ static int wc_PKCS7_KeyWrap(const wc_PKCS7 * pkcs7, const byte * cek,
68536857
out, outSz);
68546858
}
68556859
else {
6860+
#ifdef HAVE_AES_KEYWRAP
68566861
ret = wc_AesKeyUnWrap(kek, kekSz, cek, cekSz,
68576862
out, outSz, NULL);
6863+
#else
6864+
ret = NOT_COMPILED_IN;
6865+
#endif
68586866
}
68596867
} else {
68606868
WOLFSSL_MSG("Bad key un/wrap direction");

wolfcrypt/test/test.c

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52135,14 +52135,14 @@ static wc_test_ret_t pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
5213552135
};
5213652136

5213752137
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_256) && \
52138-
defined(HAVE_ECC) && defined(WOLFSSL_SHA512)
52138+
defined(HAVE_ECC) && defined(WOLFSSL_SHA512) && defined(HAVE_AES_KEYWRAP)
5213952139
byte optionalUkm[] = {
5214052140
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07
5214152141
};
5214252142
#endif /* !NO_AES */
5214352143

5214452144
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_128) && \
52145-
!defined(NO_SHA)
52145+
!defined(NO_SHA) && defined(HAVE_AES_KEYWRAP)
5214652146
/* encryption key for kekri recipient types */
5214752147
WOLFSSL_SMALL_STACK_STATIC const byte secretKey[] = {
5214852148
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
@@ -52156,7 +52156,8 @@ static wc_test_ret_t pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
5215652156
#endif
5215752157

5215852158
#if !defined(NO_PWDBASED) && !defined(NO_SHA) && \
52159-
!defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_128)
52159+
!defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_128) && \
52160+
defined(HAVE_AES_KEYWRAP)
5216052161

5216152162
#ifndef HAVE_FIPS
5216252163
WOLFSSL_SMALL_STACK_STATIC const char password[] = "password"; /* NOTE: Password is too short for FIPS */
@@ -52203,7 +52204,7 @@ static wc_test_ret_t pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
5220352204
"pkcs7envelopedDataDES3.der");
5220452205
#endif
5220552206

52206-
#if !defined(NO_AES) && defined(HAVE_AES_CBC)
52207+
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(HAVE_AES_KEYWRAP)
5220752208
#ifdef WOLFSSL_AES_128
5220852209
ADD_PKCS7ENVELOPEDVECTOR(
5220952210
data, (word32)sizeof(data), DATA, AES128CBCb, 0, 0, rsaCert, rsaCertSz,
@@ -52239,11 +52240,11 @@ static wc_test_ret_t pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
5223952240
NULL, 0, NULL, 0, NULL, NULL, 0, NULL, 0, 0, NULL, 0, NULL, 0, 0, 0,
5224052241
0, 0, 0, 0, "pkcs7envelopedDataAES256CBC_IANDS.der");
5224152242
#endif
52242-
#endif /* !NO_AES && HAVE_AES_CBC */
52243+
#endif /* !NO_AES && HAVE_AES_CBC && HAVE_AES_KEYWRAP */
5224352244
#endif
5224452245

5224552246
/* key agreement key encryption technique*/
52246-
#ifdef HAVE_ECC
52247+
#if defined(HAVE_ECC) && defined(HAVE_AES_KEYWRAP)
5224752248
#if !defined(NO_AES) && defined(HAVE_AES_CBC)
5224852249
#if !defined(NO_SHA) && defined(WOLFSSL_AES_128)
5224952250
ADD_PKCS7ENVELOPEDVECTOR(
@@ -52283,7 +52284,7 @@ static wc_test_ret_t pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
5228352284
#endif
5228452285

5228552286
/* kekri (KEKRecipientInfo) recipient types */
52286-
#if !defined(NO_AES) && defined(HAVE_AES_CBC)
52287+
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(HAVE_AES_KEYWRAP)
5228752288
#if !defined(NO_SHA) && defined(WOLFSSL_AES_128)
5228852289
ADD_PKCS7ENVELOPEDVECTOR(
5228952290
data, (word32)sizeof(data), DATA, AES128CBCb, AES128_WRAP, 0,
@@ -52292,11 +52293,12 @@ static wc_test_ret_t pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
5229252293
0, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0,
5229352294
"pkcs7envelopedDataAES128CBC_KEKRI.der");
5229452295
#endif
52295-
#endif /* !NO_AES && HAVE_AES_CBC */
52296+
#endif /* !NO_AES && HAVE_AES_CBC && HAVE_AES_KEYWRAP */
5229652297

5229752298
/* pwri (PasswordRecipientInfo) recipient types */
5229852299
#if !defined(NO_PWDBASED) && !defined(NO_AES) && defined(HAVE_AES_CBC)
52299-
#if !defined(NO_SHA) && defined(WOLFSSL_AES_128)
52300+
#if !defined(NO_SHA) && defined(WOLFSSL_AES_128) && \
52301+
defined(HAVE_AES_KEYWRAP)
5230052302
ADD_PKCS7ENVELOPEDVECTOR(
5230152303
data, (word32)sizeof(data), DATA, AES128CBCb, 0, 0,
5230252304
NULL, 0, NULL, 0, NULL, 0, 0, 0, NULL, 0,
@@ -52306,7 +52308,8 @@ static wc_test_ret_t pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
5230652308
#endif
5230752309
#endif
5230852310

52309-
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_128)
52311+
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_128) && \
52312+
defined(HAVE_AES_KEYWRAP)
5231052313
/* ori (OtherRecipientInfo) recipient types */
5231152314
ADD_PKCS7ENVELOPEDVECTOR(
5231252315
data, (word32)sizeof(data), DATA, AES128CBCb, 0, 0, NULL, 0, NULL, 0,
@@ -52752,7 +52755,7 @@ static wc_test_ret_t pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCer
5275252755
};
5275352756
byte senderNonce[PKCS7_NONCE_SZ + 2];
5275452757
#ifdef HAVE_ECC
52755-
#if !defined(NO_AES) && defined(HAVE_AESGCM)
52758+
#if !defined(NO_AES) && defined(HAVE_AESGCM) && defined(HAVE_AES_KEYWRAP)
5275652759
#if !defined(NO_SHA256) && defined(WOLFSSL_AES_256)
5275752760
WOLFSSL_SMALL_STACK_STATIC const byte senderNonceOid[] =
5275852761
{ 0x06, 0x0a, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01,
@@ -52768,13 +52771,14 @@ static wc_test_ret_t pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCer
5276852771
#endif
5276952772

5277052773
#if !defined(NO_AES) && defined(WOLFSSL_AES_256) && defined(HAVE_ECC) && \
52771-
defined(WOLFSSL_SHA512) && defined(HAVE_AESGCM)
52774+
defined(WOLFSSL_SHA512) && defined(HAVE_AESGCM) && defined(HAVE_AES_KEYWRAP)
5277252775
WOLFSSL_SMALL_STACK_STATIC const byte optionalUkm[] = {
5277352776
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07
5277452777
};
5277552778
#endif /* !NO_AES */
5277652779

52777-
#if !defined(NO_AES) && !defined(NO_SHA) && defined(WOLFSSL_AES_128)
52780+
#if !defined(NO_AES) && !defined(NO_SHA) && defined(WOLFSSL_AES_128) && \
52781+
defined(HAVE_AES_KEYWRAP)
5277852782
/* encryption key for kekri recipient types */
5277952783
WOLFSSL_SMALL_STACK_STATIC const byte secretKey[] = {
5278052784
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
@@ -52788,7 +52792,8 @@ static wc_test_ret_t pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCer
5278852792
#endif
5278952793

5279052794
#if !defined(NO_PWDBASED) && !defined(NO_AES) && defined(HAVE_AESGCM) && \
52791-
!defined(NO_SHA) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_128)
52795+
!defined(NO_SHA) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_128) && \
52796+
defined(HAVE_AES_KEYWRAP)
5279252797

5279352798
#ifndef HAVE_FIPS
5279452799
WOLFSSL_SMALL_STACK_STATIC const char password[] = "password";
@@ -52826,7 +52831,7 @@ static wc_test_ret_t pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCer
5282652831
{
5282752832
/* key transport key encryption technique */
5282852833
#ifndef NO_RSA
52829-
#if !defined(NO_AES) && defined(HAVE_AESGCM)
52834+
#if !defined(NO_AES) && defined(HAVE_AESGCM) && defined(HAVE_AES_KEYWRAP)
5283052835
#ifdef WOLFSSL_AES_128
5283152836
ADD_PKCS7AUTHENVELOPEDVECTOR(
5283252837
data, (word32)sizeof(data), DATA, AES128GCMb, 0, 0, rsaCert, rsaCertSz,
@@ -52876,12 +52881,12 @@ static wc_test_ret_t pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCer
5287652881
(void)rsaCertSz;
5287752882
(void)rsaPrivKey;
5287852883
(void)rsaPrivKeySz;
52879-
#endif /* !NO_AES && !HAVE_AESGCM */
52884+
#endif /* !NO_AES && !HAVE_AESGCM && HAVE_AES_KEYWRAP */
5288052885
#endif
5288152886

5288252887
/* key agreement key encryption technique*/
5288352888
#ifdef HAVE_ECC
52884-
#if !defined(NO_AES) && defined(HAVE_AESGCM)
52889+
#if !defined(NO_AES) && defined(HAVE_AESGCM) && defined(HAVE_AES_KEYWRAP)
5288552890
#if !defined(NO_SHA) && defined(WOLFSSL_AES_128)
5288652891
ADD_PKCS7AUTHENVELOPEDVECTOR(
5288752892
data, (word32)sizeof(data), DATA, AES128GCMb, AES128_WRAP,
@@ -52958,11 +52963,11 @@ static wc_test_ret_t pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCer
5295852963
0, 0, 0, 0, 0, 0,
5295952964
"pkcs7authEnvelopedDataAES256GCM_ECDH_SHA512KDF_ukm.der");
5296052965
#endif /* WOLFSSL_SHA512 && WOLFSSL_AES_256 */
52961-
#endif /* !NO_AES && HAVE_AESGCM */
52966+
#endif /* !NO_AES && HAVE_AESGCM && HAVE_AES_KEYWRAP */
5296252967
#endif
5296352968

5296452969
/* kekri (KEKRecipientInfo) recipient types */
52965-
#if !defined(NO_AES) && defined(HAVE_AESGCM)
52970+
#if !defined(NO_AES) && defined(HAVE_AESGCM) && defined(HAVE_AES_KEYWRAP)
5296652971
#if !defined(NO_SHA) && defined(WOLFSSL_AES_128)
5296752972
ADD_PKCS7AUTHENVELOPEDVECTOR(
5296852973
data, (word32)sizeof(data), DATA, AES128GCMb, AES128_WRAP, 0,
@@ -52974,7 +52979,8 @@ static wc_test_ret_t pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCer
5297452979
#endif
5297552980

5297652981
/* pwri (PasswordRecipientInfo) recipient types */
52977-
#if !defined(NO_PWDBASED) && !defined(NO_AES) && defined(HAVE_AESGCM)
52982+
#if !defined(NO_PWDBASED) && !defined(NO_AES) && defined(HAVE_AESGCM) && \
52983+
defined(HAVE_AES_KEYWRAP)
5297852984
#if !defined(NO_SHA) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_128)
5297952985
ADD_PKCS7AUTHENVELOPEDVECTOR(
5298052986
data, (word32)sizeof(data), DATA, AES128GCMb, 0, 0,
@@ -52985,7 +52991,7 @@ static wc_test_ret_t pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCer
5298552991
#endif
5298652992
#endif
5298752993

52988-
#if !defined(NO_AES) && defined(HAVE_AESGCM)
52994+
#if !defined(NO_AES) && defined(HAVE_AESGCM) && defined(HAVE_AES_KEYWRAP)
5298952995
#ifdef WOLFSSL_AES_128
5299052996
/* ori (OtherRecipientInfo) recipient types */
5299152997
ADD_PKCS7AUTHENVELOPEDVECTOR(
@@ -53271,7 +53277,8 @@ static wc_test_ret_t pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCer
5327153277
(void)eccCertSz;
5327253278
(void)eccPrivKey;
5327353279
(void)eccPrivKeySz;
53274-
#if !defined(NO_AES) && !defined(NO_SHA) && defined(WOLFSSL_AES_128)
53280+
#if !defined(NO_AES) && !defined(NO_SHA) && defined(WOLFSSL_AES_128) && \
53281+
defined(HAVE_AES_KEYWRAP)
5327553282
(void)secretKey;
5327653283
(void)secretKeyId;
5327753284
#endif
@@ -53381,7 +53388,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs7authenveloped_test(void)
5338153388

5338253389
#endif /* HAVE_AESGCM || HAVE_AESCCM */
5338353390

53384-
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_256)
53391+
#if !defined(NO_AES) && defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_256) && \
53392+
defined(HAVE_AES_KEYWRAP)
5338553393
static const byte p7DefKey[] = {
5338653394
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
5338753395
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
@@ -53813,7 +53821,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs7callback_test(byte* cert, word32 cert
5381353821

5381453822
return ret;
5381553823
}
53816-
#endif /* !NO_AES && HAVE_AES_CBC && WOLFSSL_AES_256 */
53824+
#endif /* !NO_AES && HAVE_AES_CBC && WOLFSSL_AES_256 && HAVE_AES_KEYWRAP */
5381753825

5381853826
#ifndef NO_PKCS7_ENCRYPTED_DATA
5381953827

@@ -55417,7 +55425,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs7signed_test(void)
5541755425
eccClientPrivKeyBuf, (word32)eccClientPrivKeyBufSz);
5541855426

5541955427
#if !defined(NO_RSA) && !defined(NO_AES) && defined(HAVE_AES_CBC) && \
55420-
defined(WOLFSSL_AES_256)
55428+
defined(WOLFSSL_AES_256) && defined(HAVE_AES_KEYWRAP)
5542155429
if (ret >= 0)
5542255430
ret = pkcs7callback_test(
5542355431
rsaClientCertBuf, (word32)rsaClientCertBufSz,

wolfssl/wolfcrypt/settings.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3416,9 +3416,6 @@ extern void uITRON4_free(void *p) ;
34163416
#if defined(NO_AES) && defined(NO_DES3)
34173417
#error PKCS7 needs either AES or 3DES enabled, please enable one
34183418
#endif
3419-
#ifndef HAVE_AES_KEYWRAP
3420-
#error PKCS7 requires AES key wrap please define HAVE_AES_KEYWRAP
3421-
#endif
34223419
#if defined(HAVE_ECC) && !defined(HAVE_X963_KDF)
34233420
#error PKCS7 requires X963 KDF please define HAVE_X963_KDF
34243421
#endif

0 commit comments

Comments
 (0)