aboutsummaryrefslogtreecommitdiffstats
path: root/ssl
Commit message (Collapse)AuthorAgeFilesLines
* IRIX fixes.Andy Polyakov2016-05-101-0/+3
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Don't send signature algorithms when client_version is below TLS 1.2.David Benjamin2016-05-092-1/+7
| | | | | | | | | | | | | | | | | | | | Per RFC 5246, Note: this extension is not meaningful for TLS versions prior to 1.2. Clients MUST NOT offer it if they are offering prior versions. However, even if clients do offer it, the rules specified in [TLSEXT] require servers to ignore extensions they do not understand. Although second sentence would suggest that there would be no interop problems in always offering the extension, WebRTC has reported issues with Bouncy Castle on < TLS 1.2 ClientHellos that still include signature_algorithms. See also https://bugs.chromium.org/p/webrtc/issues/detail?id=4223 RT#4390 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>
* Free any existing SRTP connection profileMatt Caswell2016-05-091-0/+2
| | | | | | | | When setting a new SRTP connection profile using SSL_CTX_set_tlsext_use_srtp() or SSL_set_tlsext_use_srtp() we should free any existing profile first to avoid a memory leak. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* fix tab-space mixed indentationFdaSilvaYY2016-05-091-4/+4
| | | | | | | No code change Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Move 3DES from HIGH to MEDIUMRich Salz2016-05-051-14/+14
| | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* GH356: Change assert to normal errorSergio Garcia Murillo2016-05-051-2/+3
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Handle no async jobs in libsslMatt Caswell2016-05-051-47/+55
| | | | | | | | | | If the application has limited the size of the async pool using ASYNC_init_thread() then we could run out of jobs while trying to start a libssl io operation. However libssl was failing to handle this and treating it like a fatal error. It should not be fatal...we just need to retry when there are jobs available again. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Improve heartbeats coding styleMatt Caswell2016-05-051-18/+18
| | | | | | | | | Based on an orignal commit by GitHub user BertramScharpf. Rebased and updated to take account of all the updates since this was first raised. GH PR#62 Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove confusing comment.TJ Saunders2016-05-021-1/+0
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Issue #719:TJ Saunders2016-05-021-7/+22
| | | | | | | | | | | | | | If no serverinfo extension is found in some cases, do not abort the handshake, but simply omit/skip that extension. Check for already-registered serverinfo callbacks during serverinfo registration. Update SSL_CTX_use_serverinfo() documentation to mention the need to reload the same serverinfo per certificate, for servers with multiple server certificates. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* ssl/record/rec_layer_s3.c: fix typo from previous commit.Andy Polyakov2016-05-021-1/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove obsolete defined(__INTEL__) condition.Andy Polyakov2016-05-021-2/+1
| | | | | | This macro was defined by no-longer-supported __MWERKS__ compiler. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix building with -DCHARSET_EBCDICMatt Caswell2016-04-291-0/+1
| | | | | | | Building with -DCHARSET_EBCDIC and using --strict-warnings resulted in lots of miscellaneous errors. This fixes it. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Client side CKE processing can double free on errorMatt Caswell2016-04-291-2/+8
| | | | | | | | | The tls_client_key_exchange_post_work() frees the pms on error. It also calls ssl_generate_master_secret() which also free the pms. If an error occurs after ssl_generate_master_secret() has been called then a double free can occur. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add checks on CRYPTO_new_ex_data return valueFdaSilvaYY2016-04-282-4/+9
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/996)
* Fix an error code spelling.FdaSilvaYY2016-04-282-2/+2
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/952)
* various spelling fixesFdaSilvaYY2016-04-2812-24/+25
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/952)
* Don't leak memory on error path in dane_ctx_enable()Matt Caswell2016-04-281-0/+1
| | | | | | | The function dane_ctx_enable() allocated some memory that it did not free in an error path. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix no-gost no-srp no-ec no-dh.Ben Laurie2016-04-271-1/+4
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix enable-ssl-trace no-nextprotoneg.Ben Laurie2016-04-271-0/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* split_send_fragment should always be less than or equal to max_send_fragmentMatt Caswell2016-04-271-1/+1
| | | | | | | A bug meant that SSL_CTRL_SET_MAX_SEND_FRAGMENT was not adjusting split_send_fragment properly. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix BIO_CTRL_DUP for an SSL BIOMatt Caswell2016-04-271-4/+5
| | | | | | | The variables in the BIO weren't being duplicated properly. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Ensure we check i2d_X509 return valMatt Caswell2016-04-261-2/+7
| | | | | | | | | The i2d_X509() function can return a negative value on error. Therefore we should make sure we check it. Issue reported by Yuan Jochen Kang. Reviewed-by: Emilia Käsper <emilia@openssl.org>
* make updateViktor Dukhovni2016-04-221-52/+8
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Enabled DANE only when at least one TLSA RR was addedViktor Dukhovni2016-04-221-2/+14
| | | | | | | | | | | | | | | | It is up to the caller of SSL_dane_tlsa_add() to take appropriate action when no records are added successfully or adding some records triggers an internal error (negative return value). With this change the caller can continue with PKIX if desired when none of the TLSA records are usable, or take some appropriate action if DANE is required. Also fixed the internal ssl_dane_dup() function to properly initialize the TLSA RR stack in the target SSL handle. Errors in ssl_dane_dup() are no longer ignored. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Don't set peer_tmp until we have finished constructing itMatt Caswell2016-04-221-27/+36
| | | | | | | | | | | | If we fail halfway through constructing the peer_tmp EVP_PKEY but we have already stored it in s->s3->peer_tmp then if anything tries to use it then it will likely fail. This was causing s_client to core dump in the sslskewith0p test. s_client was trying to print out the connection parameters that it had negotiated so far. Arguably s_client should not do that if the connection has failed...but given it is existing functionality it's easier to fix libssl. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Fix no-ocsp on Windows (and probably VMS)Matt Caswell2016-04-211-0/+2
| | | | | | | | | The ocsp.h file did not have appropriate guards causing link failures on Windows. GH Issue 900 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove --classic build entirelyRichard Levitte2016-04-201-81/+0
| | | | | | | | The Unix build was the last to retain the classic build scheme. The new unified scheme has matured enough, even though some details may need polishing. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Rename some lowercase API'sRich Salz2016-04-181-2/+2
| | | | | | | | | Make OBJ_name_cmp internal Rename idea_xxx to IDEA_xxx Rename get_rfc_xxx to BN_get_rfc_xxx Rename v3_addr and v3_asid functions to X509v3_... Reviewed-by: Richard Levitte <levitte@openssl.org>
* Make many X509_xxx types opaque.Rich Salz2016-04-151-39/+56
| | | | | | | | | Make X509_OBJECT, X509_STORE_CTX, X509_STORE, X509_LOOKUP, and X509_LOOKUP_METHOD opaque. Remove unused X509_CERT_FILE_CTX Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Add SSL_SESSION_get0_hostname()Lyon Chen2016-04-141-0/+5
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove OPENSSL_NO_SHA guardsMatt Caswell2016-04-131-2/+0
| | | | | | no-sha is no longer an option so remove OPENSSL_NO_SHA guards. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove OPENSSL_NO_AES guardsMatt Caswell2016-04-131-2/+0
| | | | | | | no-aes is no longer a Configure option and therefore the OPENSSL_NO_AES guards can be removed. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Rename int_*() functions to *_int()Matt Caswell2016-04-133-7/+7
| | | | | | | | | | There is a preference for suffixes to indicate that a function is internal rather than prefixes. Note: the suffix is only required to disambiguate internal functions and public symbols with the same name (but different case) Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Rename lots of *_intern or *_internal function to int_*Matt Caswell2016-04-133-7/+7
| | | | | | | | There was a lot of naming inconsistency, so we try and standardise on one form. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Deprecate SSL_COMP_free_compression_methods() and make it a no-opMatt Caswell2016-04-133-6/+5
| | | | | | | | SSL_COMP_free_compression_methods() should not be called expicitly - we should leave auto-deinit to clean this up instead. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Deprecate ERR_free_strings() and make it a no-opMatt Caswell2016-04-131-5/+6
| | | | | | | | ERR_free_strings() should not be called expicitly - we should leave auto-deinit to clean this up instead. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add SSL_CTX_get_ciphers()Kazuki Yamaguchi2016-04-111-0/+9
| | | | | | | | | | | Add an accessor for SSL_CTX. Since libssl was made opaque, there is no way for users to access the cipher_list, while users can set the cipher_list by SSL_CTX_set_cipher_list(). Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove an unused functionMatt Caswell2016-04-112-15/+0
| | | | | | | | The function pqueue_print is not exported and is never called. Therefore we should delete it. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix the no-nextprotoneg optionMatt Caswell2016-04-111-0/+2
| | | | | | Misc fixes to get no-nextprotoneg config option working again. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make DH opaqueMatt Caswell2016-04-093-22/+50
| | | | | | | Move the dh_st structure into an internal header file and provide relevant accessors for the internal fields. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add SSL_DANE typedef for consistency.Rich Salz2016-04-082-9/+9
| | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Clean-up *_DEBUG options.Andy Polyakov2016-04-071-9/+1
| | | | | | | | | Since NDEBUG is defined unconditionally on command line for release builds, we can omit *_DEBUG options in favour of effective "all-on" in debug builds exercised though CI. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
* make updateViktor Dukhovni2016-04-071-6/+8
| | | | | Signed-off-by: Rob Percival <robpercival@google.com> Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Suppress CT callback as appropriateViktor Dukhovni2016-04-074-45/+115
| | | | | | | | | | | | | | | | | | | | | | Suppress CT callbacks with aNULL or PSK ciphersuites that involve no certificates. Ditto when the certificate chain is validated via DANE-TA(2) or DANE-EE(3) TLSA records. Also skip SCT processing when the chain is fails verification. Move and consolidate CT callbacks from libcrypto to libssl. We also simplify the interface to SSL_{,CTX_}_enable_ct() which can specify either a permissive mode that just collects information or a strict mode that requires at least one valid SCT or else asks to abort the connection. Simplified SCT processing and options in s_client(1) which now has just a simple pair of "-noct" vs. "-ct" options, the latter enables the permissive callback so that we can complete the handshake and report all relevant information. When printing SCTs, print the validation status if set and not valid. Signed-off-by: Rob Percival <robpercival@google.com> Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Fix client verify mode to check SSL_VERIFY_PEERViktor Dukhovni2016-04-071-1/+1
| | | | | | | | | | The original check for != SSL_VERIFY_NONE can give surprising results when flags SSL_VERIFY_PEER is not set, but other flags are. Note that SSL_VERIFY_NONE (0) is not a flag bit, it is rather the absense of all other flag bits. Signed-off-by: Rob Percival <robpercival@google.com> Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Fix memory leak on invalid CertificateRequest.David Benjamin2016-04-071-0/+2
| | | | | | | | | | | | | | Free up parsed X509_NAME structure if the CertificateRequest message contains excess data. The security impact is considered insignificant. This is a client side only leak and a large number of connections to malicious servers would be needed to have a significant impact. This was found by libFuzzer. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>
* Fix no-ocspMatt Caswell2016-04-062-6/+17
| | | | | | Misc fixes for no-ocsp Reviewed-by: Rich Salz <rsalz@openssl.org>
* New SSL test frameworkEmilia Kasper2016-04-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, SSL tests are configured via command-line switches to ssltest.c. This results in a lot of duplication between ssltest.c and apps, and a complex setup. ssltest.c is also simply old and needs maintenance. Instead, we already have a way to configure SSL servers and clients, so we leverage that. SSL tests can now be configured from a configuration file. Test servers and clients are configured using the standard ssl_conf module. Additional test settings are configured via a test configuration. Moreover, since the CONF language involves unnecessary boilerplate, the test conf itself is generated from a shorter Perl syntax. The generated testcase files are checked in to the repo to make it easier to verify that the intended test cases are in fact run; and to simplify debugging failures. To demonstrate the approach, min/max protocol tests are converted to the new format. This change also fixes MinProtocol and MaxProtocol handling. It was previously requested that an SSL_CTX have both the server and client flags set for these commands; this clearly can never work. Guide to this PR: - test/ssl_test.c - test framework - test/ssl_test_ctx.* - test configuration structure - test/handshake_helper.* - new SSL test handshaking code - test/ssl-tests/ - test configurations - test/generate_ssl_tests.pl - script for generating CONF-style test configurations from perl inputs Reviewed-by: Richard Levitte <levitte@openssl.org>
* Revert "various spelling fixes"Rich Salz2016-04-0412-25/+24
| | | | | | | This reverts commit 620d540bd47a96fb6905fbbdd8ea5167a8841a3e. It wasn't reviewed. Reviewed-by: Rich Salz <rsalz@openssl.org>