summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-08-10 08:34:57 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-08-10 16:56:13 +0200
commit2622c1151a00dad5fcd37b84250eab8c37f39f9e (patch)
tree9f5f01b18ca12750499924a5d33c27b1897e5801
parentf310cda689c3068d6da7798192977ccedc6cc8a3 (diff)
downloadgnutls-2622c1151a00dad5fcd37b84250eab8c37f39f9e.tar.gz
Prohibit DSA-224 and DSA-256 from being used as signature algorithms with gcrypt
There are interoperability issues with them under gcrypt and this algorithm never got any serious deployment (in addition to not being specified to be used with TLS). Thus disable.
-rw-r--r--NEWS4
-rw-r--r--lib/gnutls_algorithms.c8
-rw-r--r--lib/gnutls_priority.c2
3 files changed, 14 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 48977cf52b..967f00038e 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,10 @@ Version 2.12.24 (unreleased)
This improves interoperability against broken servers which
assume that this version is supported by the client.
+** libgnutls: Prohibit DSA2 signatures when used with the libgcrypt
+ backend. There are interoperability issues, and these algorithms are
+ too rare to require a proper fix.
+
** libgnutls: Do not call the post client hello callback twice when resuming
using session tickets.
diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c
index 1285ebf5a7..739e5bb0c7 100644
--- a/lib/gnutls_algorithms.c
+++ b/lib/gnutls_algorithms.c
@@ -1941,10 +1941,16 @@ static const gnutls_sign_entry sign_algorithms[] = {
GNUTLS_MAC_RMD160, TLS_SIGN_AID_UNKNOWN},
{"DSA-SHA1", SIG_DSA_SHA1_OID, GNUTLS_SIGN_DSA_SHA1, GNUTLS_PK_DSA,
GNUTLS_MAC_SHA1, {2, 2}},
+/* DSA2 doesn't work with libgcrypt */
+#ifdef HAVE_LIBNETTLE
{"DSA-SHA224", SIG_DSA_SHA224_OID, GNUTLS_SIGN_DSA_SHA224, GNUTLS_PK_DSA,
GNUTLS_MAC_SHA224, {3, 2}},
{"DSA-SHA256", SIG_DSA_SHA256_OID, GNUTLS_SIGN_DSA_SHA256, GNUTLS_PK_DSA,
GNUTLS_MAC_SHA256, {4, 2}},
+#else
+ {"DSA-SHA224", SIG_DSA_SHA224_OID, 0, 0, 0, TLS_SIGN_AID_UNKNOWN},
+ {"DSA-SHA256", SIG_DSA_SHA256_OID, 0, 0, 0, TLS_SIGN_AID_UNKNOWN},
+#endif
{"RSA-MD5", SIG_RSA_MD5_OID, GNUTLS_SIGN_RSA_MD5, GNUTLS_PK_RSA,
GNUTLS_MAC_MD5, {1, 1}},
{"RSA-MD2", SIG_RSA_MD2_OID, GNUTLS_SIGN_RSA_MD2, GNUTLS_PK_RSA,
@@ -1964,8 +1970,10 @@ static const gnutls_sign_algorithm_t supported_sign[] = {
GNUTLS_SIGN_RSA_SHA512,
GNUTLS_SIGN_RSA_RMD160,
GNUTLS_SIGN_DSA_SHA1,
+#ifdef HAVE_LIBNETTLE
GNUTLS_SIGN_DSA_SHA224,
GNUTLS_SIGN_DSA_SHA256,
+#endif
GNUTLS_SIGN_RSA_MD5,
GNUTLS_SIGN_RSA_MD2,
0
diff --git a/lib/gnutls_priority.c b/lib/gnutls_priority.c
index 6b5bd2af3a..60333a9c8a 100644
--- a/lib/gnutls_priority.c
+++ b/lib/gnutls_priority.c
@@ -334,8 +334,10 @@ static const int comp_priority[] = {
};
static const int sign_priority_default[] = {
+#ifdef HAVE_LIBNETTLE
GNUTLS_SIGN_DSA_SHA224,
GNUTLS_SIGN_DSA_SHA256,
+#endif
GNUTLS_SIGN_RSA_SHA256,
GNUTLS_SIGN_RSA_SHA384,
GNUTLS_SIGN_RSA_SHA512,