summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_clnt.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Remove SSL_kDHr, SSL_kDHd and SSL_aDH. No supported ciphersuites use them,jsing2014-09-071-16/+3
| | | | | | nor do we plan on supporting them. ok guenther@
* Replace the remaining ssl3_get_cipher_by_char() calls with n2s() andjsing2014-08-231-7/+15
| | | | | | ssl3_get_cipher_by_id(). ok bcook@
* Currently, ssl3_put_char_by_bytes(NULL, NULL) is just a long handed wayjsing2014-08-111-2/+2
| | | | | | | | of writing "2". Add a define for the SSL3_CIPHER_VALUE_SIZE (rather than using a less-readable hardcoded constant everywhere) and replace the ssl3_put_char_by_bytes(NULL, NULL) calls with it. ok bcook@ miod@
* Since we no longer need to support SSLv2-style cipher lists, startjsing2014-08-101-7/+5
| | | | | | | | | | unravelling the maze of function pointers and callbacks by directly calling ssl3_{get,put}_cipher_by_char() and removing the ssl_{get,put}_cipher_by_char macros. Prompted by similar changes in boringssl. ok guenther.
* merge CVE-2014-3510; Fix DTLS anonymous EC(DH) denial of servicederaadt2014-08-071-1/+9
| | | | | https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=17160033765480453be0a41335fa6b833691c049 ok bcook
* Missing bounds check in ssl3_get_certificate_request(), was not spotted inmiod2014-07-171-1/+6
| | | | 1.78; reported by Ilja Van Sprundel.
* The correct name for EDH is DHE, likewise EECDH should be ECDHE.jsing2014-07-121-6/+6
| | | | | | Based on changes to OpenSSL trunk. ok beck@ miod@
* remove double brackets. fixes build with clang.jsg2014-07-121-2/+2
| | | | ok jsing@
* Remove extra parenthesis.jsing2014-07-121-2/+2
|
* need_cert is now always true, so remove the variable and associatedjsing2014-07-121-33/+21
| | | | | | conditionals. ok miod@
* Remove remnants from PSK, KRB5 and SRP.jsing2014-07-121-18/+7
| | | | ok beck@ miod@
* As reported by David Ramos, most consumer of ssl_get_message() perform latemiod2014-07-111-11/+74
| | | | | | | | | | | | | | | | | | bounds check, after reading the 2-, 3- or 4-byte size of the next chunk to process. But the size fields themselves are not checked for being entirely contained in the buffer. Since reading past your bounds is bad practice, and may not possible if you are using a secure memory allocator, we need to add the necessary bounds check, at the expense of some readability. As a bonus, a wrong size GOST session key will now trigger an error instead of a printf to stderr and it being handled as if it had the correct size. Creating this diff made my eyes bleed (in the real sense); reviewing it made guenther@'s and beck@'s eyes bleed too (in the literal sense). ok guenther@ beck@
* If the application uses tls_session_secret_cb for session resumption, setmiod2014-07-111-2/+3
| | | | the CCS_OK flag. From OpenSSL trunk.
* Accept CCS again after `finished' has been sent by the client; at this pointmiod2014-07-111-5/+6
| | | | | | | keys have been correctly set up so it is ok to accept CCS from the server. Without renegotiation can sometimes fail. OpenSSL PR #3400 via OpenSSL trunk.
* Remove the PSK code. We don't need to drag around thisbeck2014-07-111-136/+1
| | | | | baggage. ok miod@ jsing@
* decompress libssl. ok beck jsingtedu2014-07-101-70/+2
|
* tedu the SSL export cipher handling - since we do not have enabled exportjsing2014-07-091-31/+1
| | | | | | ciphers we no longer need the flags or code to support it. ok beck@ miod@
* always compare memcmp against 0, for clarity.tedu2014-06-211-2/+2
|
* convert CRYPTO_memcmp to timingsafe_memcmp based on current policy favoringtedu2014-06-191-3/+3
| | | | | | libc interfaces over libcrypto interfaces. for now we also prefer timingsafe_memcmp over timingsafe_bcmp, even when the latter is acceptable. ok beck deraadt matthew miod
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* Stop setting the EVP_MD_CTX_FLAG_NON_FIPS_ALLOW - it has been ignored sincejsing2014-06-111-2/+0
| | | | | | OpenSSL 1.0.0. ok miod@ (a little while back)
* http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=2016265dfbab162e ↵deraadt2014-06-071-3/+1
| | | | | | | | | | | | | | | | | | | c30718b5e7480add42598158 Don't know the full story, but it looks like a "can't do random perfectly, so do it god awful" problem was found in 2013, and replaced with "only do it badly if a flag is set". New flags (SSL_MODE_SEND_SERVERHELLO_TIME and SSL_MODE_SEND_SERVERHELLO_TIME) were added [Ben Laurie?] to support the old scheme of "use time_t for first 4 bytes of the random buffer". Nothing uses these flags [ecosystem scan by sthen] Fully discourage use of these flags in the future by removing support & definition of them. The buflen < 4 check is also interesting, because no entropy would be returned. No callers passed such small buffers. ok miod sthen
* The DH_free, EC_KEY_free, EVP_PKEY_free and RSA_free functions all havejsing2014-06-071-13/+8
| | | | | implicit NULL checks, so there is no point ensuring that the pointer is non-NULL before calling them.
* Ensure that sess_cert is not NULL before trying to use it.jsing2014-06-051-0/+8
| | | | | | Fixes CVE-2014-3470, from OpenSSL. ok deraadt@
* ssl_sess_cert_new() can return NULL. Fix two cases where the return valuejsing2014-06-051-13/+12
| | | | | | | | | is unchecked, which would result in a later null pointer dereference. While here, RSA_free, DH_free and EC_KEY_free all have implicit NULL checks, so avoid repeating them here. ok beck@
* Be selective as to when ChangeCipherSpec messages will be accepted.jsing2014-06-051-1/+2
| | | | | | | | | | | | | | | | | Without this an early ChangeCipherSpec message would result in session keys being generated, along with the Finished hash for the handshake, using an empty master secret. For a detailed analysis see: https://www.imperialviolet.org/2014/06/05/earlyccs.html This is a fix for CVE-2014-0224, from OpenSSL. This issue was reported to OpenSSL by KIKUCHI Masashi. Unfortunately the recent OpenSSL commit was the first we were made aware of the issue. ok deraadt@ sthen@
* More KNF.jsing2014-06-051-49/+32
|
* without overthinking it, replace a few memcmp calls with CRYPTO_memcmptedu2014-06-041-2/+2
| | | | where it is feasible to do so. better safe than sorry.
* More manual OPENSSL_NO_EC and OPENSSL_NO_TLSEXT cleanup.jsing2014-05-311-4/+4
|
* TLS would not be entirely functional without extensions, so unifdefjsing2014-05-311-29/+0
| | | | | | OPENSSL_NO_TLSEXT. ok tedu@
* remove some #if 0 code. we don't need any more reminders that we're usingtedu2014-05-301-6/+0
| | | | a not quite appropriate data structure. ok jsing
* Make use of SSL_IS_DTLS, SSL_USE_EXPLICIT_IV, SSL_USE_SIGALGS andjsing2014-05-301-11/+8
| | | | | | SSL_USE_TLS1_2_CIPHERS. Largely based on OpenSSL head.