Commit graph

1484 commits

Author SHA1 Message Date
Scott Deboy
9dabfce1a8 Don't break out of the custom extension callback loop - continue instead
The contract for custom extension callbacks has changed - all custom extension callbacks are triggered
2014-02-05 18:25:47 +00:00
Ben Laurie
0a6028757a Fix whitespace, new-style comments. 2014-02-05 18:25:46 +00:00
Scott Deboy
e9add063b5 Re-add alert variables removed during rebase
Whitespace fixes
2014-02-05 18:25:46 +00:00
Scott Deboy
519531e97e Updating DTCP authorization type to expected value 2014-02-05 18:25:46 +00:00
Scott Deboy
ac20719d99 Update custom TLS extension and supplemental data 'generate' callbacks to support sending an alert.
If multiple TLS extensions are expected but not received, the TLS extension and supplemental data 'generate' callbacks are the only chance for the receive-side to trigger a specific TLS alert during the handshake.

Removed logic which no-op'd TLS extension generate callbacks (as the generate callbacks need to always be called in order to trigger alerts), and updated the serverinfo-specific custom TLS extension callbacks to track which custom TLS extensions were received by the client, where no-ops for 'generate' callbacks are appropriate.
2014-02-05 18:25:46 +00:00
Dr. Stephen Henson
a51f767645 Return per-certificate chain if extra chain is NULL.
If an application calls the macro SSL_CTX_get_extra_chain_certs
return either the old "shared" extra certificates or those associated
with the current certificate.

This means applications which call SSL_CTX_use_certificate_chain_file
and retrieve the additional chain using SSL_CTX_get_extra_chain_certs
will still work. An application which only wants to check the shared
extra certificates can call the new macro
SSL_CTX_get_extra_chain_certs_only
2014-02-05 17:05:01 +00:00
Andy Polyakov
a9c6edcde7 ssl/s3_pkt.c: move multi-block processing to ssl3_write_bytes.
This allows to process multiple fragmets of maximum fragment size,
as opposite to chopping maximum-sized fragments to multiple smaller
ones. This approach relies on dynamic allocation of larger buffers,
which we trade for performance improvement, for several *times* in
some situations.
2014-02-05 14:08:44 +01:00
Andy Polyakov
3ef477c69f s3_pkt.c: move ssl3_release_write_buffer to ssl3_write_bytes.
If application has more data than maximum fragment, hold to buffer
for whole write, as opposite to per-fragment strategy.
2014-02-05 13:57:10 +01:00
Dr. Stephen Henson
0f78819c8c New ctrl to set current certificate.
New ctrl sets current certificate based on certain criteria. Currently
two options: set the first valid certificate as current and set the
next valid certificate as current. Using these an application can
iterate over all certificates in an SSL_CTX or SSL structure.
2014-02-02 22:58:19 +00:00
Dr. Stephen Henson
73c92dfa0c Check i before r[i].
PR#3244
(cherry picked from commit 9614d2c676)
2014-01-28 15:15:58 +00:00
Dr. Stephen Henson
cbb6744827 New function to set compression methods so they can be safely freed. 2014-01-27 14:30:29 +00:00
Dr. Stephen Henson
0ebc965b9c Support retries in certificate callback 2014-01-26 02:44:34 +00:00
Dr. Stephen Henson
ba168244a1 Add new function SSL_CTX_get_ssl_method().
Partial fix for PR#3183.
2014-01-16 14:07:46 +00:00
Kaspar Brand
d0b039d4a3 Omit initial status request callback check.
PR#3178
2014-01-16 13:46:31 +00:00
Daniel Kahn Gillmor
0ecfd920e5 update remaining documentation to move from EDH to DHE
change documentation and comments to indicate that we prefer the
standard "DHE" naming scheme everywhere over the older "EDH"
2014-01-09 15:43:28 +00:00
Daniel Kahn Gillmor
4b5cce664c Replace EDH-RSA-DES-CBC-SHA, etc. with DHE-RSA-DES-CBC-SHA
Replace the full ciphersuites with "EDH-" in their labels with "DHE-"
so that all DHE ciphersuites are referred to in the same way.

Leave backward-compatible aliases for the ciphersuites in question so
that configurations which specify these explicitly will continue
working.
2014-01-09 15:43:28 +00:00
Daniel Kahn Gillmor
889f39c70f change SSL3_CK_EDH_* to SSL_CK_DHE_* (with backward-compatibility)
This change normalizes the SSL_CK_DHE_ #defines to use the common term
"DHE", while permitting older code that uses the more uncommon "EDH"
constants to compile properly.
2014-01-09 15:43:28 +00:00
Daniel Kahn Gillmor
5a21cadbeb use SSL_kDHE throughout instead of SSL_kEDH
DHE is the standard term used by the RFCs and by other TLS
implementations.  It's useful to have the internal variables use the
standard terminology.

