Skip to content

Commit 287323a

Browse files
authored
Merge pull request #6933 from kareem-wolfssl/zd16927
Add stub for wolfSSL_set_ecdh_auto.
2 parents 8ba96e6 + 4481f9b commit 287323a

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
@@ -64530,6 +64530,19 @@ static int test_wolfSSL_THREADID_hash(void)
6453064530
#endif /* OPENSSL_EXTRA */
6453164531
return EXPECT_RESULT();
6453264532
}
64533+
static int test_wolfSSL_set_ecdh_auto(void)
64534+
{
64535+
EXPECT_DECLS;
64536+
#if defined(OPENSSL_EXTRA)
64537+
WOLFSSL* ssl = NULL;
64538+
64539+
ExpectIntEQ(SSL_set_ecdh_auto(NULL,0), 1);
64540+
ExpectIntEQ(SSL_set_ecdh_auto(NULL,1), 1);
64541+
ExpectIntEQ(SSL_set_ecdh_auto(ssl,0), 1);
64542+
ExpectIntEQ(SSL_set_ecdh_auto(ssl,1), 1);
64543+
#endif /* OPENSSL_EXTRA */
64544+
return EXPECT_RESULT();
64545+
}
6453364546
static int test_wolfSSL_CTX_set_ecdh_auto(void)
6453464547
{
6453564548
EXPECT_DECLS;
@@ -73119,6 +73132,7 @@ TEST_CASE testCases[] = {
7311973132
/* Can't memory test as server hangs. */
7312073133
TEST_DECL(test_wolfSSL_Tls13_Key_Logging_test),
7312173134
TEST_DECL(test_wolfSSL_Tls13_postauth),
73135+
TEST_DECL(test_wolfSSL_set_ecdh_auto),
7312273136
TEST_DECL(test_wolfSSL_CTX_set_ecdh_auto),
7312373137
TEST_DECL(test_wolfSSL_set_minmax_proto_version),
7312473138
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)