summaryrefslogtreecommitdiff
path: root/src/tests.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-03-06 15:42:40 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-03-06 15:44:09 +0100
commit5f404b02c113a53153a528af449ad13047b29015 (patch)
treee7fe57d08ade995020cc2b15b83858a9775b7412 /src/tests.c
parent6b03bb52b9dab87523945d3c9ef5c0dbf00dfd23 (diff)
downloadgnutls-5f404b02c113a53153a528af449ad13047b29015.tar.gz
gnutls-cli-debug: disable unsupported TLS protocols as soon
Diffstat (limited to 'src/tests.c')
-rw-r--r--src/tests.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/tests.c b/src/tests.c
index be7e654b17..2891c228ac 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -923,17 +923,8 @@ test_code_t test_tls_disable1(gnutls_session_t session)
ret = do_handshake(session);
if (ret == TEST_FAILED) {
- protocol_str[0] = 0;
/* disable TLS 1.1 */
- if (tls1_ok != 0) {
- strcat(protocol_str, "+VERS-TLS1.0");
- }
- if (ssl3_ok != 0) {
- if (protocol_str[0] != 0)
- strcat(protocol_str, ":+VERS-SSL3.0");
- else
- strcat(protocol_str, "+VERS-SSL3.0");
- }
+ snprintf(protocol_str, sizeof(protocol_str), "+VERS-TLS1.0:+VERS-SSL3.0");
}
return ret;
}
@@ -955,22 +946,7 @@ test_code_t test_tls_disable2(gnutls_session_t session)
ret = do_handshake(session);
if (ret == TEST_FAILED) {
/* disable TLS 1.2 */
- protocol_str[0] = 0;
- if (tls1_1_ok != 0) {
- strcat(protocol_str, "+VERS-TLS1.1");
- }
- if (tls1_ok != 0) {
- if (protocol_str[0] != 0)
- strcat(protocol_str, ":+VERS-TLS1.0");
- else
- strcat(protocol_str, "+VERS-TLS1.0");
- }
- if (ssl3_ok != 0) {
- if (protocol_str[0] != 0)
- strcat(protocol_str, ":+VERS-SSL3.0");
- else
- strcat(protocol_str, "+VERS-SSL3.0");
- }
+ snprintf(protocol_str, sizeof(protocol_str), "+VERS-TLS1.1:+VERS-TLS1.0:+VERS-SSL3.0");
}
return ret;
}