This patch leaves a synonym SSL_kEDH in place, though, so that older
code can still be built against it, since that has been the
traditional API.  SSL_kEDH should probably be deprecated at some
point, though.
2014-01-09 15:43:28 +00:00
Daniel Kahn Gillmor
75cb3771b4 emit "DHE" instead of "edh" for kX packet trace output
other parts of packet tracing emit the standard "DHE" label instead of
"edh".  This change brings the output of ssl_print_client_keyex() and
ssl_print_server_keyex() into accordance with the standard term.
2014-01-09 15:43:27 +00:00
Daniel Kahn Gillmor
7988163c3b Allow "DHE" and "kDHE" as synonyms of "EDH" and "kEDH" when specifiying ciphers
The standard terminology in https://tools.ietf.org/html/rfc5426 is
"DHE".  "openssl ciphers" outputs "DHE" (for the most part).  But
users of the library currently cannot specify "DHE", they must
currently specify "EDH".

This change allows users to specify the common term in cipher suite
strings without breaking backward compatibility.
2014-01-09 15:43:27 +00:00
Daniel Kahn Gillmor
4082fea81c use SSL_kECDHE throughout instead of SSL_kEECDH
ECDHE is the standard term used by the RFCs and by other TLS
implementations.  It's useful to have the internal variables use the
standard terminology.

This patch leaves a synonym SSL_kEECDH in place, though, so that older
code can still be built against it, since that has been the
traditional API.  SSL_kEECDH should probably be deprecated at some
point, though.
2014-01-09 15:43:27 +00:00
Daniel Kahn Gillmor
0be085d34a emit "ECDHE" instead of "EECDH" for kX packet trace output
other parts of packet tracing emit the standard "ECDHE" label instead
of "EECDH".  This change brings the output of ssl_print_client_keyex()
and ssl_print_server_keyex() into accordance with the standard term.
2014-01-09 15:43:27 +00:00
Daniel Kahn Gillmor
7963ddeb44 Allow "ECDHE" as a synonym of "EECDH" when specifiying ciphers
The standard terminology in https://tools.ietf.org/html/rfc4492 is
ECDHE.  "openssl ciphers" outputs ECDHE.  But users of the library
currently cannot specify ECDHE, they must specify EECDH.

This change allows users to specify the common term in cipher suite
strings without breaking backward compatibility.
2014-01-09 15:43:27 +00:00
Dr. Stephen Henson
8d65fdb62e Add fix for CVE-2013-4353
(cherry picked from commit 6b42ed4e7104898f4b5b69337589719913b36404)
2014-01-07 15:39:21 +00:00
Dr. Stephen Henson
5b7f36e857 Add ServerInfoFile to SSL_CONF, update docs. 2014-01-03 23:14:23 +00:00
Dr. Stephen Henson
a4339ea3ba Use algorithm specific chains for certificates.
Fix a limitation in SSL_CTX_use_certificate_chain_file(): use algorithm
specific chains instead of the shared chain.

Update docs.
2014-01-03 22:39:49 +00:00
Andy Polyakov
e8b0dd57c0 ssl/t1_enc.c: optimize PRF (suggested by Intel). 2014-01-03 21:52:49 +01:00
Dr. Stephen Henson
b77b58a398 Don't change version number if session established
When sending an invalid version number alert don't change the
version number to the client version if a session is already
established.

Thanks to Marek Majkowski for additional analysis of this issue.

PR#3191
2014-01-02 15:05:44 +00:00
Dr. Stephen Henson
f6dfbeed3c Update curve list size.
(cherry picked from commit cfa86987a8d9d2b8cc5e5fea2d3260c46542cdb9)
2013-12-29 16:30:35 +00:00
Dr. Stephen Henson
20b82b514d 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)
2013-12-20 23:46:16 +00:00
Dr. Stephen Henson
ed496b3d42 Check EVP errors for handshake digests.
Partial mitigation of PR#3200
(cherry picked from commit 0294b2be5f)
2013-12-18 13:29:07 +00:00
Dr. Stephen Henson
4fcdd66fff Update to pad extension.
Fix padding calculation for different SSL_METHOD types. Use the
standard name as used in draft-agl-tls-padding-02
2013-12-13 15:39:55 +00:00
Dr. Stephen Henson
7af31968dd Verify parameter retrieval functions.
New functions to retrieve internal pointers to X509_VERIFY_PARAM
for SSL_CTX and SSL structures.
(cherry picked from commit be0c9270690ed9c1799900643cab91de146de857)
2013-12-13 15:39:55 +00:00
Dr. Stephen Henson
a25f9adc77 New functions to retrieve certificate from SSL_CTX
New functions to retrieve current certificate or private key
from an SSL_CTX.

