Skip to content

Commit 4481f9b

Browse files
Add stub for wolfSSL_set_ecdh_auto.
1 parent c73e433 commit 4481f9b

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

src/ssl.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23192,6 +23192,17 @@ unsigned long wolfSSL_THREADID_hash(const WOLFSSL_CRYPTO_THREADID* id)
2319223192
(void)id;
2319323193
return 0UL;
2319423194
}
23195+
/* wolfSSL_set_ecdh_auto is provided as compatible API with
23196+
* SSL_set_ecdh_auto to enable auto ecdh curve selection functionality.
23197+
* Since this functionality is enabled by default in wolfSSL,
23198+
* this API exists as a stub.
23199+
*/
23200+
int wolfSSL_set_ecdh_auto(WOLFSSL* ssl, int onoff)
23201+
{
23202+
(void)ssl;
23203+
(void)onoff;
23204+
return WOLFSSL_SUCCESS;
23205+
}
2319523206
/* wolfSSL_CTX_set_ecdh_auto is provided as compatible API with
2319623207
* SSL_CTX_set_ecdh_auto to enable auto ecdh curve selection functionality.
2319723208
* Since this functionality is enabled by default in wolfSSL,

tests/api.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64442,6 +64442,19 @@ static int test_wolfSSL_THREADID_hash(void)
6444264442
#endif /* OPENSSL_EXTRA */
6444364443
return EXPECT_RESULT();
6444464444
}
64445+
static int test_wolfSSL_set_ecdh_auto(void)
64446+
{
64447+
EXPECT_DECLS;
64448+
#if defined(OPENSSL_EXTRA)
64449+
WOLFSSL* ssl = NULL;
64450+
64451+
ExpectIntEQ(SSL_set_ecdh_auto(NULL,0), 1);
64452+
ExpectIntEQ(SSL_set_ecdh_auto(NULL,1), 1);
64453+
ExpectIntEQ(SSL_set_ecdh_auto(ssl,0), 1);
64454+
ExpectIntEQ(SSL_set_ecdh_auto(ssl,1), 1);
64455+
#endif /* OPENSSL_EXTRA */
64456+
return EXPECT_RESULT();
64457+
}
6444564458
static int test_wolfSSL_CTX_set_ecdh_auto(void)
6444664459
{
6444764460
EXPECT_DECLS;
@@ -73030,6 +73043,7 @@ TEST_CASE testCases[] = {
7303073043
/* Can't memory test as server hangs. */
7303173044
TEST_DECL(test_wolfSSL_Tls13_Key_Logging_test),
7303273045
TEST_DECL(test_wolfSSL_Tls13_postauth),
73046+
TEST_DECL(test_wolfSSL_set_ecdh_auto),
7303373047
TEST_DECL(test_wolfSSL_CTX_set_ecdh_auto),
7303473048
TEST_DECL(test_wolfSSL_set_minmax_proto_version),
7303573049
TEST_DECL(test_wolfSSL_CTX_set_max_proto_version),

wolfssl/openssl/ssl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
210210
#define i2d_PKCS8PrivateKey_bio wolfSSL_PEM_write_bio_PKCS8PrivateKey
211211
#define PKCS8_PRIV_KEY_INFO_free wolfSSL_EVP_PKEY_free
212212
#define d2i_PKCS12_fp wolfSSL_d2i_PKCS12_fp
213+
#define SSL_set_ecdh_auto wolfSSL_set_ecdh_auto
213214
#define SSL_CTX_set_ecdh_auto wolfSSL_CTX_set_ecdh_auto
214215

215216
#define i2d_PUBKEY wolfSSL_i2d_PUBKEY

wolfssl/ssl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ WOLFSSL_API WOLFSSL_CTX* wolfSSL_CTX_new_ex(WOLFSSL_METHOD* method, void* heap);
11351135
WOLFSSL_ABI WOLFSSL_API WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD* method);
11361136
WOLFSSL_API int wolfSSL_CTX_up_ref(WOLFSSL_CTX* ctx);
11371137
#ifdef OPENSSL_EXTRA
1138+
WOLFSSL_API int wolfSSL_set_ecdh_auto(WOLFSSL* ssl, int onoff);
11381139
WOLFSSL_API int wolfSSL_CTX_set_ecdh_auto(WOLFSSL_CTX* ctx, int onoff);
11391140
WOLFSSL_API int wolfSSL_get_signature_nid(WOLFSSL* ssl, int* nid);
11401141
WOLFSSL_API int wolfSSL_get_signature_type_nid(const WOLFSSL* ssl, int* nid);

0 commit comments

Comments
 (0)