Skip to content

Commit af2b2dd

Browse files
authored
Merge pull request #7253 from julek-wolfssl/zd/17507
wc_ecc_shared_secret_ssh fix
2 parents 757fcbc + 469760e commit af2b2dd

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

tests/api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25070,14 +25070,15 @@ static int test_wc_ecc_pointFns(void)
2507025070

2507125071

2507225072
/*
25073-
* Testing wc_ecc_sahred_secret_ssh()
25073+
* Testing wc_ecc_shared_secret_ssh()
2507425074
*/
2507525075
static int test_wc_ecc_shared_secret_ssh(void)
2507625076
{
2507725077
EXPECT_DECLS;
2507825078
#if defined(HAVE_ECC) && defined(HAVE_ECC_DHE) && \
2507925079
!defined(WC_NO_RNG) && !defined(WOLFSSL_ATECC508A) && \
25080-
!defined(WOLFSSL_ATECC608A)
25080+
!defined(WOLFSSL_ATECC608A) && !defined(PLUTON_CRYPTO_ECC) && \
25081+
!defined(WOLFSSL_CRYPTOCELL)
2508125082
ecc_key key;
2508225083
ecc_key key2;
2508325084
WC_RNG rng;

wolfcrypt/src/evp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,9 +2497,9 @@ int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_
24972497
#endif
24982498
return WOLFSSL_FAILURE;
24992499
}
2500-
if (wc_ecc_shared_secret_ssh((ecc_key*)ctx->pkey->ecc->internal,
2501-
(ecc_point*)ctx->peerKey->ecc->pub_key->internal,
2502-
key, &len32) != MP_OKAY) {
2500+
if (wc_ecc_shared_secret((ecc_key*)ctx->pkey->ecc->internal,
2501+
(ecc_key*)ctx->peerKey->ecc->internal, key, &len32)
2502+
!= MP_OKAY) {
25032503
WOLFSSL_MSG("wc_ecc_shared_secret failed");
25042504
#if defined(ECC_TIMING_RESISTANT) && !defined(HAVE_SELFTEST) \
25052505
&& (!defined(HAVE_FIPS) || \

wolfcrypt/test/test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28354,7 +28354,9 @@ static wc_test_ret_t ecc_mulmod_test(ecc_key* key1)
2835428354
#endif
2835528355

2835628356
#if defined(HAVE_ECC_DHE) && !defined(WC_NO_RNG) && \
28357-
!defined(WOLF_CRYPTO_CB_ONLY_ECC)
28357+
!defined(WOLF_CRYPTO_CB_ONLY_ECC) && !defined(WOLFSSL_ATECC508A) && \
28358+
!defined(WOLFSSL_ATECC608A) && !defined(PLUTON_CRYPTO_ECC) && \
28359+
!defined(WOLFSSL_CRYPTOCELL)
2835828360
static wc_test_ret_t ecc_ssh_test(ecc_key* key, WC_RNG* rng)
2835928361
{
2836028362
wc_test_ret_t ret;

wolfssl/wolfcrypt/ecc.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,8 @@ WOLFSSL_LOCAL
659659
int wc_ecc_shared_secret_gen_sync(ecc_key* private_key,
660660
ecc_point* point, byte* out, word32* outlen);
661661

662-
#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A) || \
663-
defined(PLUTON_CRYPTO_ECC) || defined(WOLFSSL_CRYPTOCELL)
664-
#define wc_ecc_shared_secret_ssh wc_ecc_shared_secret
665-
#else
662+
#if !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A) && \
663+
!defined(PLUTON_CRYPTO_ECC) && !defined(WOLFSSL_CRYPTOCELL)
666664
#define wc_ecc_shared_secret_ssh wc_ecc_shared_secret_ex /* For backwards compat */
667665
#endif
668666

0 commit comments

Comments
 (0)