Merge pull request #5889 from anhu/dtls13_pqtests

Kyber with DTLS 1.3 tests
This commit is contained in:
David Garske 2022-12-14 13:20:32 -08:00 committed by GitHub
commit 3fd2292d11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 73 additions and 1 deletions

View File

@ -8454,7 +8454,7 @@ static int server_generate_pqc_ciphertext(WOLFSSL* ssl,
if (ret == 0) {
ret = wc_KyberKey_Init(type, kem, ssl->heap, INVALID_DEVID);
if (ret == 0) {
if (ret != 0) {
WOLFSSL_MSG("Error creating Kyber KEM");
}
}

View File

@ -28,6 +28,8 @@ EXTRA_DIST += tests/unit.h \
tests/test-tls13-psk.conf \
tests/test-tls13-pq.conf \
tests/test-tls13-pq-2.conf \
tests/test-dtls13-pq.conf \
tests/test-dtls13-pq-2.conf \
tests/test-psk.conf \
tests/test-psk-no-id.conf \
tests/test-psk-no-id-sha2.conf \

View File

@ -927,6 +927,50 @@ int SuiteTest(int argc, char** argv)
}
#endif
#endif
#ifdef HAVE_PQC
/* add TLSv13 pq tests */
XSTRLCPY(argv0[1], "tests/test-tls13-pq.conf", sizeof(argv0[1]));
printf("starting TLSv13 post-quantum groups tests\n");
test_harness(&args);
if (args.return_code != 0) {
printf("error from script %d\n", args.return_code);
args.return_code = EXIT_FAILURE;
goto exit;
}
#ifdef HAVE_LIBOQS
/* add TLSv13 pq tests */
XSTRLCPY(argv0[1], "tests/test-tls13-pq-2.conf", sizeof(argv0[1]));
printf("starting TLSv13 post-quantum groups tests\n");
test_harness(&args);
if (args.return_code != 0) {
printf("error from script %d\n", args.return_code);
args.return_code = EXIT_FAILURE;
goto exit;
}
#endif
#endif
#if defined(HAVE_PQC) && defined(WOLFSSL_DTLS13)
/* add DTLSv13 pq tests */
XSTRLCPY(argv0[1], "tests/test-dtls13-pq.conf", sizeof(argv0[1]));
printf("starting DTLSv13 post-quantum groups tests\n");
test_harness(&args);
if (args.return_code != 0) {
printf("error from script %d\n", args.return_code);
args.return_code = EXIT_FAILURE;
goto exit;
}
#ifdef HAVE_LIBOQS
/* add DTLSv13 pq tests */
XSTRLCPY(argv0[1], "tests/test-dtls13-pq-2.conf", sizeof(argv0[1]));
printf("starting DTLSv13 post-quantum groups tests\n");
test_harness(&args);
if (args.return_code != 0) {
printf("error from script %d\n", args.return_code);
args.return_code = EXIT_FAILURE;
goto exit;
}
#endif
#endif
#endif
#if defined(WC_RSA_PSS) && (!defined(HAVE_FIPS) || \
(defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2))) && \

View File

@ -0,0 +1,13 @@
# server DTLSv1.3 with post-quantum group
-u
-v 4
-l TLS13-AES256-GCM-SHA384
--pqc P256_KYBER_LEVEL1
# client DTLSv1.3 with post-quantum group
-u
-v 4
-l TLS13-AES256-GCM-SHA384
--pqc P256_KYBER_LEVEL1
# P384_KYBER_LEVEL3 and P521_KYBER_LEVEL5 would fragment the ClientHello.

13
tests/test-dtls13-pq.conf Normal file
View File

@ -0,0 +1,13 @@
# server DTLSv1.3 with post-quantum group
-u
-v 4
-l TLS13-AES256-GCM-SHA384
--pqc KYBER_LEVEL1
# client DTLSv1.3 with post-quantum group
-u
-v 4
-l TLS13-AES256-GCM-SHA384
--pqc KYBER_LEVEL1
# KYBER_LEVEL3 and KYBER_LEVEL5 would fragment the ClientHello.