summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2019-07-01 22:08:51 +0000
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2019-07-01 22:08:51 +0000
commit594572ab8055146e6d5941b580044bb0a6dbc87c (patch)
treea4937c060a20b88488a7850f63018ed8c5b12569
parent96a6ee60395242b015d712ca4a5e9e3501105297 (diff)
parentfd872101dac48fd8451ae8f6c6e21d9ac29a449f (diff)
downloadgnutls-594572ab8055146e6d5941b580044bb0a6dbc87c.tar.gz
Merge branch 'tmp-cli-debug' into 'master'
gnutls-cli-debug: test whether RSA key exchange is supported Closes #449 See merge request gnutls/gnutls!1039
-rw-r--r--src/cli-debug.c3
-rw-r--r--src/tests.c23
-rw-r--r--src/tests.h1
-rwxr-xr-xtests/gnutls-cli-debug.sh7
4 files changed, 32 insertions, 2 deletions
diff --git a/src/cli-debug.c b/src/cli-debug.c
index c1333b1935..cd06d08ae0 100644
--- a/src/cli-debug.c
+++ b/src/cli-debug.c
@@ -149,6 +149,9 @@ static const TLS_TEST tls_tests[] = {
{"anonymous Diffie-Hellman group info", test_dhe_group, NULL, "N/A",
"N/A"},
#endif
+ {"for RSA key exchange support", test_rsa, "yes",
+ "no",
+ "dunno"},
{"for ephemeral Diffie-Hellman support", test_dhe, "yes", "no",
"dunno"},
{"for RFC7919 Diffie-Hellman support", test_rfc7919, "yes", "no",
diff --git a/src/tests.c b/src/tests.c
index 115f3ae82b..20438f4d6e 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -249,6 +249,29 @@ test_code_t test_ecdhe(gnutls_session_t session)
return ret;
}
+test_code_t test_rsa(gnutls_session_t session)
+{
+ int ret;
+
+ if (tls_ext_ok == 0)
+ return TEST_IGNORE;
+
+ sprintf(prio_str, INIT_STR
+ ALL_CIPHERS ":" ALL_COMP ":%s:" ALL_MACS
+ ":+RSA:%s", protocol_all_str,
+ rest);
+ _gnutls_priority_set_direct(session, prio_str);
+
+ gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
+
+ ret = test_do_handshake(session);
+
+ if (ret < 0)
+ return TEST_FAILED;
+
+ return ret;
+}
+
static
test_code_t test_ecdhe_curve(gnutls_session_t session, const char *curve, unsigned id)
{
diff --git a/src/tests.h b/src/tests.h
index 0e6ad1824a..c391d97bfb 100644
--- a/src/tests.h
+++ b/src/tests.h
@@ -75,6 +75,7 @@ test_code_t test_send_record_with_allow_small_records(gnutls_session_t session);
int _test_srp_username_callback(gnutls_session_t session,
char **username, char **password);
+test_code_t test_rsa(gnutls_session_t session);
test_code_t test_ecdhe_x25519(gnutls_session_t session);
test_code_t test_ecdhe_secp521r1(gnutls_session_t session);
test_code_t test_ecdhe_secp384r1(gnutls_session_t session);
diff --git a/tests/gnutls-cli-debug.sh b/tests/gnutls-cli-debug.sh
index 507a9c2088..1f047e870c 100755
--- a/tests/gnutls-cli-debug.sh
+++ b/tests/gnutls-cli-debug.sh
@@ -92,6 +92,7 @@ check_text "for safe renegotiation (RFC5746) support... yes"
check_text "for encrypt-then-MAC (RFC7366) support... yes"
check_text "for ext master secret (RFC7627) support... yes"
check_text "for RFC7919 Diffie-Hellman support... yes"
+check_text "for RSA key exchange support... yes"
check_text "for curve SECP256r1 (RFC4492)... yes"
check_text "for AES-GCM cipher (RFC5288) support... yes"
check_text "for SHA1 MAC support... yes"
@@ -132,6 +133,7 @@ check_text "for ext master secret (RFC7627) support... yes"
check_text "for RFC7919 Diffie-Hellman support... yes"
check_text "for curve SECP256r1 (RFC4492)... yes"
check_text "for AES-GCM cipher (RFC5288) support... yes"
+check_text "for RSA key exchange support... yes"
check_text "for SHA1 MAC support... yes"
check_text "whether the server accepts default record size (512 bytes)... yes"
check_text "whether %ALLOW_SMALL_RECORDS is required... no"
@@ -147,10 +149,10 @@ rm -f ${OUTFILE}
# Small records test
echo ""
-echo "Checking output of gnutls-cli-debug for small records"
+echo "Checking output of gnutls-cli-debug for small records and no RSA"
eval "${GETPORT}"
-launch_server $$ --echo --priority "NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:%ALLOW_SMALL_RECORDS" --x509keyfile ${KEY1} --x509certfile ${CERT1} \
+launch_server $$ --echo --priority "NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:-RSA:%ALLOW_SMALL_RECORDS" --x509keyfile ${KEY1} --x509certfile ${CERT1} \
--x509keyfile ${KEY2} --x509certfile ${CERT2} --x509keyfile ${KEY3} --x509certfile ${CERT3} --recordsize=64 >/dev/null 2>&1
PID=$!
wait_server ${PID}
@@ -163,6 +165,7 @@ wait
check_text "whether the server accepts default record size (512 bytes)... no"
check_text "whether %ALLOW_SMALL_RECORDS is required... yes"
+check_text "for RSA key exchange support... no"
rm -f ${OUTFILE}