summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_clnt.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove support for fixed ECDH cipher suites - these is not widely supportedjsing2016-10-191-14/+5
| | | | | | | | | and more importantly they do not provide PFS (if you want to use ECDH, use ECDHE instead). With input from guenther@. ok deraadt@ guenther@
* Merge a memleak fix from BoringSSL 6b6e0b2:mmcc2016-03-271-1/+3
| | | | | | https://boringssl.googlesource.com/boringssl/+/6b6e0b20893e2be0e68af605a60ffa2cbb0ffa64%5E!/#F0 ok millert@, beck@
* X509_free(3) is NULL-safe, so remove NULL checks before its calls.mmcc2016-03-111-7/+4
| | | | ok doug@
* s/ssl3_client_kex/ssl3_send_client_kex/ for consistency with the caller.jsing2015-10-021-9/+11
|
* Stop generating private keys in a network buffer.jsing2015-09-131-29/+29
| | | | | | | | | | The current client key exchange code generates DH and ECDH keys into the same buffer that we use to send data to the network - stop doing this and malloc() a new buffer, which we explicit_bzero() and free() on return. This also benefits from ASLR and means that the keys are no longer generated in a well known location. ok beck@
* Use ECDH_size() instead of rolling our own.jsing2015-09-131-6/+5
| | | | ok beck@
* Split ssl3_send_client_key_exchange() (387 lines of code) into fivejsing2015-09-121-327/+351
| | | | | | | | | functions. The original was written as a huge if/else if chain - split out the handling for each key exchange type. This allows us to reduce two levels of indentation, make the code far more readable and have single return paths so that we can simplify clean up. ok beck@
* explicit_bzero() the GOST premaster secret.jsing2015-09-121-2/+7
| | | | ok miod@
* Remove most of the SSLv3 version checks and a few TLS v1.0.doug2015-09-121-39/+21
| | | | | | | We can now assume >= TLS v1.0 since SSL2_VERSION, SSL3_VERSION and DTLS1_BAD_VER support was removed. "reads ok" miod@
* Use explicit_bzero() instead of memset() when clearing private keys.jsing2015-09-121-3/+4
| | | | ok bcook@ beck@ miod@
* Pull variable assignment out from function call, fix indentation and setjsing2015-09-121-8/+7
| | | | state after calling ssl3_handshake_msg_finish().
* style(9) and whitespace cleanups.jsing2015-09-121-29/+25
|
* Rename functions that moved to t1_enc.c, with a tls1_ prefix instead of ajsing2015-09-111-7/+7
| | | | | | ssl3_ prefix. ok beck@
* Correct spelling of OPENSSL_cleanse.jsing2015-09-101-2/+2
| | | | ok miod@
* Replace dtls1_client_hello() with ssl3_client_hello() - both are basicallyjsing2015-09-021-5/+22
| | | | | | | | | | | the same code, with two slight differences for DTLS handling. Also, make use of send_cookie to determine if the client random needs to be preserved, rather than testing if it is zeroed (hopefully your random number generator never returned all zeros, since the existing code would break). Inspired by BoringSSL. ok doug@
* Remove the ssl_prepare_{client,server}hello_tlsext() functions, which arejsing2015-09-011-6/+1
| | | | | | now nothing more than noops. ok bcook@ doug@
* Remove SSLv3 method data structs and unlink s3_meth.c from the build.doug2015-08-291-40/+1
| | | | ok jsing@
* Remove SSLv3 support from LibreSSL.doug2015-08-271-15/+1
| | | | | | | | | | This is the first wave of SSLv3 removal which removes the main SSLv3 functions. Future commits will remove the rest of the SSLv3 support. Discussed the plan at c2k15. Input from jsing@, beck@, miod@, bcook@, sthen@, naddy@, and deraadt@. ok jsing@, beck@
* Add linker warnings in case SSLv3_{,client,server}_method are referenced.miod2015-07-291-1/+7
| | | | | | | Use of this symbols proves the existence of a code path willingly using SSLv3, even with OPENSSL_NO_SSL3 being defined, which hints that it needs fixing. Discussed with the LibreSSL cabal during c2k15; ok deraadt@
* Convert ssl3_get_certificate_request to CBS.doug2015-07-191-31/+33
| | | | ok miod@
* check n before cbs_init, coverity - ID 125063beck2015-07-151-3/+9
| | | | ok bcook@ miod@
* test for n<0 before use in CBS_init - mostly to shut up coverity.beck2015-07-151-5/+16
| | | | reluctant ok miod@
* Flense out dead code, we don't do ecdhe_clnt_cert.beck2015-07-151-98/+40
| | | | | coverity ID's 21691 21698 ok miod@, "Fry it" jsing@
* Convert ssl3_get_cert_status to CBS.doug2015-07-141-17/+26
| | | | ok miod@ jsing@
* Convert ssl3_get_server_certificate to CBS.doug2015-07-141-17/+18
| | | | ok miod@
* Stop using BUF_memdup() within the LibreSSL code base - it is correctlyjsing2015-06-241-3/+3
| | | | | | spelt malloc+memcpy, which is what is used in all except two places. ok deraadt@ doug@
* Convert ssl3_get_new_session_ticket to CBS.doug2015-06-201-24/+24
| | | | tweak + ok miod@ jsing@
* Remove ancient SSL_OP_NETSCAPE_CA_DN_BUG from SSLeay days.doug2015-06-151-18/+6
| | | | | | | This commit matches the OpenSSL removal in commit 3c33c6f6b10864355553961e638514a6d1bb00f6. ok deraadt@
* Nuke the OPENSSL_MAX_TLS1_2_CIPHER_LENGTH hack - this has to be enabled atjsing2015-03-311-11/+1
| | | | | | | compile time, which we do not do and are unlikely to ever do. Additionally, there are two runtime configurable alternatives that exist. ok bcook@ doug@
* Factor out the init_buf initialisation code, rather than duplicating itjsing2015-03-271-19/+6
| | | | | | in four different places. ok doug@ guenther@
* delay EVP_MD_CTX_init so we don't forget to clean it up.tedu2015-03-111-3/+4
| | | | spotted by miod. ok miod.
* Reject DH keys sent by a server if they are considered too small; inspiredmiod2015-03-081-1/+12
| | | | | by a similar BoringSSL change, but raising the limit to 1024 bits. ok jsing@ markus@ guenther@ deraadt@
* Clean up the {get,put}_cipher_by_char() implementations. Also usejsing2015-02-071-7/+5
| | | | | | | ssl3_get_cipher_by_value() in other parts of the code where it simplifies things. ok doug@
* Add additional checks to ssl3_send_client_key_exchange() that ensuresjsing2015-02-061-18/+25
| | | | | | | | ephemeral keys exist for SSL_kDHE and SSL_kECDHE. This would have prevented CVE-2014-3572. ok doug@
* Bring back the horrible API that is get_cipher_by_char/put_cipher_by_char.jsing2015-02-061-1/+3
| | | | | | | | This API was intended to be an internal only, however like many things in OpenSSL, it is exposed externally and parts of the software ecosystem are now using it since there is no real alternative within the public API. ok doug@, tedu@ and reluctantly miod@
* Ensure that a ServerKeyExchange message is received if the selected cipherjsing2015-01-231-5/+18
| | | | | | | | | | | | | | suite uses ephemeral keys. This avoids an issue where an ECHDE cipher suite can effectively be downgraded to ECDH, if the server omits the ServerKeyExchange message and has provided a certificate with an ECC public key. Issue reported to OpenSSL by Karthikeyan Bhargavan. Based on OpenSSL. Fixes CVE-2014-3572. ok beck@
* Add error handling for EVP_DigestInit_ex().doug2014-12-151-4/+8
| | | | | | | | | | | | | A few EVP_DigestInit_ex() calls were left alone since reporting an error would change the public API. Changed internal ssl3_cbc_digest_record() to return a value due to the above change. It will also now set md_out_size=0 on failure. This is based on part of BoringSSL's commit to fix malloc crashes: https://boringssl.googlesource.com/boringssl/+/69a01608f33ab6fe2c3485d94aef1fe9eacf5364 ok miod@
* Convert all of the straight forward client handshake handling code to usejsing2014-12-141-53/+43
| | | | | | the new handshake functions. ok miod@
* Remove trailing whitespace.jsing2014-12-141-2/+2
|
* unifdef OPENSSL_NO_NEXTPROTONEG, which is one of the last standing #ifndefjsing2014-12-141-9/+1
| | | | | | | mazes in libssl. NPN is being replaced by ALPN, however it is still going to be around for a while yet. ok miod@
* ssl3_init_finished_mac() calls BIO_new() which can fail since it in turnjsing2014-12-101-2/+5
| | | | | | | | calls malloc(). Instead of silently continuing on failure, check the return value of BIO_new() and propagate failure back to the caller for appropriate handling. ok bcook@
* Remove support for GOST R 34.10-94 signature authentication, along withjsing2014-12-101-3/+1
| | | | | | | the two ciphersuites that use it. GOST94 public/private keys have been long obsoleted and libcrypto does not have support for them anyway. Discussed with Dmitry Eremin-Solenikov.
* Remove client handling of RSA in ServerKeyExchange messages, along withjsing2014-12-061-81/+14
| | | | | | | | | the associated peer_rsa_tmp goop. This was only needed for export cipher handling and intentional RFC violations. The export cipher suites have already been removed and previous cleanup means that we will never send ServerKeyExchange messages from the server side for RSA.
* Ensure that sess_cert is not NULL at the start ofjsing2014-11-271-25/+9
| | | | | | | ssl3_send_client_key_exchange(), rather than checking it in the key exchange algorithm specific code. ok beck@ miod@
* Fix a memory leak with pkey in client key exchangedoug2014-11-191-1/+2
| | | | | | Based on boringssl commit: 1df112448b41c3568477f3fcd3b8fc820ce80066 ok miod@ jsing@
* Update the GOST code in libssl, as contributed by Dmitry Eremin-Solenikov.miod2014-11-181-20/+51
| | | | | This causes a libssl major version bump as this affects the layout of some internal-but-unfortunately-made-visible structs.
* Sort and group includes.jsing2014-11-161-4/+7
|
* Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().jsing2014-10-181-7/+4
| | | | | | | | | | | | | | | arc4random provides high quality pseudo-random numbers, hence there is no need to differentiate between "strong" and "pseudo". Furthermore, the arc4random_buf() function is guaranteed to succeed, which avoids the need to check for and handle failure, simplifying the code. It is worth noting that a number of the replaced RAND_bytes() and RAND_pseudo_bytes() calls were missing return value checks and these functions can fail for a number of reasons (at least in OpenSSL - thankfully they were converted to wrappers around arc4random_buf() some time ago in LibreSSL). ok beck@ deraadt@ miod@
* Check that the specified curve is one of the client preferences.jsing2014-09-271-4/+20
| | | | | | Based on OpenSSL. ok miod@
* remove obfuscating parens. man operator is your friend.tedu2014-09-191-6/+6
|