Skip to content

Commit 56f343e

Browse files
committed
Allow RSA client certs on ECDHE-ECDSA mutual auth
The TLS 1.2 server derived the single advertised ClientCertificateType and the signature_algorithms list in its CertificateRequest from the negotiated cipher suite's own signature algorithm. On an ECDHE-ECDSA suite only ecdsa_sign was offered (and only ECDSA sig algs), so RSA clients could not authenticate even though the server could happily verify an RSA certificate. The same was true in reverse for an RSA server: the CertificateRequest only advertised rsa_sign. Refactor SendCertificateRequest to advertise certificate_types and signature_algorithms covering both sig families when both are compiled in. Three static helpers in internal.c keep the logic in one place without mutating ssl->suites: GetServerCertReqCertTypes - certificate_types to emit GetServerCertReqHashSigAlgo - signature_algorithms to emit InServerCertReqHashSigAlgo - membership check used for verification The advertised lists are written to stack buffers in the caller. To keep DoCertificateVerify in agreement with what we actually sent, the SupportedHashSigAlgo call site there is replaced with InServerCertReqHashSigAlgo, which rebuilds the same list locally and looks up the client's chosen algo. Replace the magic certTypes buffer size with a new MAX_CERT_REQ_CERT_TYPE_CNT constant declared next to ClientCertificateType. Add two end-to-end mutual-auth tests covering both directions: test_tls12_ecdhe_ecdsa_rsa_client_cert - ECDSA server, RSA client test_tls12_ecdhe_rsa_ecdsa_client_cert - RSA server, ECDSA client Update test_certreq_sighash_algos to permit RSA / RSA-PSS sig algs in the ECDHE-ECDSA CertificateRequest; the previous assertion locked in the ECDSA-only behaviour that this change corrects. TLS 1.3 is unaffected: RFC 8446 removed certificate_types from CertificateRequest, and TLS 1.3 cipher suites do not bind a signature algorithm, so the server's hashSigAlgo already covers both sig families when either has been compiled in.
1 parent 7467ce2 commit 56f343e

6 files changed

Lines changed: 281 additions & 71 deletions

File tree

src/internal.c

Lines changed: 144 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25818,6 +25818,129 @@ int SendCertificate(WOLFSSL* ssl)
2581825818

2581925819

