Browse Source

ECDHE-PSK with x25519

1. Add missing assignment of the WOLFSSL object's ecdhCurveOid value. It
   is set correctly in the previous cases, but got missed for ECDHE-PSK.
2. Add test cases to the unit testing.
John Safranek 3 months ago
parent
commit
746ffac84a
3 changed files with 27 additions and 0 deletions
  1. 1 0
      src/internal.c
  2. 14 0
      tests/test-dtls.conf
  3. 12 0
      tests/test.conf

+ 1 - 0
src/internal.c

@@ -29895,6 +29895,7 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
                     if ((curveOid = CheckCurveId(b)) < 0) {
                         ERROR_OUT(ECC_CURVE_ERROR, exit_dske);
                     }
+                    ssl->ecdhCurveOID = curveOid;
 
                     length = input[args->idx++];
                     if ((args->idx - args->begin) + length > size) {

+ 14 - 0
tests/test-dtls.conf

@@ -55,6 +55,20 @@
 -s
 -l ECDHE-PSK-CHACHA20-POLY1305
 
+# server TLSv1.2 ECDHE-PSK-CHACHA20-POLY1305 x25519
+-u
+-v 3
+-s
+-t
+-l ECDHE-PSK-CHACHA20-POLY1305
+
+# client TLSv1.2 ECDHE-PSK-CHACHA20-POLY1305 x25519
+-u
+-v 3
+-s
+-t
+-l ECDHE-PSK-CHACHA20-POLY1305
+
 # server TLSv1.2 PSK-CHACHA20-POLY1305
 -u
 -v 3

+ 12 - 0
tests/test.conf

@@ -45,6 +45,18 @@
 -s
 -l ECDHE-PSK-CHACHA20-POLY1305
 
+# server TLSv1.2 ECDHE-PSK-CHACHA20-POLY1305 x25519
+-v 3
+-s
+-t
+-l ECDHE-PSK-CHACHA20-POLY1305
+
+# client TLSv1.2 ECDHE-PSK-CHACHA20-POLY1305 x25519
+-v 3
+-s
+-t
+-l ECDHE-PSK-CHACHA20-POLY1305
+
 # server TLSv1.2 PSK-CHACHA20-POLY1305
 -v 3
 -s