Make server-tls13.c and client-tls13.c quantum-safe.

pull/271/head
Anthony Hu 2021-11-01 11:59:12 -04:00
parent 59dc4f482b
commit ab92c0ae4a
2 changed files with 17 additions and 3 deletions

View File

@ -38,7 +38,7 @@
#define DEFAULT_PORT 11111
#define CERT_FILE "../certs/ca-cert.pem"
#define CERT_FILE "../certs/falcon_level5_root_cert.pem"
#if defined(WOLFSSL_TLS13) && defined(HAVE_SECRET_CALLBACK)
@ -185,6 +185,13 @@ int main(int argc, char** argv)
ret = -1; goto exit;
}
ret = wolfSSL_UseKeyShare(ssl, WOLFSSL_P521_KYBER_LEVEL5);
if (ret < 0) {
fprintf(stderr, "ERROR: failed to set the requested group to "
"P521_KYBER_LEVEL5.\n");
ret = -1; goto exit;
}
/* Attach wolfSSL to the socket */
if ((ret = wolfSSL_set_fd(ssl, sockfd)) != WOLFSSL_SUCCESS) {
fprintf(stderr, "ERROR: Failed to set the file descriptor\n");

View File

@ -43,8 +43,8 @@
#define DEFAULT_PORT 11111
#define CERT_FILE "../certs/server-cert.pem"
#define KEY_FILE "../certs/server-key.pem"
#define CERT_FILE "../certs/falcon_level5_entity_cert.pem"
#define KEY_FILE "../certs/falcon_level5_entity_key.pem"
#if defined(WOLFSSL_TLS13) && defined(HAVE_SECRET_CALLBACK)
@ -229,6 +229,13 @@ int main(int argc, char** argv)
ret = -1; goto exit;
}
ret = wolfSSL_UseKeyShare(ssl, WOLFSSL_P521_KYBER_LEVEL5);
if (ret < 0) {
fprintf(stderr, "ERROR: failed to set the requested group to "
"P521_KYBER_LEVEL5.\n");
ret = -1; goto exit;
}
/* Attach wolfSSL to the socket */
wolfSSL_set_fd(ssl, mConnd);