Kyber with DTLS 1.3 tests

This commit is contained in:
Anthony Hu 2022-12-14 12:46:24 -05:00
parent b2d25ece98
commit ad6d6be620
4 changed files with 71 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

@ -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.