Skip to content

Commit 326ae87

Browse files
committed
More disable flag fixes for ECDHE.
1 parent ccc590c commit 326ae87

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/internal.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,7 @@ static INLINE enum wc_HashType HashForId(byte id)
22812281
}
22822282

22832283

2284-
#ifndef WOLFSSH_NO_ECDSA
2284+
#if !defined(WOLFSSH_NO_ECDSA) && !defined(WOLFSSH_NO_ECDH)
22852285
static INLINE int wcPrimeForId(byte id)
22862286
{
22872287
switch (id) {
@@ -2310,11 +2310,7 @@ static INLINE int wcPrimeForId(byte id)
23102310
return ECC_SECP521R1;
23112311
#endif
23122312
default:
2313-
#if !defined(WOLFSSH_NO_ECDSA) && !defined(WOLFSSH_NO_ECDH)
23142313
return ECC_CURVE_INVALID;
2315-
#else
2316-
return -1;
2317-
#endif
23182314
}
23192315
}
23202316

@@ -2875,10 +2871,14 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
28752871
int ret = WS_SUCCESS;
28762872
int tmpIdx = 0;
28772873
struct wolfSSH_sigKeyBlock *sigKeyBlock_ptr = NULL;
2874+
#ifndef WOLFSSH_NO_ECDH
28782875
ecc_key *key_ptr = NULL;
2876+
#ifndef WOLFSSH_SMALL_STACK
2877+
ecc_key key_s;
2878+
#endif
2879+
#endif
28792880
#ifndef WOLFSSH_SMALL_STACK
28802881
struct wolfSSH_sigKeyBlock s_sigKeyBlock;
2881-
ecc_key key_s;
28822882
#endif
28832883

28842884
WLOG(WS_LOG_DEBUG, "Entering DoKexDhReply()");
@@ -6665,7 +6665,9 @@ int SendKexDhReply(WOLFSSH* ssh)
66656665
{
66666666
int ret = WS_SUCCESS;
66676667
byte *f_ptr = NULL, *sig_ptr = NULL;
6668+
#ifndef WOLFSSH_NO_ECDH
66686669
byte *r_ptr = NULL, *s_ptr = NULL;
6670+
#endif
66696671
byte scratchLen[LENGTH_SZ];
66706672
word32 fSz = KEX_F_SIZE;
66716673
word32 sigSz = KEX_SIG_SIZE;

0 commit comments

Comments
 (0)