From 79b738b5a68e0e1541886c11cc242e59d56694be Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Tue, 19 Oct 2021 17:02:44 +0200 Subject: [PATCH] commit-test and jenkins fixes --- src/tls13.c | 44 -------------------------------------------- tests/api.c | 14 ++++---------- wolfssl/ssl.h | 4 +++- 3 files changed, 7 insertions(+), 55 deletions(-) diff --git a/src/tls13.c b/src/tls13.c index 9c98bb1c6..1559fcfb3 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -542,50 +542,6 @@ static int DeriveEarlyTrafficSecret(WOLFSSL* ssl, byte* key) return ret; } -#ifdef HAVE_KEYING_MATERIAL -/* The length of the early exporter label. */ -#define EARLY_EXPORTER_LABEL_SZ 12 -/* The early exporter label. */ -static const byte earlyExporterLabel[EARLY_EXPORTER_LABEL_SZ + 1] = - "e exp master"; - -/* Derive the early exporter key. - * - * ssl The SSL/TLS object. - * key The derived key. - * returns 0 on success, otherwise failure. - */ -static int DeriveEarlyExporterSecret(WOLFSSL* ssl, byte* key) -{ - int ret; - WOLFSSL_MSG("Derive Early Exporter Secret"); - if (ssl == NULL || ssl->arrays == NULL) { - return BAD_FUNC_ARG; - } - ret = DeriveKey(ssl, key, -1, ssl->arrays->secret, - earlyExporterLabel, EARLY_EXPORTER_LABEL_SZ, - ssl->specs.mac_algorithm, 1); -#ifdef HAVE_SECRET_CALLBACK - if (ret == 0 && ssl->tls13SecretCb != NULL) { - ret = ssl->tls13SecretCb(ssl, EARLY_EXPORTER_SECRET, key, - ssl->specs.hash_size, ssl->tls13SecretCtx); - if (ret != 0) { - return TLS13_SECRET_CB_E; - } - } -#ifdef OPENSSL_EXTRA - if (ret == 0 && ssl->tls13KeyLogCb != NULL) { - ret = ssl->tls13KeyLogCb(ssl, EARLY_EXPORTER_SECRET, key, - ssl->specs.hash_size, NULL); - if (ret != 0) { - return TLS13_SECRET_CB_E; - } - } -#endif /* OPENSSL_EXTRA */ -#endif /* HAVE_SECRET_CALLBACK */ - return ret; -} -#endif #endif /* The length of the client handshake label. */ diff --git a/tests/api.c b/tests/api.c index 676f816a1..40191d607 100644 --- a/tests/api.c +++ b/tests/api.c @@ -310,7 +310,6 @@ #include #include #include - #include #include #include #include @@ -6572,7 +6571,7 @@ static void test_wolfSSL_UseTrustedCA(void) #ifndef NO_WOLFSSL_SERVER AssertNotNull((ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()))); AssertTrue(wolfSSL_CTX_use_certificate_file(ctx, svrCertFile, SSL_FILETYPE_PEM)); - AssertTrue(SSL_CTX_use_PrivateKey_file(ctx, svrKeyFile, SSL_FILETYPE_PEM)); + AssertTrue(wolfSSL_CTX_use_PrivateKey_file(ctx, svrKeyFile, SSL_FILETYPE_PEM)); #else AssertNotNull((ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()))); #endif @@ -6616,7 +6615,7 @@ static void test_wolfSSL_UseMaxFragment(void) #ifndef NO_WOLFSSL_SERVER WOLFSSL_CTX* ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()); AssertTrue(wolfSSL_CTX_use_certificate_file(ctx, svrCertFile, WOLFSSL_FILETYPE_PEM)); - AssertTrue(SSL_CTX_use_PrivateKey_file(ctx, svrKeyFile, WOLFSSL_FILETYPE_PEM)); + AssertTrue(wolfSSL_CTX_use_PrivateKey_file(ctx, svrKeyFile, WOLFSSL_FILETYPE_PEM)); #else WOLFSSL_CTX* ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()); #endif @@ -6689,7 +6688,7 @@ static void test_wolfSSL_UseTruncatedHMAC(void) #ifndef NO_WOLFSSL_SERVER WOLFSSL_CTX* ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()); AssertTrue(wolfSSL_CTX_use_certificate_file(ctx, svrCertFile, WOLFSSL_FILETYPE_PEM)); - AssertTrue(SSL_CTX_use_PrivateKey_file(ctx, svrKeyFile, WOLFSSL_FILETYPE_PEM)); + AssertTrue(wolfSSL_CTX_use_PrivateKey_file(ctx, svrKeyFile, WOLFSSL_FILETYPE_PEM)); #else WOLFSSL_CTX* ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()); #endif @@ -48762,9 +48761,9 @@ static void test_export_keying_material(void) static int test_wolfSSL_THREADID_hash(void) { int ret = 0; - CRYPTO_THREADID id; unsigned long res; #if defined(OPENSSL_EXTRA) + CRYPTO_THREADID id; printf(testingFmt, "wolfSSL_THREADID_hash"); CRYPTO_THREADID_current(NULL); AssertTrue(1); @@ -48775,7 +48774,6 @@ static int test_wolfSSL_THREADID_hash(void) AssertTrue( res == 0UL); printf(resultFmt, passed); #endif /* OPENSSL_EXTRA */ - (void)id; (void)res; return ret; } @@ -49650,10 +49648,6 @@ static void test_wolfSSL_ERR_strings(void) err = wolfSSL_ERR_func_error_string(UNSUPPORTED_SUITE); AssertTrue(err != NULL); AssertIntEQ((*err == '\0'), 1); - - err = wolfSSL_ERR_lib_error_string(PEM_R_PROBLEMS_GETTING_PASSWORD); - AssertTrue(err != NULL); - AssertIntEQ((*err == ('\0')), 1); #endif printf(resultFmt, passed); #endif diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 4de830f6a..e94a607f4 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -37,6 +37,9 @@ #include #include +/* For the types */ +#include + #ifdef HAVE_WOLF_EVENT #include #endif @@ -87,7 +90,6 @@ #endif #elif (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) - #include #include #include #include