From 746ffac84ad72e4817f2ce908614e54023b80983 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 16 Jan 2024 15:18:05 -0800 Subject: [PATCH] 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. --- src/internal.c | 1 + tests/test-dtls.conf | 14 ++++++++++++++ tests/test.conf | 12 ++++++++++++ 3 files changed, 27 insertions(+) diff --git a/src/internal.c b/src/internal.c index 978c413f16..31334eb431 100644 --- a/src/internal.c +++ b/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) { diff --git a/tests/test-dtls.conf b/tests/test-dtls.conf index 42f0f63c83..bb055c36b2 100644 --- a/tests/test-dtls.conf +++ b/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 diff --git a/tests/test.conf b/tests/test.conf index 099ef47061..73d40f000c 100644 --- a/tests/test.conf +++ b/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