diff --git a/SOURCES/openssl-fips-0.9.8e-cve-2014-0224.patch b/SOURCES/openssl-fips-0.9.8e-cve-2014-0224.patch new file mode 100644 index 0000000..ac2fd3b --- /dev/null +++ b/SOURCES/openssl-fips-0.9.8e-cve-2014-0224.patch @@ -0,0 +1,77 @@ +diff -up openssl-fips-0.9.8e/ssl/ssl3.h.keying-mitm openssl-fips-0.9.8e/ssl/ssl3.h +--- openssl-fips-0.9.8e/ssl/ssl3.h.keying-mitm 2014-06-02 15:49:35.036283939 +0200 ++++ openssl-fips-0.9.8e/ssl/ssl3.h 2014-06-02 17:00:09.808186361 +0200 +@@ -344,6 +344,7 @@ typedef struct ssl3_buffer_st + * effected, but we can't prevent that. + */ + #define SSL3_FLAGS_SGC_RESTART_DONE 0x0040 ++#define SSL3_FLAGS_CCS_OK 0x0080 + + typedef struct ssl3_state_st + { +diff -up openssl-fips-0.9.8e/ssl/s3_clnt.c.keying-mitm openssl-fips-0.9.8e/ssl/s3_clnt.c +--- openssl-fips-0.9.8e/ssl/s3_clnt.c.keying-mitm 2014-06-02 15:45:18.346349601 +0200 ++++ openssl-fips-0.9.8e/ssl/s3_clnt.c 2014-06-02 15:49:35.036283939 +0200 +@@ -425,6 +425,7 @@ int ssl3_connect(SSL *s) + case SSL3_ST_CR_FINISHED_A: + case SSL3_ST_CR_FINISHED_B: + ++ s->s3->flags |= SSL3_FLAGS_CCS_OK; + ret=ssl3_get_finished(s,SSL3_ST_CR_FINISHED_A, + SSL3_ST_CR_FINISHED_B); + if (ret <= 0) goto end; +@@ -706,6 +707,7 @@ int ssl3_get_server_hello(SSL *s) + SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); + goto f_err; + } ++ s->s3->flags |= SSL3_FLAGS_CCS_OK; + s->hit=1; + } + else /* a miss or crap from the other end */ +diff -up openssl-fips-0.9.8e/ssl/s3_pkt.c.keying-mitm openssl-fips-0.9.8e/ssl/s3_pkt.c +--- openssl-fips-0.9.8e/ssl/s3_pkt.c.keying-mitm 2014-06-02 15:45:18.375350271 +0200 ++++ openssl-fips-0.9.8e/ssl/s3_pkt.c 2014-06-02 15:49:35.037283962 +0200 +@@ -1133,6 +1133,15 @@ start: + goto f_err; + } + ++ if (!(s->s3->flags & SSL3_FLAGS_CCS_OK)) ++ { ++ al=SSL_AD_UNEXPECTED_MESSAGE; ++ SSLerr(SSL_F_SSL3_READ_BYTES,SSL_R_CCS_RECEIVED_EARLY); ++ goto f_err; ++ } ++ ++ s->s3->flags &= ~SSL3_FLAGS_CCS_OK; ++ + rr->length=0; + + if (s->msg_callback) +@@ -1264,7 +1273,7 @@ int ssl3_do_change_cipher_spec(SSL *s) + + if (s->s3->tmp.key_block == NULL) + { +- if (s->session == NULL) ++ if (s->session == NULL || s->session->master_key_length == 0) + { + /* might happen if dtls1_read_bytes() calls this */ + SSLerr(SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC,SSL_R_CCS_RECEIVED_EARLY); +diff -up openssl-fips-0.9.8e/ssl/s3_srvr.c.keying-mitm openssl-fips-0.9.8e/ssl/s3_srvr.c +--- openssl-fips-0.9.8e/ssl/s3_srvr.c.keying-mitm 2014-06-02 15:45:18.362349971 +0200 ++++ openssl-fips-0.9.8e/ssl/s3_srvr.c 2014-06-02 15:49:35.037283962 +0200 +@@ -492,6 +492,7 @@ int ssl3_accept(SSL *s) + case SSL3_ST_SR_CERT_VRFY_A: + case SSL3_ST_SR_CERT_VRFY_B: + ++ s->s3->flags |= SSL3_FLAGS_CCS_OK; + /* we should decide if we expected this one */ + ret=ssl3_get_cert_verify(s); + if (ret <= 0) goto end; +@@ -502,6 +503,7 @@ int ssl3_accept(SSL *s) + + case SSL3_ST_SR_FINISHED_A: + case SSL3_ST_SR_FINISHED_B: ++ s->s3->flags |= SSL3_FLAGS_CCS_OK; + ret=ssl3_get_finished(s,SSL3_ST_SR_FINISHED_A, + SSL3_ST_SR_FINISHED_B); + if (ret <= 0) goto end; diff --git a/SPECS/openssl098e.spec b/SPECS/openssl098e.spec index 033664e..589a6b1 100644 --- a/SPECS/openssl098e.spec +++ b/SPECS/openssl098e.spec @@ -18,7 +18,7 @@ Summary: A compatibility version of a general cryptography and TLS library Name: openssl098e Version: 0.9.8e -Release: 29%{?dist} +Release: 29%{?dist}.2 # The tarball is based on the openssl-fips-1.2.0-test.tar.gz tarball Source: openssl-fips-%{version}-usa.tar.bz2 Source1: hobble-openssl @@ -89,6 +89,7 @@ Patch104: openssl-fips-0.9.8e-cve-2012-2333.patch Patch105: openssl-fips-0.9.8e-secure-getenv.patch Patch106: openssl-fips-0.9.8e-cve-2013-0166.patch Patch107: openssl-fips-0.9.8e-cve-2013-0169.patch +Patch108: openssl-fips-0.9.8e-cve-2014-0224.patch License: OpenSSL Group: System Environment/Libraries @@ -173,6 +174,7 @@ with the previous Red Hat Enterprise Linux release. %patch105 -p1 -b .secure-getenv %patch106 -p1 -b .ocsp-dos %patch107 -p1 -b .lucky13 +%patch108 -p1 -b .keying-mitm # Modify the various perl scripts to reference perl in the right location. perl util/perlpath.pl `dirname %{__perl}` @@ -305,6 +307,9 @@ rm -rf $RPM_BUILD_ROOT/%{_bindir} %postun -p /sbin/ldconfig %changelog +* Tue Jun 3 2014 Tomas Mraz 0.9.8e-29.2 +- fix for CVE-2014-0224 - SSL/TLS MITM vulnerability + * Fri Jan 24 2014 Daniel Mach - 0.9.8e-29 - Mass rebuild 2014-01-24