2582025820
#if !defined(NO_TLS)
25821+
/* Returns the certificate_types this server advertises in its
25822+
* CertificateRequest. The list is broader than the negotiated cipher suite's
25823+
* own signature algorithm so a client may authenticate with a certificate of
25824+
* a different type (e.g. an RSA client on an ECDHE-ECDSA suite). */
25825+
static int GetServerCertReqCertTypes(const WOLFSSL* ssl, byte* certTypes)
25826+
{
25827+
int n = 0;
25828+
#ifdef HAVE_ECC
25829+
if ((ssl->options.cipherSuite0 == ECC_BYTE ||
25830+
ssl->options.cipherSuite0 == CHACHA_BYTE) &&
25831+
ssl->specs.sig_algo == ecc_dsa_sa_algo) {
25832+
certTypes[n++] = ecdsa_sign;
25833+
#ifndef NO_RSA
25834+
certTypes[n++] = rsa_sign;
25835+
#endif
25836+
}
25837+
else
25838+
#if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3) && \
25839+
(defined(WOLFSSL_SM4_CBC) || defined(WOLFSSL_SM4_GCM) || \
25840+
defined(WOLFSSL_SM4_CCM))
25841+
if (ssl->options.cipherSuite0 == SM_BYTE && (0
25842+
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_SM4_CBC_SM3
25843+
|| ssl->options.cipherSuite == TLS_ECDHE_ECDSA_WITH_SM4_CBC_SM3
25844+
#endif
25845+
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_SM4_GCM_SM3
25846+
|| ssl->options.cipherSuite == TLS_ECDHE_ECDSA_WITH_SM4_GCM_SM3
25847+
#endif
25848+
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_SM4_CCM_SM3
25849+
|| ssl->options.cipherSuite == TLS_ECDHE_ECDSA_WITH_SM4_CCM_SM3
25850+
#endif
25851+
)) {
25852+
certTypes[n++] = ecdsa_sign;
25853+
}
25854+
else
25855+
#endif
25856+
#endif /* HAVE_ECC */
25857+
{
25858+
#ifndef NO_RSA
25859+
certTypes[n++] = rsa_sign;
25860+
#endif
25861+
#ifdef HAVE_ECC
25862+
certTypes[n++] = ecdsa_sign;
25863+
#endif
25864+
}
25865+
return n;
25866+
}
25867+
25868+
/* Returns the set of sig families covered by the given hash/sig algorithm
25869+
* list, as a bitmask of SIG_* values. */
25870+
static int HashSigAlgoCoverage(const byte* hashSigAlgo, word16 hashSigAlgoSz)
25871+
{
25872+
int coverage = 0;
25873+
word16 j;
25874+
for (j = 0; (j + 1) < hashSigAlgoSz; j += HELLO_EXT_SIGALGO_SZ) {
25875+
byte first = hashSigAlgo[j];
25876+
byte second = hashSigAlgo[j + 1];
25877+
/* Most encodings are (mac, sig). RSA-PSS reverses the order so the
25878+
* first byte is the sig algorithm. */
25879+
if (first == rsa_pss_sa_algo || second == rsa_sa_algo)
25880+
coverage |= SIG_RSA;
25881+
else if (second == ecc_dsa_sa_algo)
25882+
coverage |= SIG_ECDSA;
25883+
}
25884+
return coverage;
25885+
}
25886+
25887+
/* Builds the signature_algorithms this server advertises in its
25888+
* CertificateRequest. Respects a user-configured suites->hashSigAlgo (e.g.
25889+
* via wolfSSL_set1_sigalgs_list) and only broadens the list when one of the
25890+
* advertised certificate_types has no matching signature algorithm in the
25891+
* configured list. The result is written to the caller's buffer; no SSL
25892+
* state is modified. */
25893+
static void GetServerCertReqHashSigAlgo(const WOLFSSL* ssl,
25894+
byte* hashSigAlgo, word16* hashSigAlgoSz)
25895+
{
25896+
const Suites* suites = WOLFSSL_SUITES(ssl);
25897+
byte certTypes[MAX_CERT_REQ_CERT_TYPE_CNT];
25898+
int typeTotal;
25899+
int need = 0;
25900+
int have;
25901+
int j;
25902+
word16 localSz = 0;
25903+
25904+
typeTotal = GetServerCertReqCertTypes(ssl, certTypes);
25905+
for (j = 0; j < typeTotal; j++) {
25906+
if (certTypes[j] == rsa_sign)
25907+
need |= SIG_RSA;
25908+
else if (certTypes[j] == ecdsa_sign)
25909+
need |= SIG_ECDSA;
25910+
}
25911+
have = HashSigAlgoCoverage(suites->hashSigAlgo, suites->hashSigAlgoSz);
25912+
25913+
if ((need & ~have) != 0) {
25914+
/* The configured list is missing signature algorithms for at least
25915+
* one of the advertised certificate_types. Build a broader list
25916+
* locally that covers every advertised type. */
25917+
InitSuitesHashSigAlgo(hashSigAlgo, need | have, 1, 0,
25918+
ssl->buffers.keySz, &localSz);
25919+
*hashSigAlgoSz = localSz;
25920+
return;
25921+
}
25922+
25923+
XMEMCPY(hashSigAlgo, suites->hashSigAlgo, suites->hashSigAlgoSz);
25924+
*hashSigAlgoSz = suites->hashSigAlgoSz;
25925+
}
25926+
25927+
/* Returns 1 if algo (2 bytes) is in the server's CertificateRequest
25928+
* signature_algorithms list, 0 otherwise. Used to validate the client's
25929+
* CertificateVerify against what we actually advertised. */
25930+
static int InServerCertReqHashSigAlgo(const WOLFSSL* ssl, const byte* algo)
25931+
{
25932+
byte list[WOLFSSL_MAX_SIGALGO];
25933+
word16 listSz = 0;
25934+
word16 j;
25935+
25936+
GetServerCertReqHashSigAlgo(ssl, list, &listSz);
25937+
for (j = 0; (j + 1) < listSz; j += HELLO_EXT_SIGALGO_SZ) {
25938+
if (XMEMCMP(&list[j], algo, HELLO_EXT_SIGALGO_SZ) == 0)
25939+
return 1;
25940+
}
25941+
return 0;
25942+
}
25943+
2582125944
/* handle generation of certificate_request (13) */
2582225945
int SendCertificateRequest(WOLFSSL* ssl)
2582325946
{
@@ -25829,16 +25952,24 @@ int SendCertificateRequest(WOLFSSL* ssl)
2582925952
#ifndef WOLFSSL_NO_CA_NAMES
2583025953
WOLF_STACK_OF(WOLFSSL_X509_NAME)* names;
2583125954
#endif
25832-
const Suites* suites = WOLFSSL_SUITES(ssl);
25833-
25834-
int typeTotal = 1; /* only 1 for now */
25835-
int reqSz = ENUM_LEN + typeTotal + REQ_HEADER_SZ; /* add auth later */
25955+
byte certTypes[MAX_CERT_REQ_CERT_TYPE_CNT];
25956+
int typeTotal;
25957+
int t;
25958+
byte localHashSigAlgo[WOLFSSL_MAX_SIGALGO];
25959+
word16 localHashSigAlgoSz = 0;
25960+
int reqSz;
2583625961

2583725962
WOLFSSL_START(WC_FUNC_CERTIFICATE_REQUEST_SEND);
2583825963
WOLFSSL_ENTER("SendCertificateRequest");
2583925964

25965+
typeTotal = GetServerCertReqCertTypes(ssl, certTypes);
25966+
if (IsAtLeastTLSv1_2(ssl))
25967+
GetServerCertReqHashSigAlgo(ssl, localHashSigAlgo, &localHashSigAlgoSz);
25968+
25969+
reqSz = ENUM_LEN + typeTotal + REQ_HEADER_SZ; /* add auth later */
25970+
2584025971
if (IsAtLeastTLSv1_2(ssl))
25841-
reqSz += LENGTH_SZ + suites->hashSigAlgoSz;
25972+
reqSz += LENGTH_SZ + localHashSigAlgoSz;
2584225973

2584325974
#ifndef WOLFSSL_NO_CA_NAMES
2584425975
/* Certificate Authorities */
@@ -25891,43 +26022,16 @@ int SendCertificateRequest(WOLFSSL* ssl)
2589126022

2589226023
/* write to output */
2589326024
output[i++] = (byte)typeTotal; /* # of types */
25894-
#ifdef HAVE_ECC
25895-
if ((ssl->options.cipherSuite0 == ECC_BYTE ||
25896-
ssl->options.cipherSuite0 == CHACHA_BYTE) &&
25897-
ssl->specs.sig_algo == ecc_dsa_sa_algo) {
25898-
output[i++] = ecdsa_sign;
25899-
}
25900-
else
25901-
#if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3) && \
25902-
(defined(WOLFSSL_SM4_CBC) || defined(WOLFSSL_SM4_GCM) || \
25903-
defined(WOLFSSL_SM4_CCM))
25904-
if (ssl->options.cipherSuite0 == SM_BYTE && (0
25905-
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_SM4_CBC_SM3
25906-
|| ssl->options.cipherSuite == TLS_ECDHE_ECDSA_WITH_SM4_CBC_SM3
25907-
#endif
25908-
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_SM4_GCM_SM3
25909-
|| ssl->options.cipherSuite == TLS_ECDHE_ECDSA_WITH_SM4_GCM_SM3
25910-
#endif
25911-
#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_SM4_CCM_SM3
25912-
|| ssl->options.cipherSuite == TLS_ECDHE_ECDSA_WITH_SM4_CCM_SM3
25913-
#endif
25914-
)) {
25915-
output[i++] = ecdsa_sign;
25916-
}
25917-
else
25918-
#endif
25919-
#endif /* HAVE_ECC */
25920-
{
25921-
output[i++] = rsa_sign;
25922-
}
26025+
for (t = 0; t < typeTotal; t++)
26026+
output[i++] = certTypes[t];
2592326027

2592426028
/* supported hash/sig */
2592526029
if (IsAtLeastTLSv1_2(ssl)) {
25926-
c16toa(suites->hashSigAlgoSz, &output[i]);
26030+
c16toa(localHashSigAlgoSz, &output[i]);
2592726031
i += OPAQUE16_LEN;
2592826032

25929-
XMEMCPY(&output[i], suites->hashSigAlgo, suites->hashSigAlgoSz);
25930-
i += suites->hashSigAlgoSz;
26033+
XMEMCPY(&output[i], localHashSigAlgo, localHashSigAlgoSz);
26034+
i += localHashSigAlgoSz;
2593126035
}
2593226036

2593326037
/* Certificate Authorities */
@@ -38949,9 +39053,9 @@ static int AddPSKtoPreMasterSecret(WOLFSSL* ssl)
3894939053
ERROR_OUT(BUFFER_ERROR, exit_dcv);
3895039054
}
3895139055

