diff --git a/src/ssl.c b/src/ssl.c index 4667f71b9..d1d718952 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1641,35 +1641,6 @@ int wolfSSL_get_ciphers(char* buf, int len) return WOLFSSL_SUCCESS; } -#ifdef WOLFSSL_GET_CIPHER_BYTES -int wolfSSL_get_cipher_list_bytes(byte* buf, int *len) -{ - const CipherSuiteInfo* ciphers = GetCipherNames(); - int ciphersSz = GetCipherNamesSize(); - int i; - - if (len == NULL) - return BAD_FUNC_ARG; - - /* For NULL input buffer and non-NULL len, set len */ - if (buf == NULL) { - *len = (ciphersSz * 2); - return WOLFSSL_SUCCESS; - } - - if (*len < (ciphersSz * 2)) - return BUFFER_E; - - /* Add each member to the buffer */ - for (i = 0; i < ciphersSz; i++) { - *buf++ = ciphers->cipherSuite0; - *buf++ = ciphers->cipherSuite; - } - - return WOLFSSL_SUCCESS; -} -#endif - #ifndef NO_ERROR_STRINGS /* places a list of all supported cipher suites in TLS_* format into "buf" * return WOLFSSL_SUCCESS on success */ diff --git a/tests/api.c b/tests/api.c index 1ee219d9b..700293ba6 100644 --- a/tests/api.c +++ b/tests/api.c @@ -1730,42 +1730,6 @@ static int test_wolfSSL_CTX_set_cipher_list_bytes(void) return EXPECT_RESULT(); } -static int test_wolfSSL_get_cipher_list_bytes(void) -{ - EXPECT_DECLS; -#if (defined(WOLFSSL_GET_CIPHER_BYTES)&& \ - (!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER))) - WOLFSSL_CTX* ctx = NULL; - byte *getCipherList = NULL; - word32 cipherListLen = 0; - -#ifndef NO_WOLFSSL_SERVER - ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method())); -#else - ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method())); -#endif - - ExpectTrue(wolfSSL_get_cipher_list_bytes(NULL, (int *)(&cipherListLen))); - ExpectIntGT((int)cipherListLen, 0); - ExpectNotNull(getCipherList = - (byte *)XMALLOC(cipherListLen, NULL, DYNAMIC_TYPE_TMP_BUFFER)); - ExpectTrue(wolfSSL_get_cipher_list_bytes( - getCipherList, (int *)(&cipherListLen))); - - /* Intentionally minimal verification here. Only way to verify would - * be a comprehensive list of all possible ciphersuites, which would - * break and need to be updated for every addition to the list. That - * is a lot of maintinence overhead for this little used function so - * call this good enough. */ - - XFREE(getCipherList, NULL, DYNAMIC_TYPE_TMP_BUFFER); - wolfSSL_CTX_free(ctx); -#endif /* (WOLFSSL_GET_CIPHER_BYTES && (!NO_WOLFSSL_CLIENT \ - * || !NO_WOLFSSL_SERVER) */ - - return EXPECT_RESULT(); -} - static int test_wolfSSL_CTX_use_certificate_file(void) { EXPECT_DECLS; @@ -83836,7 +83800,6 @@ TEST_CASE testCases[] = { TEST_DECL(test_SSL_CIPHER_get_xxx), TEST_DECL(test_wolfSSL_ERR_strings), TEST_DECL(test_wolfSSL_CTX_set_cipher_list_bytes), - TEST_DECL(test_wolfSSL_get_cipher_list_bytes), TEST_DECL(test_wolfSSL_CTX_use_certificate_file), TEST_DECL(test_wolfSSL_CTX_use_certificate_buffer), TEST_DECL(test_wolfSSL_CTX_use_PrivateKey_file), diff --git a/zephyr/user_settings.h b/zephyr/user_settings.h index b96e6c969..68266da5f 100644 --- a/zephyr/user_settings.h +++ b/zephyr/user_settings.h @@ -158,7 +158,6 @@ extern "C" { #if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS) #define WOLFSSL_SET_CIPHER_BYTES - #define WOLFSSL_GET_CIPHER_BYTES #endif /* ------------------------------------------------------------------------- */