Commit graph

1211 commits

Author SHA1 Message Date
Matt Caswell
5aca5d41c0 Added SSLErr call for internal error in dtls1_buffer_record 2014-06-01 21:43:51 +01:00
David Ramos
8343e6b6b2 Delays the queue insertion until after the ssl3_setup_buffers() call due to use-after-free bug. PR#3362 2014-06-01 21:42:47 +01:00
David Ramos
268ae49453 Allocate extra space when NETSCAPE_HANG_BUG defined.
Make sure there is an extra 4 bytes for server done message when
NETSCAPE_HANG_BUG is defined.

PR#3361
(cherry picked from commit 673c42b238)
2014-06-01 14:31:30 +01:00
Ben Laurie
c01a838d62 Fix signed/unsigned warning.
(cherry picked from commit 989d87cb1a)
2014-05-29 14:12:13 +01:00
Matt Caswell
44f28dd1e6 Fix for non compilation with TLS_DEBUG defined 2014-05-24 23:59:24 +01:00
Kurt Roeckx
365e872fa1 Check sk_SSL_CIPHER_num() after assigning sk. 2014-05-12 23:05:19 +01:00
Serguei E. Leontiev
f7c4fe519b Replace manual ASN1 decoder with ASN1_get_object
Replace manual ASN.1 decoder with ASN1_get object. This
will decode the tag and length properly and check against
it does not exceed the supplied buffer length.

PR#3335
(cherry picked from commit b0308dddd1cc6a8e1de803ef29ba6da25ee072c2)
2014-05-12 18:41:49 +01:00
Matt Caswell
92c2c6e88c Fixed NULL pointer dereference. See PR#3321 2014-05-12 00:48:17 +01:00
Günther Noack
12cbba0d54 Avoid out-of-bounds write in SSL_get_shared_ciphers
PR: 3317
2014-05-11 23:59:38 +01:00
Tim Hudson
0552cbcdaa safety check to ensure we dont send out beyond the users buffer 2014-05-11 13:33:57 +01:00
Tim Hudson
1535ff91e1 fix coverity issue 966597 - error line is not always initialised 2014-05-08 00:04:16 +01:00
Ben Laurie
e4e1b8f230 Fix use after free. 2014-04-23 07:33:26 +01:00
mancha
da8f10881e Fix double frees.
Conflicts:
	CHANGES
2014-04-22 22:52:26 +01:00
Dr. Stephen Henson
6fe498497c typo
(cherry picked from commit a029788b0e)
2014-03-10 15:49:35 +00:00
Dr. Stephen Henson
e67c71c8fd Fix for WIN32 builds with KRB5
(cherry picked from commit 3eddd1706a30cdf3dc9278692d8ee9038eac8a0d)
2014-02-26 15:33:31 +00:00
Andy Polyakov
ffa0e16198 ssl/t1_enc.c: check EVP_MD_CTX_copy return value.
PR: 3201
(cherry picked from commit 03da57fe14)
2014-02-25 22:24:52 +01:00
Kaspar Brand
5df832293e Omit initial status request callback check.
PR#3178
(cherry picked from commit eb85ee9a88)
2014-01-16 13:51:05 +00:00
Zoltan Arpadffy
317ed9abdb VMS fixes 2014-01-11 22:42:15 +00:00
Dr. Stephen Henson
1b0d48126b 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:05 +00:00
Dr. Stephen Henson
2d64b51d20 Fix DTLS retransmission from previous session.
For DTLS we might need to retransmit messages from the previous session
so keep a copy of write context in DTLS retransmission buffers instead
of replacing it after sending CCS. CVE-2013-6450.
(cherry picked from commit 34628967f1)

Conflicts:

	ssl/ssl_locl.h