38952-
/* Check if hashSigAlgo in CertificateVerify is supported
38953-
* in our ssl->suites or ssl->ctx->suites. */
38954-
if (!SupportedHashSigAlgo(ssl, &input[args->idx])) {
39056+
/* Check the algorithm in CertificateVerify against the
39057+
* list we actually advertised in our CertificateRequest. */
39058+
if (!InServerCertReqHashSigAlgo(ssl, &input[args->idx])) {
3895539059
WOLFSSL_MSG("Signature algorithm was not in "
3895639060
"CertificateRequest");
3895739061
ERROR_OUT(INVALID_PARAMETER, exit_dcv);

tests/api.c

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35648,8 +35648,9 @@ static int test_dtls_seq_num_downgrade(void)
3564835648
}
3564935649

3565035650
/**
35651-
* Make sure we don't send RSA Signature Hash Algorithms in the
35652-
* CertificateRequest when we don't have any such ciphers set.
35651+
* Make sure the CertificateRequest advertises ECDSA signature hash algorithms
35652+
* for an ECDHE-ECDSA server, and also includes RSA algorithms so that RSA
35653+
* clients can authenticate (the certificate_type advertised covers both).
3565335654
* @return EXPECT_RESULT()
3565435655
*/
3565535656
static int test_certreq_sighash_algos(void)
@@ -35710,17 +35711,24 @@ static int test_certreq_sighash_algos(void)
3571035711
idx += OPAQUE16_LEN;
3571135712
maxIdx = idx + (int)len;
3571235713
for (; idx < maxIdx && EXPECT_SUCCESS(); idx += OPAQUE16_LEN) {
35713-
if (test_ctx.c_buff[idx+1] == ED25519_SA_MINOR ||
35714-
test_ctx.c_buff[idx+1] == ED448_SA_MINOR ||
35715-
test_ctx.c_buff[idx+1] ==
35716-
ECDSA_BRAINPOOLP256R1TLS13_SHA256_MINOR ||
35717-
test_ctx.c_buff[idx+1] ==
35718-
ECDSA_BRAINPOOLP384R1TLS13_SHA384_MINOR ||
35719-
test_ctx.c_buff[idx+1] ==
35720-
ECDSA_BRAINPOOLP512R1TLS13_SHA512_MINOR)
35721-
ExpectIntEQ(test_ctx.c_buff[idx], NEW_SA_MAJOR);
35722-
else
35723-
ExpectIntEQ(test_ctx.c_buff[idx+1], ecc_dsa_sa_algo);
35714+
byte first = test_ctx.c_buff[idx];
35715+
byte second = test_ctx.c_buff[idx+1];
35716+
if (second == ED25519_SA_MINOR ||
35717+
second == ED448_SA_MINOR ||
35718+
second == ECDSA_BRAINPOOLP256R1TLS13_SHA256_MINOR ||
35719+
second == ECDSA_BRAINPOOLP384R1TLS13_SHA384_MINOR ||
35720+
second == ECDSA_BRAINPOOLP512R1TLS13_SHA512_MINOR) {
35721+
ExpectIntEQ(first, NEW_SA_MAJOR);
35722+
}
35723+
else {
35724+
/* ECDHE-ECDSA suites advertise ECDSA so the negotiated
35725+
* cipher can be used, and also RSA / RSA-PSS so RSA
35726+
* clients can authenticate via mutual auth. Note that
35727+
* RSA-PSS is encoded with sigAlgo first then mac. */
35728+
ExpectTrue(second == ecc_dsa_sa_algo ||
35729+
second == rsa_sa_algo ||
35730+
first == rsa_pss_sa_algo);
35731+
}
3572435732
}
3572535733
break;
3572635734
}

