mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-03-09 00:17:31 +00:00
core/openssl-cryptodev to 1.0.1e-7 (patch CVE-2014-0224 vulnerability)
This commit is contained in:
parent
1d9f88df65
commit
df2bd6e2d1
2 changed files with 120 additions and 4 deletions
111
core/openssl-cryptodev/CVE-2014-0224.patch
Normal file
111
core/openssl-cryptodev/CVE-2014-0224.patch
Normal file
|
@ -0,0 +1,111 @@
|
|||
commit a5852a6db4b36f91d6254b2d8757f125e6e8e5cb
|
||||
Author: Dr. Stephen Henson <steve@openssl.org>
|
||||
Date: Fri May 16 12:55:16 2014 +0100
|
||||
|
||||
Additional CVE-2014-0224 protection.
|
||||
|
||||
Return a fatal error if an attempt is made to use a zero length
|
||||
master secret.
|
||||
|
||||
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
|
||||
index 98c36e6..59011e3 100644
|
||||
--- a/ssl/s3_pkt.c
|
||||
+++ b/ssl/s3_pkt.c
|
||||
@@ -1459,7 +1459,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);
|
||||
|
||||
commit eaa71076511eab5e84ed36ddecbfc6cc20a48952
|
||||
Author: Dr. Stephen Henson <steve@openssl.org>
|
||||
Date: Fri May 16 12:49:48 2014 +0100
|
||||
|
||||
Fix for CVE-2014-0224
|
||||
|
||||
Only accept change cipher spec when it is expected instead of at any
|
||||
time. This prevents premature setting of session keys before the master
|
||||
secret is determined which an attacker could use as a MITM attack.
|
||||
|
||||
Thanks to KIKUCHI Masashi (Lepidum Co. Ltd.) for reporting this issue
|
||||
and providing the initial fix this patch is based on.
|
||||
|
||||
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
|
||||
index a6b3c01..d35376d 100644
|
||||
--- a/ssl/s3_clnt.c
|
||||
+++ b/ssl/s3_clnt.c
|
||||
@@ -559,6 +559,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;
|
||||
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
|
||||
index 6bc8bf9..98c36e6 100644
|
||||
--- a/ssl/s3_pkt.c
|
||||
+++ b/ssl/s3_pkt.c
|
||||
@@ -1316,6 +1316,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)
|
||||
diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
|
||||
index 4de9d19..29f8b14 100644
|
||||
--- a/ssl/s3_srvr.c
|
||||
+++ b/ssl/s3_srvr.c
|
||||
@@ -673,6 +673,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;
|
||||
@@ -700,6 +701,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;
|
||||
@@ -770,7 +772,10 @@ int ssl3_accept(SSL *s)
|
||||
s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A;
|
||||
#else
|
||||
if (s->s3->next_proto_neg_seen)
|
||||
+ {
|
||||
+ s->s3->flags |= SSL3_FLAGS_CCS_OK;
|
||||
s->s3->tmp.next_state=SSL3_ST_SR_NEXT_PROTO_A;
|
||||
+ }
|
||||
else
|
||||
s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A;
|
||||
#endif
|
||||
diff --git a/ssl/ssl3.h b/ssl/ssl3.h
|
||||
index cb8b249..4ac4199 100644
|
||||
--- a/ssl/ssl3.h
|
||||
+++ b/ssl/ssl3.h
|
||||
@@ -388,6 +388,7 @@ typedef struct ssl3_buffer_st
|
||||
#define TLS1_FLAGS_TLS_PADDING_BUG 0x0008
|
||||
#define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010
|
||||
#define TLS1_FLAGS_KEEP_HANDSHAKE 0x0020
|
||||
+#define SSL3_FLAGS_CCS_OK 0x0040
|
||||
|
||||
/* SSL3_FLAGS_SGC_RESTART_DONE is set when we
|
||||
* restart a handshake because of MS SGC and so prevents us
|
|
@ -17,7 +17,7 @@ _ver=1.0.1e
|
|||
# use a pacman compatible version scheme
|
||||
pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
|
||||
#pkgver=$_ver
|
||||
pkgrel=6
|
||||
pkgrel=7
|
||||
pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security'
|
||||
arch=('arm' 'armv7h')
|
||||
url='https://www.openssl.org'
|
||||
|
@ -37,16 +37,18 @@ source=("https://www.openssl.org/source/${_pkgname}-${_ver}.tar.gz"
|
|||
"http://download.gna.org/cryptodev-linux/cryptodev-linux-${_cryptover}.tar.gz"
|
||||
'openssl-1.0.1-Check-DTLS_BAD_VER-for-version-number.patch'
|
||||
'openssl-1.0.1-e_aes_cbc_hmac_sha1.c-fix-rare-bad-record-mac-on-AES.patch'
|
||||
'CVE-2014-0160.patch')
|
||||
'CVE-2014-0160.patch'
|
||||
'CVE-2014-0224.patch')
|
||||
|
||||
md5sums=('66bf6f10f060d561929de96f9dfe5b8c'
|
||||
'dc78d3d06baffc16217519242ce92478'
|
||||
'3bf51be3a1bbd262be46dc619f92aa90'
|
||||
'3bf51be3a1bbd262be46dc619f92aa90'
|
||||
'88d3bef4bbdc640b0412315d8d347bdf'
|
||||
'eade38998313c25fd7934719cdf8a2ea'
|
||||
'ae7848bb152b8834ceff30c8c480d422'
|
||||
'c5cc62a47cef72f4e5ad119a88e97ae4'
|
||||
'5fd0261f74e5358fe28b725cddd24bbf')
|
||||
'5fd0261f74e5358fe28b725cddd24bbf'
|
||||
'8c724df827d6036946dc5074aea9ae66')
|
||||
|
||||
prepare() {
|
||||
cd $srcdir/${_pkgname}-$_ver
|
||||
|
@ -69,6 +71,9 @@ prepare() {
|
|||
# Patch the heartbleed vulnerability
|
||||
patch -p1 -i $srcdir/CVE-2014-0160.patch
|
||||
|
||||
msg2 "Patch zero length master secret vulnerability"
|
||||
patch -p1 -i $srcdir/CVE-2014-0224.patch
|
||||
|
||||
# Replace eng_cryptodev.c with cryptodev version
|
||||
cp -u ${srcdir}/cryptodev-linux-${_cryptover}/extras/eng_cryptodev.c ${srcdir}/openssl-${_ver}/crypto/engine/
|
||||
|
||||
|
|
Loading…
Reference in a new issue