2013-12-20 23:20:24 +00:00
Rob Stradling
7a1b1722f5 Remove empty line. 2013-09-10 11:38:52 +01:00
Rob Stradling
583c2aa3e5 Tidy up comments. 2013-09-10 10:13:00 +01:00
Rob Stradling
9b2b619133 Use TLS version supplied by client when fingerprinting Safari. 2013-09-10 10:05:17 +01:00
Rob Stradling
48f91f6a88 Backport TLS 1.1/1.2 #defines 2013-09-09 21:08:17 +01:00
Rob Stradling
6f1c8d45f7 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-09-09 14:13:59 +01:00
Michael Tuexen
6f87807e62 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.
(cherry picked from commit b62f4daac0)

Conflicts:

	ssl/d1_pkt.c
2013-08-13 18:59:41 +01:00
Michael Tuexen
799f203ff6 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:32:26 +01:00
Dr. Stephen Henson
4d11426716 Set s->d1 to NULL after freeing it.
(cherry picked from commit 04638f2fc3)
2013-04-08 18:40:08 +01:00
Dr. Stephen Henson
a47060f1c9 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:47:51 +00:00
Michael Tuexen
a1a45c59ec Avoid unnecessary fragmentation.
(cherry picked from commit 80ccc66d7e)
2013-03-18 14:33:15 +00:00
David Woodhouse
6a14feb048 Check DTLS_BAD_VER for version number.
Need to check DTLS_BAD_VER as well as DTLS1_VERSION.
PR:2984
2013-02-12 15:09:44 +00:00
Dr. Stephen Henson
02c54f7c22 Fix in ssltest is no-ssl2 configured
(cherry picked from commit cbf9b4aed3)
2013-02-11 18:27:06 +00:00
Dr. Stephen Henson
243dac0af0 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:26:33 +00:00
Andy Polyakov
71a1ac9398 ssl/s3_[clnt|srvr].c: fix warnings and linking error. 2013-02-09 19:48:34 +01:00
Andy Polyakov
6a2f94b39a s3_cbc.c: make CBC_MAC_ROTATE_IN_PLACE universal.
(cherry picked from commit f93a41877d)
2013-02-08 21:37:30 +01:00
Andy Polyakov
6ba1d561eb s3_cbc.c: get rid of expensive divisions [from master].
(cherry picked from commit e9baceab5a)
2013-02-08 17:01:31 +01:00
Andy Polyakov
f73546df92 ssl/[d1|s3]_pkt.c: harmomize orig_len handling.
(cherry picked from commit 8545f73b89)
2013-02-08 11:14:12 +01:00
Dr. Stephen Henson
be125aa5ba 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 32cc2479b4)

Resolved conflicts:

	ssl/s3_cbc.c
2013-02-08 11:12:49 +01:00
Andy Polyakov
413cbfe68d 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 8bfd4c659f)
2013-02-07 13:43:51 +00:00
Adam Langley
ee463921ed 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.
2013-02-06 15:50:42 +00:00
Dr. Stephen Henson
65a9383e6b make update 2013-02-05 16:46:21 +00:00
Dr. Stephen Henson
25590043d1 Fix error codes.
(cherry picked from commit 35d732fc2e)
2013-02-05 16:46:19 +00:00
Andy Polyakov
33f44acbbe s3/s3_cbc.c: allow for compilations with NO_SHA256|512.
(cherry picked from commit d5371324d9)
2013-02-05 16:46:18 +00:00
Andy Polyakov
11c48a0fd2 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:46:18 +00:00
Andy Polyakov
3cdaca2436 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:46:17 +00:00
Ben Laurie
b23da2919b 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)
2013-02-05 16:46:17 +00:00
Ben Laurie
610dfc3ef4 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)
2013-02-05 16:46:17 +00:00
Ben Laurie
080f395392 Fixups from previous commit. 2013-02-05 16:46:17 +00:00
Ben Laurie
f852b60797 Oops. Add missing file.
(cherry picked from commit 014265eb02)
2013-02-05 16:46:16 +00:00
Ben Laurie
e5420be6cd 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
2013-02-05 16:46:16 +00:00