summaryrefslogtreecommitdiffstats
path: root/ssl/ssl3.h
diff options
context:
space:
mode:
authorBen Laurie <ben@links.org>2013-01-28 17:31:49 +0000
committerDr. Stephen Henson <steve@openssl.org>2013-02-05 16:50:32 +0000
commit35a65e814beb899fa1c69a7673a8956c6059dce7 (patch)
tree9c17f5efd8e81b7fee9a5d403a2371ad5f2e3af2 /ssl/ssl3.h
parent7ad132b1335807d0017e2546b3a869ca77f111c3 (diff)
Make CBC decoding constant time.
This patch makes the decoding of SSLv3 and TLS CBC records constant time. Without this, a timing side-channel can be used to build a padding oracle and mount Vaudenay's attack. This patch also disables the stitched AESNI+SHA mode pending a similar fix to that code. In order to be easy to backport, this change is implemented in ssl/, rather than as a generic AEAD mode. In the future this should be changed around so that HMAC isn't in ssl/, but crypto/ as FIPS expects. (cherry picked from commit e130841bccfc0bb9da254dc84e23bc6a1c78a64e) Conflicts: crypto/evp/c_allc.c ssl/ssl_algs.c ssl/ssl_locl.h ssl/t1_enc.c (cherry picked from commit 3622239826698a0e534dcf0473204c724bb9b4b4) Conflicts: ssl/d1_enc.c ssl/s3_enc.c ssl/s3_pkt.c ssl/ssl3.h ssl/ssl_algs.c ssl/t1_enc.c
Diffstat (limited to 'ssl/ssl3.h')
-rw-r--r--ssl/ssl3.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ssl/ssl3.h b/ssl/ssl3.h
index b9a85effa0..7709effe3e 100644
--- a/ssl/ssl3.h
+++ b/ssl/ssl3.h
@@ -304,6 +304,10 @@ typedef struct ssl3_record_st
/*r */ unsigned char *comp; /* only used with decompression - malloc()ed */
/*r */ unsigned long epoch; /* epoch number, needed by DTLS1 */
/*r */ PQ_64BIT seq_num; /* sequence number, needed by DTLS1 */
+/*rw*/ unsigned int orig_len; /* How many bytes were available before padding
+ was removed? This is used to implement the
+ MAC check in constant time for CBC records.
+ */
} SSL3_RECORD;
typedef struct ssl3_buffer_st