aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-01-28 19:27:57 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-01-28 19:27:57 +0000
commit0e6a964ecd0b4f86e67a62db1cdc302fef690235 (patch)
tree4ed6cbc992ad9f185913e3be6edeaf8e21be839f
parent455fa3cfe01127ddb9e71d8779fffd007fe5f4cf (diff)
downloadupstream-0e6a964ecd0b4f86e67a62db1cdc302fef690235.tar.gz
upstream-0e6a964ecd0b4f86e67a62db1cdc302fef690235.tar.bz2
upstream-0e6a964ecd0b4f86e67a62db1cdc302fef690235.zip
openssl: add fixes for CVE-2009-1387 and CVE-2009-2409 (thx, puchu)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19369 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/openssl/patches/900-CVE-2009-1387.patch53
-rw-r--r--package/openssl/patches/900-CVE-2009-2409.patch59
2 files changed, 112 insertions, 0 deletions
diff --git a/package/openssl/patches/900-CVE-2009-1387.patch b/package/openssl/patches/900-CVE-2009-1387.patch
new file mode 100644
index 0000000000..7a2a47e9b5
--- /dev/null
+++ b/package/openssl/patches/900-CVE-2009-1387.patch
@@ -0,0 +1,53 @@
+http://bugs.gentoo.org/270305
+
+fix from upstream
+
+--- a/ssl/d1_both.c
++++ b/ssl/d1_both.c
+@@ -585,30 +585,31 @@ dtls1_process_out_of_seq_message(SSL *s,
+ }
+ }
+
+- frag = dtls1_hm_fragment_new(frag_len);
+- if ( frag == NULL)
+- goto err;
++ if (frag_len)
++ {
++ frag = dtls1_hm_fragment_new(frag_len);
++ if ( frag == NULL)
++ goto err;
+
+- memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr));
++ memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr));
+
+- if (frag_len)
+- {
+- /* read the body of the fragment (header has already been read */
++ /* read the body of the fragment (header has already been read) */
+ i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE,
+ frag->fragment,frag_len,0);
+ if (i<=0 || (unsigned long)i!=frag_len)
+ goto err;
+- }
+
+- pq_64bit_init(&seq64);
+- pq_64bit_assign_word(&seq64, msg_hdr->seq);
++ pq_64bit_init(&seq64);
++ pq_64bit_assign_word(&seq64, msg_hdr->seq);
+
+- item = pitem_new(seq64, frag);
+- pq_64bit_free(&seq64);
+- if ( item == NULL)
+- goto err;
++ item = pitem_new(seq64, frag);
++ pq_64bit_free(&seq64);
++ if ( item == NULL)
++ goto err;
++
++ pqueue_insert(s->d1->buffered_messages, item);
++ }
+
+- pqueue_insert(s->d1->buffered_messages, item);
+ return DTLS1_HM_FRAGMENT_RETRY;
+
+ err:
diff --git a/package/openssl/patches/900-CVE-2009-2409.patch b/package/openssl/patches/900-CVE-2009-2409.patch
new file mode 100644
index 0000000000..4800968aa5
--- /dev/null
+++ b/package/openssl/patches/900-CVE-2009-2409.patch
@@ -0,0 +1,59 @@
+http://bugs.gentoo.org/280591
+
+fix from upstream
+
+http://cvs.openssl.org/chngview?cn=18260
+
+--- a/crypto/evp/c_alld.c
++++ b/crypto/evp/c_alld.c
+@@ -64,9 +64,6 @@
+
+ void OpenSSL_add_all_digests(void)
+ {
+-#ifndef OPENSSL_NO_MD2
+- EVP_add_digest(EVP_md2());
+-#endif
+ #ifndef OPENSSL_NO_MD4
+ EVP_add_digest(EVP_md4());
+ #endif
+--- a/crypto/x509/x509_vfy.c
++++ b/crypto/x509/x509_vfy.c
+@@ -986,7 +986,11 @@ static int internal_verify(X509_STORE_CT
+ while (n >= 0)
+ {
+ ctx->error_depth=n;
+- if (!xs->valid)
++
++ /* Skip signature check for self signed certificates. It
++ * doesn't add any security and just wastes time.
++ */
++ if (!xs->valid && xs != xi)
+ {
+ if ((pkey=X509_get_pubkey(xi)) == NULL)
+ {
+@@ -996,13 +1000,6 @@ static int internal_verify(X509_STORE_CT
+ if (!ok) goto end;
+ }
+ else if (X509_verify(xs,pkey) <= 0)
+- /* XXX For the final trusted self-signed cert,
+- * this is a waste of time. That check should
+- * optional so that e.g. 'openssl x509' can be
+- * used to detect invalid self-signatures, but
+- * we don't verify again and again in SSL
+- * handshakes and the like once the cert has
+- * been declared trusted. */
+ {
+ ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE;
+ ctx->current_cert=xs;
+--- a/ssl/ssl_algs.c
++++ b/ssl/ssl_algs.c
+@@ -92,9 +92,6 @@ int SSL_library_init(void)
+ EVP_add_cipher(EVP_seed_cbc());
+ #endif
+
+-#ifndef OPENSSL_NO_MD2
+- EVP_add_digest(EVP_md2());
+-#endif
+ #ifndef OPENSSL_NO_MD5
+ EVP_add_digest(EVP_md5());
+ EVP_add_digest_alias(SN_md5,"ssl2-md5");