tests/api/test_tls.c

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,3 +1219,111 @@ int test_wolfSSL_alert_desc_string(void)
12191219
#endif
12201220
return EXPECT_RESULT();
12211221
}
1222+
1223+
/* TLS 1.2 mutual auth: an ECDHE-ECDSA server (ECDSA certificate) accepting an
1224+
* RSA client certificate. */
1225+
int test_tls12_ecdhe_ecdsa_rsa_client_cert(void)
1226+
{
1227+
EXPECT_DECLS;
1228+
#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12) \
1229+
&& defined(HAVE_ECC) && !defined(NO_RSA) && !defined(NO_SHA256) \
1230+
&& defined(HAVE_AESGCM) && defined(KEEP_PEER_CERT) \
1231+
&& !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) \
1232+
&& !defined(NO_FILESYSTEM) && !defined(NO_CERTS)
1233+
WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
1234+
WOLFSSL *ssl_c = NULL, *ssl_s = NULL;
1235+
struct test_memio_ctx test_ctx;
1236+
WOLFSSL_X509* peer = NULL;
1237+
const char* cipher = "ECDHE-ECDSA-AES128-GCM-SHA256";
1238+
1239+
XMEMSET(&test_ctx, 0, sizeof(test_ctx));
1240+
ExpectIntEQ(test_memio_setup(&test_ctx, &ctx_c, &ctx_s, &ssl_c, &ssl_s,
1241+
wolfTLSv1_2_client_method, wolfTLSv1_2_server_method), 0);
1242+
1243+
/* Server: ECDSA certificate (=> ECDHE-ECDSA suite), require client
1244+
* authentication, and trust the (self-signed) RSA client certificate. */
1245+
ExpectIntEQ(wolfSSL_use_certificate_file(ssl_s, eccCertFile,
1246+
WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
1247+
ExpectIntEQ(wolfSSL_use_PrivateKey_file(ssl_s, eccKeyFile,
1248+
WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
1249+
ExpectIntEQ(wolfSSL_CTX_load_verify_locations(ctx_s, cliCertFile, NULL),
1250+
WOLFSSL_SUCCESS);
1251+
wolfSSL_set_verify(ssl_s, WOLFSSL_VERIFY_PEER |
1252+
WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL);
1253+
ExpectIntEQ(wolfSSL_set_cipher_list(ssl_s, cipher), WOLFSSL_SUCCESS);
1254+
1255+
/* Client: RSA certificate/key, and trust the ECC CA that signed the
1256+
* server's ECDSA certificate. */
1257+
ExpectIntEQ(wolfSSL_use_certificate_file(ssl_c, cliCertFile,
1258+
WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
1259+
ExpectIntEQ(wolfSSL_use_PrivateKey_file(ssl_c, cliKeyFile,
1260+
WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
1261+
ExpectIntEQ(wolfSSL_CTX_load_verify_locations(ctx_c, caEccCertFile, NULL),
1262+
WOLFSSL_SUCCESS);
1263+
ExpectIntEQ(wolfSSL_set_cipher_list(ssl_c, cipher), WOLFSSL_SUCCESS);
1264+
1265+
/* Mutual authentication completes and the server obtains the client's
1266+
* RSA certificate even though the negotiated suite is ECDHE-ECDSA. */
1267+
ExpectIntEQ(test_memio_do_handshake(ssl_c, ssl_s, 10, NULL), 0);
1268+
ExpectStrEQ(wolfSSL_get_cipher_name(ssl_c), cipher);
1269+
ExpectNotNull(peer = wolfSSL_get_peer_certificate(ssl_s));
1270+
wolfSSL_X509_free(peer);
1271+
1272+
wolfSSL_free(ssl_c);
1273+
wolfSSL_free(ssl_s);
1274+
wolfSSL_CTX_free(ctx_c);
1275+
wolfSSL_CTX_free(ctx_s);
1276+
#endif
1277+
return EXPECT_RESULT();
1278+
}
1279+
1280+
/* TLS 1.2 mutual auth: an ECDHE-RSA server (RSA certificate) accepting an
1281+
* ECDSA client certificate. */
1282+
int test_tls12_ecdhe_rsa_ecdsa_client_cert(void)
1283+
{
1284+
EXPECT_DECLS;
1285+
#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12) \
1286+
&& defined(HAVE_ECC) && !defined(NO_RSA) && !defined(NO_SHA256) \
1287+
&& defined(HAVE_AESGCM) && defined(KEEP_PEER_CERT) \
1288+
&& !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) \
1289+
&& !defined(NO_FILESYSTEM) && !defined(NO_CERTS)
1290+
WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
1291+
WOLFSSL *ssl_c = NULL, *ssl_s = NULL;
1292+
struct test_memio_ctx test_ctx;
1293+
WOLFSSL_X509* peer = NULL;
1294+
const char* cipher = "ECDHE-RSA-AES128-GCM-SHA256";
1295+
1296+
XMEMSET(&test_ctx, 0, sizeof(test_ctx));
1297+
ExpectIntEQ(test_memio_setup(&test_ctx, &ctx_c, &ctx_s, &ssl_c, &ssl_s,
1298+
wolfTLSv1_2_client_method, wolfTLSv1_2_server_method), 0);
1299+
1300+
/* Server: default RSA certificate (=> ECDHE-RSA), require client
1301+
* authentication, and trust the (self-signed) ECDSA client certificate. */
1302+
ExpectIntEQ(wolfSSL_CTX_load_verify_locations(ctx_s, cliEccCertFile, NULL),
1303+
WOLFSSL_SUCCESS);
1304+
wolfSSL_set_verify(ssl_s, WOLFSSL_VERIFY_PEER |
1305+
WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL);
1306+
ExpectIntEQ(wolfSSL_set_cipher_list(ssl_s, cipher), WOLFSSL_SUCCESS);
1307+
1308+
/* Client: ECDSA certificate/key. The default client CTX already trusts
1309+
* the RSA CA that signed the server's certificate. */
1310+
ExpectIntEQ(wolfSSL_use_certificate_file(ssl_c, cliEccCertFile,
1311+
WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
1312+
ExpectIntEQ(wolfSSL_use_PrivateKey_file(ssl_c, cliEccKeyFile,
1313+
WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
1314+
ExpectIntEQ(wolfSSL_set_cipher_list(ssl_c, cipher), WOLFSSL_SUCCESS);
1315+
1316+
/* Mutual authentication completes and the server obtains the client's
1317+
* ECDSA certificate even though the negotiated suite is ECDHE-RSA. */
1318+
ExpectIntEQ(test_memio_do_handshake(ssl_c, ssl_s, 10, NULL), 0);
1319+
ExpectStrEQ(wolfSSL_get_cipher_name(ssl_c), cipher);
1320+
ExpectNotNull(peer = wolfSSL_get_peer_certificate(ssl_s));
1321+
wolfSSL_X509_free(peer);
1322+
1323+
wolfSSL_free(ssl_c);
1324+
wolfSSL_free(ssl_s);
1325+
wolfSSL_CTX_free(ctx_c);
1326+
wolfSSL_CTX_free(ctx_s);
1327+
#endif
1328+
return EXPECT_RESULT();
1329+
}

tests/api/test_tls.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ int test_tls_set_session_min_downgrade(void);
3636
int test_tls_set_curves_list_ecc_fallback(void);
3737
int test_tls12_corrupted_finished(void);
3838
int test_tls12_peerauth_failsafe(void);
39+
int test_tls12_ecdhe_ecdsa_rsa_client_cert(void);
40+
int test_tls12_ecdhe_rsa_ecdsa_client_cert(void);
3941
int test_wolfSSL_alert_type_string(void);
4042
int test_wolfSSL_alert_desc_string(void);
4143

@@ -54,6 +56,8 @@ int test_wolfSSL_alert_desc_string(void);
5456
TEST_DECL_GROUP("tls", test_tls_set_curves_list_ecc_fallback), \
5557
TEST_DECL_GROUP("tls", test_tls12_corrupted_finished), \
5658
TEST_DECL_GROUP("tls", test_tls12_peerauth_failsafe), \
59+
TEST_DECL_GROUP("tls", test_tls12_ecdhe_ecdsa_rsa_client_cert), \
60+
TEST_DECL_GROUP("tls", test_tls12_ecdhe_rsa_ecdsa_client_cert), \
5761
TEST_DECL_GROUP("tls", test_wolfSSL_alert_type_string), \
5862
TEST_DECL_GROUP("tls", test_wolfSSL_alert_desc_string)
5963

0 commit comments

Comments
 (0)