OLD | NEW |
(Empty) | |
| 1 diff -burN android-openssl.orig/openssl.config android-openssl-lhash2/openssl.co
nfig |
| 2 --- android-openssl.orig/openssl.config 2013-11-05 14:11:10.833326408 -0500 |
| 3 +++ android-openssl-lhash2/openssl.config 2013-11-05 14:38:31.187575574 -0
500 |
| 4 @@ -1015,6 +1015,7 @@ |
| 5 use_aead_for_aes_gcm.patch \ |
| 6 chacha20poly1305.patch \ |
| 7 neon_runtime.patch \ |
| 8 +paddingext.patch \ |
| 9 " |
| 10 |
| 11 OPENSSL_PATCHES_progs_SOURCES="\ |
| 12 diff -burN android-openssl-foo/patches/paddingext.patch android-openssl/patches/
paddingext.patch |
| 13 --- android-openssl-foo/patches/paddingext.patch 1969-12-31 19:00:00.0000
00000 -0500 |
| 14 +++ android-openssl/patches/paddingext.patch 2013-11-05 14:14:34.631283497 -0
500 |
| 15 @@ -0,0 +1,96 @@ |
| 16 +From 61a9671951205d66382556b2502993ffc9201f59 Mon Sep 17 00:00:00 2001 |
| 17 +From: Adam Langley <agl@chromium.org> |
| 18 +Date: Wed, 11 Dec 2013 16:25:17 -0500 |
| 19 +Subject: [PATCH 57/57] Add padding extension. |
| 20 + |
| 21 +This change adds a padding extension, when needed, in order to work |
| 22 +around bugs in F5 terminators. |
| 23 +--- |
| 24 + ssl/t1_lib.c | 20 ++++++++++++++++++++ |
| 25 + ssl/tls1.h | 4 ++++ |
| 26 + 2 files changed, 24 insertions(+) |
| 27 + |
| 28 +diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c |
| 29 +index 47673e7..94e9692 100644 |
| 30 +--- a/ssl/s23_clnt.c |
| 31 ++++ b/ssl/s23_clnt.c |
| 32 +@@ -466,7 +466,10 @@ static int ssl23_client_hello(SSL *s) |
| 33 + { |
| 34 + /* create Client Hello in SSL 3.0/TLS 1.0 format */ |
| 35 + |
| 36 +- /* do the record header (5 bytes) and handshake message
header (4 bytes) last */ |
| 37 ++ /* do the record header (5 bytes) and handshake message |
| 38 ++ * header (4 bytes) last. Note: the code to add the |
| 39 ++ * padding extension in t1_lib.c depends on the size of |
| 40 ++ * this prefix. */ |
| 41 + d = p = &(buf[9]); |
| 42 + |
| 43 + *(p++) = version_major; |
| 44 +diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c |
| 45 +index a657360..faa8d36 100644 |
| 46 +--- a/ssl/s3_clnt.c |
| 47 ++++ b/ssl/s3_clnt.c |
| 48 +@@ -752,7 +752,9 @@ int ssl3_client_hello(SSL *s) |
| 49 + if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0) |
| 50 + goto err; |
| 51 + |
| 52 +- /* Do the message type and length last */ |
| 53 ++ /* Do the message type and length last. |
| 54 ++ * Note: the code to add the padding extension in t1_lib.c |
| 55 ++ * depends on the size of this prefix. */ |
| 56 + d=p= &(buf[4]); |
| 57 + |
| 58 + /* version indicates the negotiated version: for example from |
| 59 +diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c |
| 60 +index 5578056..f9ad9d9 100644 |
| 61 +--- a/ssl/t1_lib.c |
| 62 ++++ b/ssl/t1_lib.c |
| 63 +@@ -695,6 +695,31 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned
char *p, unsigned cha |
| 64 + } |
| 65 + #endif |
| 66 + |
| 67 ++ /* Add padding to workaround bugs in F5 terminators. |
| 68 ++ * See https://tools.ietf.org/html/draft-agl-tls-padding-02 */ |
| 69 ++ { |
| 70 ++ int hlen = ret - (unsigned char *)s->init_buf->data; |
| 71 ++ /* The code in s23_clnt.c to build ClientHello messages includes the |
| 72 ++ * 5-byte record header in the buffer, while the code in s3_clnt.c does |
| 73 ++ * not. */ |
| 74 ++ if (s->state == SSL23_ST_CW_CLNT_HELLO_A) |
| 75 ++ hlen -= 5; |
| 76 ++ if (hlen > 0xff && hlen < 0x200) |
| 77 ++ { |
| 78 ++ hlen = 0x200 - hlen; |
| 79 ++ if (hlen >= 4) |
| 80 ++ hlen -= 4; |
| 81 ++ else |
| 82 ++ hlen = 0; |
| 83 ++ |
| 84 ++ s2n(TLSEXT_TYPE_padding, ret); |
| 85 ++ s2n(hlen, ret); |
| 86 ++ memset(ret, 0, hlen); |
| 87 ++ ret += hlen; |
| 88 ++ } |
| 89 ++ } |
| 90 ++ |
| 91 ++ |
| 92 + if ((extdatalen = ret-p-2)== 0) |
| 93 + return p; |
| 94 + |
| 95 +diff --git a/ssl/tls1.h b/ssl/tls1.h |
| 96 +index ecf5da7..df8f482 100644 |
| 97 +--- a/ssl/tls1.h |
| 98 ++++ b/ssl/tls1.h |
| 99 +@@ -255,6 +255,10 @@ extern "C" { |
| 100 + #define TLSEXT_TYPE_channel_id 30031 |
| 101 + #define TLSEXT_TYPE_channel_id_new 30032 |
| 102 + |
| 103 ++/* See https://tools.ietf.org/html/draft-agl-tls-padding-02 |
| 104 ++ * Number not yet IANA assigned. */ |
| 105 ++#define TLSEXT_TYPE_padding 35655 |
| 106 ++ |
| 107 + /* NameType value from RFC 3546 */ |
| 108 + #define TLSEXT_NAMETYPE_host_name 0 |
| 109 + /* status request value from RFC 3546 */ |
| 110 +-- |
| 111 +1.8.5.1 |
OLD | NEW |