Skip to content

Commit 9666394

Browse files
authored
Merge pull request #7977 from billphipps/have_rsa_fix
Update to remove HAVE_RSA references. Correct NO_MALLOC RSA test bug.
2 parents e6b466d + b4a491d commit 9666394

5 files changed

Lines changed: 10 additions & 9 deletions

File tree

IDE/Renesas/e2studio/RA6M3/common/user_settings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#define HAVE_CHACHA
5151
#define HAVE_POLY1305
5252
#define HAVE_ECC
53-
#define HAVE_RSA
5453
#define HAVE_SHA256
5554
#define HAVE_SUPPORTED_CURVES
5655
#define HAVE_TLS_EXTENSIONS

examples/configs/user_settings_wolfboot_keytools.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
#define WOLFSSL_SHAKE256
5858

5959
/* RSA */
60-
#define HAVE_RSA
6160
#define WOLFSSL_HAVE_SP_RSA
6261
#define WC_RSA_BLINDING
6362
#define WOLFSSL_KEY_GEN

tests/api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47390,7 +47390,7 @@ static int test_wc_SetSubjectKeyIdFromPublicKey_ex(void)
4739047390
#if defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_CERT_GEN)
4739147391
WC_RNG rng;
4739247392
Cert cert;
47393-
#if !defined(NO_RSA) && defined(HAVE_RSA)
47393+
#if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN)
4739447394
RsaKey rsaKey;
4739547395
int bits = 2048;
4739647396
#endif
@@ -47413,7 +47413,7 @@ static int test_wc_SetSubjectKeyIdFromPublicKey_ex(void)
4741347413

4741447414
ExpectIntEQ(wc_InitCert(&cert), 0);
4741547415

47416-
#if !defined(NO_RSA) && defined(HAVE_RSA) && defined(WOLFSSL_KEY_GEN)
47416+
#if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN)
4741747417
/* RSA */
4741847418
XMEMSET(&rsaKey, 0, sizeof(RsaKey));
4741947419
ExpectIntEQ(wc_InitRsaKey(&rsaKey, HEAP_HINT), 0);
@@ -47472,7 +47472,7 @@ static int test_wc_SetAuthKeyIdFromPublicKey_ex(void)
4747247472
#if defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_CERT_GEN)
4747347473
WC_RNG rng;
4747447474
Cert cert;
47475-
#if !defined(NO_RSA) && defined(HAVE_RSA)
47475+
#if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN)
4747647476
RsaKey rsaKey;
4747747477
int bits = 2048;
4747847478
#endif
@@ -47495,7 +47495,7 @@ static int test_wc_SetAuthKeyIdFromPublicKey_ex(void)
4749547495

4749647496
ExpectIntEQ(wc_InitCert(&cert), 0);
4749747497

47498-
#if !defined(NO_RSA) && defined(HAVE_RSA) && defined(WOLFSSL_KEY_GEN)
47498+
#if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN)
4749947499
/* RSA */
4750047500
XMEMSET(&rsaKey, 0, sizeof(RsaKey));
4750147501
ExpectIntEQ(wc_InitRsaKey(&rsaKey, HEAP_HINT), 0);

tests/suites.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ int SuiteTest(int argc, char** argv)
13461346
args.return_code = EXIT_FAILURE;
13471347
goto exit;
13481348
}
1349-
#endif /* HAVE_RSA and HAVE_ECC */
1349+
#endif /* !NO__RSA and HAVE_ECC */
13501350
#endif /* !WC_STRICT_SIG */
13511351
#if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3) && \
13521352
(defined(WOLFSSL_SM4_GCM) || defined(WOLFSSL_SM4_CCM))

wolfcrypt/test/test.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20994,7 +20994,7 @@ static wc_test_ret_t rsa_keygen_test(WC_RNG* rng)
2099420994
#ifndef WOLFSSL_NO_MALLOC
2099520995
byte* der = NULL;
2099620996
#else
20997-
byte der[1024];
20997+
byte der[1280];
2099820998
#endif
2099920999
#ifndef WOLFSSL_CRYPTOCELL
2100021000
word32 idx = 0;
@@ -21046,8 +21046,11 @@ static wc_test_ret_t rsa_keygen_test(WC_RNG* rng)
2104621046
if (der == NULL) {
2104721047
ERROR_OUT(WC_TEST_RET_ENC_ERRNO, exit_rsa);
2104821048
}
21049+
derSz = FOURK_BUF;
21050+
#else
21051+
derSz = sizeof(der);
2104921052
#endif
21050-
derSz = wc_RsaKeyToDer(genKey, der, FOURK_BUF);
21053+
derSz = wc_RsaKeyToDer(genKey, der, derSz);
2105121054
if (derSz < 0) {
2105221055
ERROR_OUT(WC_TEST_RET_ENC_EC(derSz), exit_rsa);
2105321056
}

0 commit comments

Comments
 (0)