Commit graph

1022 commits

Author SHA1 Message Date
mancha
a375025e4d Fix alert handling.
Fix OpenSSL 0.9.8 alert handling.

PR#3038
2014-03-27 00:54:16 +00:00
Dr. Stephen Henson
0da40f0ffc Restore SSL_OP_MSIE_SSLV2_RSA_PADDING
The flag SSL_OP_MSIE_SSLV2_RSA_PADDING hasn't done anything since OpenSSL
0.9.7h but deleting it will break source compatibility with any software
that references it. Restore it but #define to zero.
(cherry picked from commit b17d6b8d1d)
2014-01-04 14:01:25 +00:00
Rob Stradling
5ac9786807 Fix compilation with this branch's definition of SSL_CIPHER. 2013-10-04 14:55:01 +01:00
Rob Stradling
0b05204c4e Remove empty line. 2013-10-04 14:55:01 +01:00
Rob Stradling
a4bfeff254 Tidy up comments. 2013-10-04 14:55:01 +01:00
Rob Stradling
43433b3852 Use TLS version supplied by client when fingerprinting Safari. 2013-10-04 14:55:01 +01:00
Rob Stradling
020a4782bd Backport TLS 1.1/1.2 #defines 2013-10-04 14:55:01 +01:00
Rob Stradling
cadbbd51c8 Don't prefer ECDHE-ECDSA ciphers when the client appears to be Safari on OS X.
OS X 10.8..10.8.3 has broken support for ECDHE-ECDSA ciphers.
2013-10-04 14:55:01 +01:00
Michael Tuexen
9204e7ef0d DTLS message_sequence number wrong in rehandshake ServerHello
This fix ensures that
* A HelloRequest is retransmitted if not responded by a ClientHello
* The HelloRequest "consumes" the sequence number 0. The subsequent
ServerHello uses the sequence number 1.
* The client also expects the sequence number of the ServerHello to
be 1 if a HelloRequest was received earlier.
This patch fixes the RFC violation.

Conflicts:

	ssl/d1_pkt.c
(cherry picked from commit 6f87807e62)
2013-08-13 19:00:59 +01:00
Michael Tuexen
257df40f00 DTLS handshake fix.
Reported by: Prashant Jaikumar <rmstar@gmail.com>

Fix handling of application data received before a handshake.
(cherry picked from commit 0c75eeacd3)
2013-08-08 13:33:20 +01:00
Dr. Stephen Henson
a44c9b9c33 Set s->d1 to NULL after freeing it.
(cherry picked from commit 04638f2fc3)
2013-04-08 18:40:39 +01:00
Dr. Stephen Henson
e1e39a2451 Disable compression for DTLS.
The only standard compression method is stateful and is incompatible with
DTLS.
(cherry picked from commit e14b8410ca)
2013-03-19 13:48:02 +00:00
Michael Tuexen
05689a132c Avoid unnecessary fragmentation.
(cherry picked from commit 80ccc66d7e)
2013-03-18 14:33:27 +00:00
Geoff Lowe
a93cc7c573 Use orig_len, not rec->orig_len 2013-02-26 17:12:13 +00:00
David Woodhouse
a8655eb21a Check DTLS_BAD_VER for version number.
Need to check DTLS_BAD_VER as well as DTLS1_VERSION.
PR:2984
(cherry picked from commit 6a14feb048)
2013-02-12 15:12:52 +00:00
Dr. Stephen Henson
f751dc4759 Fix for SSL_get_certificate
Now we set the current certificate to the one used by a server
there is no need to call ssl_get_server_send_cert which will
fail if we haven't sent a certificate yet.
(cherry picked from commit 147dbb2fe3)
2013-02-11 18:27:41 +00:00
Dr. Stephen Henson
fbe621d08f Fix in ssltest is no-ssl2 configured
(cherry picked from commit cbf9b4aed3)
2013-02-11 18:27:33 +00:00
Andy Polyakov
db731da802 ssl/s3_[clnt|srvr].c: fix warning and linking error.
PR: 2979
2013-02-09 19:38:47 +01:00
Andy Polyakov
5864fd2061 s3_cbc.c: make CBC_MAC_ROTATE_IN_PLACE universal.
(cherry picked from commit f93a41877d)
2013-02-08 21:38:06 +01:00
Andy Polyakov
ff58eaa4b6 s3_cbc.c: get rid of expensive divisions [from master].
(cherry picked from commit e9baceab5a)
2013-02-08 17:01:55 +01:00
Andy Polyakov
76c61a5d1a ssl/s3_enc.c: remove artefact. 2013-02-08 12:03:16 +01:00
Andy Polyakov
4ea7019165 ssl/[d1|s3]_pkt.c: harmomize orig_len handling.
(cherry picked from commit 8545f73b89)
2013-02-08 11:51:09 +01:00
Dr. Stephen Henson
59b1129e0a Fix IV check and padding removal.
Fix the calculation that checks there is enough room in a record
after removing padding and optional explicit IV. (by Steve)

