@@ -32603,6 +32603,9 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
32603
32603
ERROR_OUT(ECC_CURVE_ERROR, exit_dske);
32604
32604
}
32605
32605
ssl->ecdhCurveOID = (word32)curveOid;
32606
+ #if defined(WOLFSSL_TLS13) || defined(HAVE_FFDHE)
32607
+ ssl->namedGroup = 0;
32608
+ #endif
32606
32609
32607
32610
length = input[args->idx++];
32608
32611
if ((args->idx - args->begin) + length > size) {
@@ -32617,7 +32620,7 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
32617
32620
if (ret != 0) {
32618
32621
goto exit_dske;
32619
32622
}
32620
- } else if (ssl->peerEccKeyPresent ) {
32623
+ } else if (ssl->peerX25519KeyPresent ) {
32621
32624
ret = ReuseKey(ssl, DYNAMIC_TYPE_CURVE25519,
32622
32625
ssl->peerX25519Key);
32623
32626
ssl->peerX25519KeyPresent = 0;
@@ -32660,7 +32663,7 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
32660
32663
if (ret != 0) {
32661
32664
goto exit_dske;
32662
32665
}
32663
- } else if (ssl->peerEccKeyPresent ) {
32666
+ } else if (ssl->peerX448KeyPresent ) {
32664
32667
ret = ReuseKey(ssl, DYNAMIC_TYPE_CURVE448,
32665
32668
ssl->peerX448Key);
32666
32669
ssl->peerX448KeyPresent = 0;
@@ -32695,7 +32698,7 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
32695
32698
break;
32696
32699
}
32697
32700
#endif
32698
-
32701
+ #ifdef HAVE_ECC
32699
32702
if (ssl->peerEccKey == NULL) {
32700
32703
ret = AllocKey(ssl, DYNAMIC_TYPE_ECC,
32701
32704
(void**)&ssl->peerEccKey);
@@ -32713,11 +32716,15 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
32713
32716
curveId = wc_ecc_get_oid((word32)curveOid, NULL, NULL);
32714
32717
if (wc_ecc_import_x963_ex(input + args->idx, length,
32715
32718
ssl->peerEccKey, curveId) != 0) {
32719
+ #ifdef WOLFSSL_EXTRA_ALERTS
32720
+ SendAlert(ssl, alert_fatal, illegal_parameter);
32721
+ #endif
32716
32722
ERROR_OUT(ECC_PEERKEY_ERROR, exit_dske);
32717
32723
}
32718
32724
32719
32725
args->idx += length;
32720
32726
ssl->peerEccKeyPresent = 1;
32727
+ #endif
32721
32728
break;
32722
32729
}
32723
32730
#endif /* (HAVE_ECC || HAVE_CURVE25519 || HAVE_CURVE448) && !NO_PSK */
0 commit comments