summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-18 11:34:46 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-18 11:56:30 +0200
commitb36e9735170a9c33e277cb794e1f90d04262b3e6 (patch)
treea0dcae71b0ecce1e63aacb26c2e0f567383eaee6 /src
parent6f62adb1ce12262111a9fdcb2a75040d5c23c3cb (diff)
downloadgnutls-b36e9735170a9c33e277cb794e1f90d04262b3e6.tar.gz
gnutls-cli-debug: check whether RFC7919 is supported
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/cli-debug.c3
-rw-r--r--src/tests.c22
-rw-r--r--src/tests.h1
3 files changed, 26 insertions, 0 deletions
diff --git a/src/cli-debug.c b/src/cli-debug.c
index 2b0f88e2e3..899edd4938 100644
--- a/src/cli-debug.c
+++ b/src/cli-debug.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2017 Red Hat, Inc.
*
* This file is part of GnuTLS.
*
@@ -142,6 +143,8 @@ static const TLS_TEST tls_tests[] = {
#endif
{"for ephemeral Diffie-Hellman support", test_dhe, "yes", "no",
"dunno"},
+ {"for RFC7919 Diffie-Hellman support", test_rfc7919, "yes", "no",
+ "dunno"},
{"ephemeral Diffie-Hellman group info", test_dhe_group, NULL, "N/A",
"N/A"},
{"for ephemeral EC Diffie-Hellman support", test_ecdhe, "yes",
diff --git a/src/tests.c b/src/tests.c
index be5150d2c6..92c1bd20c4 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -202,6 +202,28 @@ test_code_t test_dhe(gnutls_session_t session)
return TEST_IGNORE;
}
+test_code_t test_rfc7919(gnutls_session_t session)
+{
+#ifdef ENABLE_DHE
+ int ret;
+
+ sprintf(prio_str, INIT_STR
+ ALL_CIPHERS ":" ALL_COMP ":" ALL_CERTTYPES ":%s:" ALL_MACS
+ ":+DHE-RSA:+DHE-DSS:+GROUP-ALL:%s", protocol_str, rest);
+ _gnutls_priority_set_direct(session, prio_str);
+
+ gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
+
+ ret = do_handshake(session);
+
+ if (ret != TEST_FAILED && (gnutls_session_get_flags(session) & GNUTLS_SFLAGS_RFC7919))
+ return TEST_SUCCEED;
+ else
+ return TEST_FAILED;
+#endif
+ return TEST_IGNORE;
+}
+
test_code_t test_ecdhe(gnutls_session_t session)
{
int ret;
diff --git a/src/tests.h b/src/tests.h
index 7f938b86de..78fd842ddb 100644
--- a/src/tests.h
+++ b/src/tests.h
@@ -30,6 +30,7 @@ test_code_t test_heartbeat_extension(gnutls_session_t state);
test_code_t test_small_records(gnutls_session_t state);
test_code_t test_rfc7507(gnutls_session_t state);
test_code_t test_dhe(gnutls_session_t state);
+test_code_t test_rfc7919(gnutls_session_t state);
test_code_t test_dhe_group(gnutls_session_t state);
test_code_t test_ssl3(gnutls_session_t state);
test_code_t test_aes(gnutls_session_t state);