For AEAD remove the correct number of padding bytes (by Andy)
(cherry picked from commit be125aa5ba)
2013-02-08 11:49:41 +01:00
Andy Polyakov
fb092ef4fc ssl/*: remove SSL3_RECORD->orig_len to restore binary compatibility.
Kludge alert. This is arranged by passing padding length in unused
bits of SSL3_RECORD->type, so that orig_len can be reconstructed.
(cherry picked from commit 413cbfe68d)
2013-02-07 15:03:00 +00:00
Adam Langley
6351adecb4 Fix for EXP-RC2-CBC-MD5
MD5 should use little endian order. Fortunately the only ciphersuite
affected is EXP-RC2-CBC-MD5 (TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5) which
is a rarely used export grade ciphersuite.
(cherry picked from commit ee463921ed)
2013-02-06 16:12:49 +00:00
Dr. Stephen Henson
430b637bd5 make update 2013-02-05 16:50:36 +00:00
Dr. Stephen Henson
ca3b81c858 Fix error codes.
(cherry picked from commit 35d732fc2e)
2013-02-05 16:50:36 +00:00
Andy Polyakov
40e0de0395 s3/s3_cbc.c: allow for compilations with NO_SHA256|512.
(cherry picked from commit d5371324d9)
2013-02-05 16:50:35 +00:00
Andy Polyakov
5f9345a2f0 ssl/s3_cbc.c: md_state alignment portability fix.
RISCs are picky and alignment granted by compiler for md_state can be
insufficient for SHA512.
(cherry picked from commit 36260233e7)
2013-02-05 16:50:35 +00:00
Andy Polyakov
33ccde59a1 ssl/s3_cbc.c: uint64_t portability fix.
Break dependency on uint64_t. It's possible to declare bits as
unsigned int, because TLS packets are limited in size and 32-bit
value can't overflow.
(cherry picked from commit cab13fc847)
2013-02-05 16:50:35 +00:00
Dr. Stephen Henson
1909df070f Don't access EVP_MD internals directly. 2013-02-05 16:50:35 +00:00
Dr. Stephen Henson
924b117422 Timing fix mitigation for FIPS mode.
We have to use EVP in FIPS mode so we can only partially mitigate
timing differences.

Make an extra call to HMAC_Update to hash additonal blocks
to cover any timing differences caused by removal of padding.
2013-02-05 16:50:34 +00:00
Dr. Stephen Henson
99f5093347 The cbc functions shouldn't be inside #ifdef OPENSSL_NO_TLSEXT 2013-02-05 16:50:34 +00:00
Ben Laurie
be88529753 Update DTLS code to match CBC decoding in TLS.
This change updates the DTLS code to match the constant-time CBC
behaviour in the TLS.
(cherry picked from commit 9f27de170d)
(cherry picked from commit 5e4ca556e970edb8a7f364fcb6ee6818a965a60b)

Conflicts:
	ssl/d1_enc.c
	ssl/d1_pkt.c
	ssl/s3_pkt.c
2013-02-05 16:50:33 +00:00
Ben Laurie
b3a959a337 Don't crash when processing a zero-length, TLS >= 1.1 record.
The previous CBC patch was bugged in that there was a path through enc()
in s3_pkt.c/d1_pkt.c which didn't set orig_len. orig_len would be left
at the previous value which could suggest that the packet was a
sufficient length when it wasn't.
(cherry picked from commit 6cb19b7681)
(cherry picked from commit 2c948c1bb218f4ae126e14fd3453d42c62b93235)

Conflicts:
	ssl/s3_enc.c
2013-02-05 16:50:33 +00:00
Ben Laurie
2928cb4c82 Fixups. 2013-02-05 16:50:33 +00:00
Ben Laurie
a33e6702a0 Oops. Add missing file.
(cherry picked from commit 014265eb02)
(cherry picked from commit 7721c53e5e9fe4c90be420d7613559935a96a4fb)
2013-02-05 16:50:33 +00:00
Ben Laurie
35a65e814b 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 e130841bcc)

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
2013-02-05 16:50:32 +00:00
Ben Laurie
2708813166 Add and use a constant-time memcmp.
This change adds CRYPTO_memcmp, which compares two vectors of bytes in
an amount of time that's independent of their contents. It also changes
several MAC compares in the code to use this over the standard memcmp,
which may leak information about the size of a matching prefix.
(cherry picked from commit 2ee798880a)

Conflicts:
	crypto/crypto.h
	ssl/t1_lib.c
(cherry picked from commit dc406b59f3169fe191e58906df08dce97edb727c)

Conflicts:
	crypto/crypto.h
	ssl/d1_pkt.c
	ssl/s3_pkt.c
2013-02-05 16:50:32 +00:00
Dr. Stephen Henson
42aa3ec4f2 PR: 2888
Reported by: Daniel Black <daniel.black@openquery.com>

Support renewing session tickets (backport from HEAD).
2012-12-10 16:45:39 +00:00
Dr. Stephen Henson
71a2440ee5 backport OCSP fix enhancement 2012-10-05 13:02:31 +00:00
Ben Laurie
48bcdad0d5 Backport OCSP fix. 2012-10-05 12:50:24 +00:00
Richard Levitte
c06271bc35 * ssl/t1_enc.c (tls1_change_cipher_state): Stupid bug. Fortunately in
debugging code that's seldom used.
2012-09-21 13:08:32 +00:00
Dr. Stephen Henson
36dd4cba3d Sanity check record length before skipping explicit IV in DTLS
to fix DoS attack.

Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
fuzzing as a service testing platform.
(CVE-2012-2333)
2012-05-10 14:33:11 +00:00
Dr. Stephen Henson
0b1cf4a139 PR: 2778(part)
Submitted by: John Fitzgibbon <john_fitzgibbon@yahoo.com>

Time is always encoded as 4 bytes, not sizeof(Time).
2012-03-31 18:02:23 +00:00
Dr. Stephen Henson
48819f4d54 fix error code 2012-03-12 14:50:55 +00:00
Dr. Stephen Henson
b0cbdd3eba manually patch missing part of PR#2756 2012-03-12 12:46:52 +00:00
Dr. Stephen Henson
5016107550 PR: 2756
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>

Fix DTLS timeout handling.
2012-03-09 15:51:56 +00:00
Dr. Stephen Henson
725713f74a PR: 2755
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>

Reduce MTU after failed transmissions. [0.9.8 version of patch]
2012-03-07 15:14:16 +00:00
Dr. Stephen Henson
6720779c7e revert PR#2755: it breaks compilation 2012-03-06 18:25:33 +00:00