summaryrefslogtreecommitdiff
path: root/patches/source/gnutls/gnutls-2.10.5_CVE-2014-0092.diff
diff options
context:
space:
mode:
Diffstat (limited to 'patches/source/gnutls/gnutls-2.10.5_CVE-2014-0092.diff')
-rw-r--r--patches/source/gnutls/gnutls-2.10.5_CVE-2014-0092.diff108
1 files changed, 108 insertions, 0 deletions
diff --git a/patches/source/gnutls/gnutls-2.10.5_CVE-2014-0092.diff b/patches/source/gnutls/gnutls-2.10.5_CVE-2014-0092.diff
new file mode 100644
index 00000000..48fe7baa
--- /dev/null
+++ b/patches/source/gnutls/gnutls-2.10.5_CVE-2014-0092.diff
@@ -0,0 +1,108 @@
+From 4a09cbbeae43f8c78929838df38edf353f2f9bdc Mon Sep 17 00:00:00 2001
+From: mancha <mancha1@hush.com>
+Date: Mon, 03 Mar 2014
+Subject: CVE-2014-0092 (GNUTLS-SA-2014-2)
+
+Fix vulnerabilities in the certificate verification code path.
+The vulnerabilities can be exploited such that specially-crafted
+certificates can bypass certificate validation checks.
+
+This is a backport adaptation for use with GnuTLS 2.10.5.
+
+Relevant upstream commit:
+-------------------------
+https://gitorious.org/gnutls/gnutls/commit/6aa26f78150ccb
+
+---
+ lib/x509/verify.c | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+--- a/lib/x509/verify.c
++++ b/lib/x509/verify.c
+@@ -116,7 +116,7 @@ check_if_ca (gnutls_x509_crt_t cert, gnu
+ if (result < 0)
+ {
+ gnutls_assert ();
+- goto cleanup;
++ goto fail;
+ }
+
+ result =
+@@ -125,7 +125,7 @@ check_if_ca (gnutls_x509_crt_t cert, gnu
+ if (result < 0)
+ {
+ gnutls_assert ();
+- goto cleanup;
++ goto fail;
+ }
+
+ result =
+@@ -133,7 +133,7 @@ check_if_ca (gnutls_x509_crt_t cert, gnu
+ if (result < 0)
+ {
+ gnutls_assert ();
+- goto cleanup;
++ goto fail;
+ }
+
+ result =
+@@ -141,7 +141,7 @@ check_if_ca (gnutls_x509_crt_t cert, gnu
+ if (result < 0)
+ {
+ gnutls_assert ();
+- goto cleanup;
++ goto fail;
+ }
+
+ /* If the subject certificate is the same as the issuer
+@@ -181,6 +181,7 @@ check_if_ca (gnutls_x509_crt_t cert, gnu
+ else
+ gnutls_assert ();
+
++fail:
+ result = 0;
+
+ cleanup:
+@@ -274,7 +275,7 @@ _gnutls_verify_certificate2 (gnutls_x509
+ gnutls_datum_t cert_signed_data = { NULL, 0 };
+ gnutls_datum_t cert_signature = { NULL, 0 };
+ gnutls_x509_crt_t issuer = NULL;
+- int ret, issuer_version, result;
++ int ret, issuer_version, result = 0;
+
+ if (output)
+ *output = 0;
+@@ -307,7 +308,7 @@ _gnutls_verify_certificate2 (gnutls_x509
+ if (issuer_version < 0)
+ {
+ gnutls_assert ();
+- return issuer_version;
++ return 0;
+ }
+
+ if (!(flags & GNUTLS_VERIFY_DISABLE_CA_SIGN) &&
+@@ -328,6 +329,7 @@ _gnutls_verify_certificate2 (gnutls_x509
+ if (result < 0)
+ {
+ gnutls_assert ();
++ result = 0;
+ goto cleanup;
+ }
+
+@@ -336,6 +338,7 @@ _gnutls_verify_certificate2 (gnutls_x509
+ if (result < 0)
+ {
+ gnutls_assert ();
++ result = 0;
+ goto cleanup;
+ }
+
+@@ -345,6 +348,8 @@ _gnutls_verify_certificate2 (gnutls_x509
+ if (ret < 0)
+ {
+ gnutls_assert ();
++ result = 0;
++ goto cleanup;
+ }
+ else if (ret == 0)
+ {