summaryrefslogtreecommitdiffstats
path: root/ssl/s3_srvr.c
AgeCommit message (Collapse)Author
2015-03-19Fix DHE Null CKE vulnerabilityMatt Caswell
If client auth is used then a server can seg fault in the event of a DHE cipher being used and a zero length ClientKeyExchange message being sent by the client. This could be exploited in a DoS attack. CVE-2015-1787 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-02-27Fix missing return value checks.Matt Caswell
Fixed various missing return value checks in ssl3_send_newsession_ticket. Also a mem leak on error. Reviewed-by: Richard Levitte <levitte@openssl.org> Conflicts: ssl/s3_srvr.c
2015-01-22Re-align some comments after running the reformat script.OpenSSL_1_0_2-post-reformatMatt Caswell
This should be a one off operation (subsequent invokation of the script should not move them) This commit is for the 1.0.2 changes Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Rerun util/openssl-format-source -v -c .OpenSSL_1_0_2-post-auto-reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Tweaks for comments due to indent's inability to handle themMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix source where indent will not be able to copeMatt Caswell
Conflicts: apps/ciphers.c ssl/s3_pkt.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22mark all block comments that need format preserving so thatTim Hudson
indent will not alter them when reformatting comments (cherry picked from commit 1d97c8435171a7af575f73c526d79e1ef0ee5960) Conflicts: crypto/bn/bn_lcl.h crypto/bn/bn_prime.c crypto/engine/eng_all.c crypto/rc4/rc4_utl.c crypto/sha/sha.h ssl/kssl.c ssl/t1_lib.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-08Unauthenticated DH client certificate fix.Dr. Stephen Henson
Fix to prevent use of DH client certificates without sending certificate verify message. If we've used a client certificate to generate the premaster secret ssl3_get_client_key_exchange returns 2 and ssl3_get_cert_verify is never called. We can only skip the certificate verify message in ssl3_get_cert_verify if the client didn't send a certificate. Thanks to Karthikeyan Bhargavan for reporting this issue. CVE-2015-0205 Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-06Only allow ephemeral RSA keys in export ciphersuites.Dr. Stephen Henson
OpenSSL clients would tolerate temporary RSA keys in non-export ciphersuites. It also had an option SSL_OP_EPHEMERAL_RSA which enabled this server side. Remove both options as they are a protocol violation. Thanks to Karthikeyan Bhargavan for reporting this issue. (CVE-2015-0204) Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-02Remove MS SGCDr. Stephen Henson
MS Server gated cryptography is obsolete and dates from the time of export restrictions on strong encryption and is only used by ancient versions of MSIE. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 63eab8a620944a990ab3985620966ccd9f48d681)
2014-12-17Clear warnings/errors within KSSL_DEBUG code sectionsRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org>
2014-12-17Clear warnings/errors within CIPHER_DEBUG code sectionsRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org>
2014-12-17Premaster secret handling fixesAdam Langley
From BoringSSL - Send an alert when the client key exchange isn't correctly formatted. - Reject overly short RSA ciphertexts to avoid a (benign) out-of-bounds memory access. Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit 4aecfd4d9f366c849c9627ab666d1b1addc024e6)
2014-12-16Check return value of ssl3_output_cert_chainDr. Stephen Henson
(cherry picked from commit 66f96fe2d519147097c118d4bf60704c69ed0635) Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-08Fixed memory leak in the event of a failure of BUF_MEM_growMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 41bf25013032da0eeb111ce3c8fc0946c0e61c41)
2014-11-20Do not resume a session if the negotiated protocol version does not matchDavid Benjamin
the session's version (server). See also BoringSSL's commit bdf5e72f50e25f0e45e825c156168766d8442dde. Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit 9e189b9dc10786c755919e6792e923c584c918a1)
2014-11-20Ensure SSL3_FLAGS_CCS_OK (or d1->change_cipher_spec_ok for DTLS) is resetEmilia Kasper
once the ChangeCipherSpec message is received. Previously, the server would set the flag once at SSL3_ST_SR_CERT_VRFY and again at SSL3_ST_SR_FINISHED. This would allow a second CCS to arrive and would corrupt the server state. (Because the first CCS would latch the correct keys and subsequent CCS messages would have to be encrypted, a MitM attacker cannot exploit this, though.) Thanks to Joeri de Ruiter for reporting this issue. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit e94a6c0ede623960728415b68650a595e48f5a43)
2014-11-19New option no-ssl3-method which removes SSLv3_*methodDr. Stephen Henson
When no-ssl3 is set only make SSLv3 disabled by default. Retain -ssl3 options for s_client/s_server/ssltest. When no-ssl3-method is set SSLv3_*method() is removed and all -ssl3 options. We should document this somewhere, e.g. wiki, FAQ or manual page. Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 3881d8106df732fc433d30446625dfa2396da42d)
2014-11-19Process signature algorithms before deciding on certificate.Dr. Stephen Henson
The supported signature algorithms extension needs to be processed before the certificate to use is decided and before a cipher is selected (as the set of shared signature algorithms supported may impact the choice). Reviewed-by: Matt Caswell <matt@openssl.org>
2014-09-24RT3067: simplify patchEmilia Kasper
(Original commit adb46dbc6dd7347750df2468c93e8c34bcb93a4b) Use the new constant-time methods consistently in s3_srvr.c Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit 455b65dfab0de51c9f67b3c909311770f2b3f801)
2014-09-24This change alters the processing of invalid, RSA pre-master secrets soAdam Langley
that bad encryptions are treated like random session keys in constant time. (cherry picked from commit adb46dbc6dd7347750df2468c93e8c34bcb93a4b) Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-08-09Fix SRP authentication ciphersuites.Dr. Stephen Henson
The addition of SRP authentication needs to be checked in various places to work properly. Specifically: A certificate is not sent. A certificate request must not be sent. Server key exchange message must not contain a signature. If appropriate SRP authentication ciphersuites should be chosen. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 8f5a8805b82d1ae81168b11b7f1506db9e047dec)
2014-08-06Check SRP parameters early.Dr. Stephen Henson
Check SRP parameters when they are received so we can send back an appropriate alert. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2014-07-05Don't limit message sizes in ssl3_get_cert_verify.Dr. Stephen Henson
PR#319 (reoponed version). (cherry picked from commit 7f6e9578648728478e84246fd3e64026b8b6a48e)
2014-07-04Remove all RFC5878 code.Dr. Stephen Henson
Remove RFC5878 code. It is no longer needed for CT and has numerous bugs.
2014-06-05Fix for CVE-2014-0224Dr. Stephen Henson
Only accept change cipher spec when it is expected instead of at any time. This prevents premature setting of session keys before the master secret is determined which an attacker could use as a MITM attack. Thanks to KIKUCHI Masashi (Lepidum Co. Ltd.) for reporting this issue and providing the initial fix this patch is based on. (cherry picked from commit bc8923b1ec9c467755cd86f7848c50ee8812e441)
2014-06-01Allocate extra space when NETSCAPE_HANG_BUG defined.David Ramos
Make sure there is an extra 4 bytes for server done message when NETSCAPE_HANG_BUG is defined. PR#3361 (cherry picked from commit 92d81ba622396425764d676ba4fb3f0dac273f17)
2014-05-12Replace manual ASN1 decoder with ASN1_get_objectSerguei E. Leontiev
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-03-18Retry callback only after ClientHello received.Piotr Sikora
(cherry picked from commit f04665a653665cd6432b9adfeb7c7f12a7447d26)
2014-02-20fix WIN32 warningsDr. Stephen Henson
2014-02-09More cleanup.Ben Laurie
(cherry picked from commit 5eda213ebe382009c2f37a8eade5cbcdae6017ed) Conflicts: apps/s_client.c apps/s_server.c
2014-02-09Make it build.Ben Laurie
(cherry picked from commit a6a48e87bc469f37ed1c53d0e4d22faaa0a5adf3) Conflicts: ssl/s3_clnt.c ssl/t1_lib.c
2014-02-08Fix whitespace, new-style comments.Ben Laurie
2014-02-08Re-add alert variables removed during rebaseScott Deboy
Whitespace fixes (cherry picked from commit e9add063b50e8a460d5636055156d2760c2fe29f) Conflicts: ssl/s3_clnt.c
2014-02-08Update custom TLS extension and supplemental data 'generate' callbacks to ↵Scott Deboy
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. (cherry picked from commit ac20719d994729970eb3b775c7bffa81f0e9f960) Conflicts: ssl/t1_lib.c
2014-02-08Add callbacks supporting generation and retrieval of supplemental data ↵Scott Deboy
entries, facilitating RFC 5878 (TLS auth extensions) Removed prior audit proof logic - audit proof support was implemented using the generic TLS extension API Tests exercising the new supplemental data registration and callback api can be found in ssltest.c. Implemented changes to s_server and s_client to exercise supplemental data callbacks via the -auth argument, as well as additional flags to exercise supplemental data being sent only during renegotiation. (cherry picked from commit 36086186a9b90cdad0d2cd0a598a10f03f8f4bcc) Conflicts: Configure apps/s_client.c apps/s_server.c ssl/ssl.h ssl/ssl3.h ssl/ssltest.c
2014-01-28Check i before r[i].Dr. Stephen Henson
PR#3244 (cherry picked from commit 9614d2c676ffe74ce0c919d9e5c0d622a011cbed)
2014-01-27Support retries in certificate callbackDr. Stephen Henson
(cherry picked from commit 0ebc965b9ca4352e407bb7cfa65ac235942117f6) Conflicts: ssl/s3_srvr.c ssl/ssl3.h
2014-01-02Don't change version number if session establishedDr. Stephen Henson
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 (cherry picked from commit b77b58a398c8b9b4113f3fb6b48e162a3b8d4527)
2013-11-17Use correct header length in ssl3_send_certifcate_requestDr. Stephen Henson
(cherry picked from commit fdeaf55bf95e1e2a1e70cca8b68c7d8bbef7c8f0)
2013-10-20Fix another gmt_unix_time case in server_randomNick Mathewson
2013-10-20Do not include a timestamp in the Client/ServerHello Random field.Nick Mathewson
Instead, send random bytes, unless SSL_SEND_{CLIENT,SERVER}RANDOM_MODE is set. This is a forward-port of commits: 4af793036f6ef4f0a1078e5d7155426a98d50e37 f4c93b46edb51da71f09eda99e83eaf193a33c08 3da721dac9382c48812c8eba455528fd59af2eef 2583270191a8b27eed303c03ece1da97b9b69fd3 While the gmt_unix_time record was added in an ostensible attempt to mitigate the dangers of a bad RNG, its presence leaks the host's view of the current time in the clear. This minor leak can help fingerprint TLS instances across networks and protocols... and what's worse, it's doubtful thet the gmt_unix_time record does any good at all for its intended purpose, since: * It's quite possible to open two TLS connections in one second. * If the PRNG output is prone to repeat itself, ephemeral handshakes (and who knows what else besides) are broken.
2013-09-18Suite B support for DTLS 1.2Dr. Stephen Henson
Check for Suite B support using method flags instead of version numbers: anything supporting TLS 1.2 cipher suites will also support Suite B. Return an error if an attempt to use DTLS 1.0 is made in Suite B mode. (cherry picked from commit 4544f0a69161a37ee3edce3cc1bc34c3678a4d64)
2013-09-18Always return errors in ssl3_get_client_helloDr. Stephen Henson
If we successfully match a cookie don't set return value to 2 as this results in other error conditions returning 2 as well. Instead set return value to -2 which can be checked later if everything else is OK. (cherry picked from commit c56f5b8edfbcec704f924870daddd96a5f768fbb)
2013-09-18Dual DTLS version methods.Dr. Stephen Henson
Add new methods DTLS_*_method() which support both DTLS 1.0 and DTLS 1.2 and pick the highest version the peer supports during negotiation. As with SSL/TLS options can change this behaviour specifically SSL_OP_NO_DTLSv1 and SSL_OP_NO_DTLSv1_2. (cherry picked from commit c6913eeb762edffddecaaba5c84909d7a7962927) Conflicts: CHANGES
2013-09-18Use enc_flags when deciding protocol variations.Dr. Stephen Henson
Use the enc_flags field to determine whether we should use explicit IV, signature algorithms or SHA256 default PRF instead of hard coding which versions support each requirement. (cherry picked from commit cbd64894ec687c6f37d8e43c16dff78e63f6be87) Conflicts: ssl/ssl_locl.h
2013-09-18DTLS revision.Dr. Stephen Henson
Revise DTLS code. There was a *lot* of code duplication in the DTLS code that generates records. This makes it harder to maintain and sometimes a TLS update is omitted by accident from the DTLS code. Specifically almost all of the record generation functions have code like this: some_pointer = buffer + HANDSHAKE_HEADER_LENGTH; ... Record creation stuff ... set_handshake_header(ssl, SSL_MT_SOMETHING, message_len); ... write_handshake_message(ssl); Where the "Record creation stuff" is identical between SSL/TLS and DTLS or in some cases has very minor differences. By adding a few fields to SSL3_ENC to include the header length, some flags and function pointers for handshake header setting and handshake writing the code can cope with both cases. (cherry picked from commit 173e72e64c6a07ae97660c322396b66215009f33)
2012-12-30stop warning when compiling with no-compDr. Stephen Henson
2012-12-26Add three Suite B modes to TLS code, supporting RFC6460.Dr. Stephen Henson
(backport from HEAD)