Constify SSL_get_private_key().
2013-11-18 18:56:48 +00:00
Dr. Stephen Henson
60aeb18750 Don't define SSL_select_next_proto if OPENSSL_NO_TLSEXT set 2013-11-18 16:52:10 +00:00
Dr. Stephen Henson
fdeaf55bf9 Use correct header length in ssl3_send_certifcate_request 2013-11-17 17:48:18 +00:00
Piotr Sikora
2911575c6e Fix compilation with no-nextprotoneg.
PR#3106
2013-11-14 01:20:12 +00:00
Dr. Stephen Henson
629b640bbc Allow match selecting of current certificate.
If pointer comparison for current certificate fails check
to see if a match using X509_cmp succeeds for the current
certificate: this is useful for cases where the certificate
pointer is not available.
2013-11-13 23:48:35 +00:00
Rob Stradling
7b6b246fd3 Additional "chain_cert" functions.
PR#3169

This patch, which currently applies successfully against master and
1_0_2, adds the following functions:

SSL_[CTX_]select_current_cert() - set the current certificate without
disturbing the existing structure.

SSL_[CTX_]get0_chain_certs() - get the current certificate's chain.

SSL_[CTX_]clear_chain_certs() - clear the current certificate's chain.

The patch also adds these functions to, and fixes some existing errors
in, SSL_CTX_add1_chain_cert.pod.
2013-11-13 23:48:35 +00:00
Krzysztof Kwiatkowski
44314cf64d Delete duplicate entry.
PR#3172
2013-11-13 23:48:35 +00:00
Dr. Stephen Henson
0467ea6862 Experimental workaround TLS filler (WTF) extension.
Based on a suggested workaround for the "TLS hang bug" (see FAQ and PR#2771):
if the TLS Client Hello record length value would otherwise be > 255 and less
that 512 pad with a dummy extension containing zeroes so it is at least 512.

To enable it use an unused extension number (for example 0x4242) using
e.g. -DTLSEXT_TYPE_wtf=0x4242

WARNING: EXPERIMENTAL, SUBJECT TO CHANGE.
2013-11-06 20:49:47 +00:00
Dr. Stephen Henson
e0ffd129c1 Enable PSK in FIPS mode.
Enable PSK ciphersuites with AES or DES3 in FIPS mode.
2013-11-06 14:38:28 +00:00
Dr. Stephen Henson
26bda7ef2b Sync error codes with 1.0.2-stable 2013-11-06 14:18:41 +00:00
Dr. Stephen Henson
d519f0831c Add brainpool curves to trace output.
(cherry picked from commit bd80d0229c)
2013-11-02 15:30:03 +00:00
Robin Seggelmann
b9ef52b078 DTLS/SCTP Finished Auth Bug
PR: 2808

With DTLS/SCTP the SCTP extension SCTP-AUTH is used to protect DATA and
FORWARD-TSN chunks. The key for this extension is derived from the
master secret and changed with the next ChangeCipherSpec, whenever a new
key has been negotiated. The following Finished then already uses the
new key.  Unfortunately, the ChangeCipherSpec and Finished are part of
the same flight as the ClientKeyExchange, which is necessary for the
computation of the new secret. Hence, these messages are sent
immediately following each other, leaving the server very little time to
compute the new secret and pass it to SCTP before the finished arrives.
So the Finished is likely to be discarded by SCTP and a retransmission
becomes necessary. To prevent this issue, the Finished of the client is
still sent with the old key.
(cherry picked from commit 9fb523adce)
2013-11-01 21:41:52 +00:00
Piotr Sikora
29b490a458 Fix SSL_OP_SINGLE_ECDH_USE
Don't require a public key in tls1_set_ec_id if compression status is
not needed. This fixes a bug where SSL_OP_SINGLE_ECDH_USE wouldn't work.
(cherry picked from commit 5ff68e8f6d)
2013-11-01 21:41:52 +00:00
Dr. Stephen Henson
a9bc1af984 Add -ecdh_single option.
Add -ecdh_single option to set SSL_OP_SINGLE_ECDH_USE on the command line.
(cherry picked from commit f14a4a861d)
2013-11-01 21:41:52 +00:00
Dr. Stephen Henson
96e16bddb4 Fix warning. 2013-11-01 21:41:52 +00:00
Dr. Stephen Henson
c557f921dc Add SSL_CONF command to set DH Parameters. 2013-10-22 07:38:25 +01:00
Dr. Stephen Henson
abf840e4f7 Fix argument processing. 2013-10-22 05:44:23 +01:00