summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-12-17Revert "RT3425: constant-time evp_enc"Emilia Kasper
Causes more problems than it fixes: even though error codes are not part of the stable API, several users rely on the specific error code, and the change breaks them. Conversely, we don't have any concrete use-cases for constant-time behaviour here. This reverts commit f2df488a1c7402e48c21c83e937955dfe9f40bee. Reviewed-by: Andy Polyakov <appro@openssl.org>
2014-12-17Build fixesEmilia Kasper
Various build fixes, mostly uncovered by clang's unused-const-variable and unused-function errors. Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit 0e1c318ece3c82e96ae95a34a1badf58198d6b28)
2014-12-17Clear warnings/errors within RL_DEBUG code sections (RL_DEBUG should be renamed)Richard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 8bc8450a26329e3c890df60026f969e7caabff3d)
2014-12-17Clear warnings/errors within TLS_DEBUG code sectionsRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit bf68456f538cacc9dcfd00986962aef0e8538289)
2014-12-17Clear warnings/errors within KSSL_DEBUG code sectionsRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 53332a75d16a5bb3b9d90c15fcf38d2e87160a52)
2014-12-17Clear warnings/errors within CIPHER_DEBUG code sectionsRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit cd387d21daa939862e081f00be0a98dbc5a85351)
2014-12-17Clear warnings/errors within CIPHER_DEBUG code sectionsRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 0c403e80a9952c83a38eab3c8a4ce42e17a2cee0)
2014-12-17Clear warnings/errors within BN_CTX_DEBUG code sectionsRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 553affbef7bb5dd313514e06dab5cd9b1de1835f)
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-17Backport regression testBodo Möller
master branch has a specific regression test for a bug in x86_64-mont5 code, see commit cdfe0fdde6a966bdb0447de66aa04a85d99a0551. This code is now in 1.0.2/1.0.1, so also backport the test. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit bb565cd29e34caeeaf12ecfdbe6273c2c794f5a2)
2014-12-17Check for invalid divisors in BN_div.Emilia Kasper
Invalid zero-padding in the divisor could cause a division by 0. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit a43bcd9e96c5180e5c6c82164ece643c0097485e)
2014-12-16Add OPENSSL_NO_ECDH guardsMatt Caswell
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-12-16Remove extraneous white space, and add some bracesMatt Caswell
Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 55e530265a7ea8f264717a4e37338cc04eca2007)
2014-12-16DTLS fixes for signed/unsigned issuesMatt Caswell
Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 1904d21123849a65dafde1705e6dd5b7c2f420eb)
2014-12-15Checkout return value of dtls1_output_cert_chainMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-15Check return value of ssl3_output_cert_chainMatt Caswell
Based on commit 66f96fe2d519147097c118d4bf60704c69ed0635 by Steve Henson Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-15Fix unused variable warningEmilia Kasper
The temporary variable causes unused variable warnings in opt mode with clang, because the subsequent assert is compiled out. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 6af16ec5eed85390bcbd004806a842d6153d6a31)
2014-12-13Fix memory leak in s2_srvr.c if BUF_MEM_grow failsMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit d04a1e0b5beb3329cdf8c4ec35b9113cbc41d2f2)
2014-12-13Fixed memory leak if BUF_MEM_grow failsMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit bb1ddd3d9a0d01656b90693a214b911995a5fe8c)
2014-12-12Fix use of NULL memory pointer in X509_VERIFY_PARAM_new in the event of aMatt Caswell
malloc failure. Reviewed-by: Kurt Roeckx <kurt@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-12-08Fix memory leak in SSL_new if errors occur.Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 76e6509085ea96df0ca542568ee2596343711307)
2014-12-05Reject elliptic curve lists of odd lengths.Emilia Kasper
The Supported Elliptic Curves extension contains a vector of NamedCurves of 2 bytes each, so the total length must be even. Accepting odd-length lists was observed to lead to a non-exploitable one-byte out-of-bounds read in the latest development branches (1.0.2 and master). Released versions of OpenSSL are not affected. Thanks to Felix Groebert of the Google Security Team for reporting this issue. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 33d5ba862939ff8db70a9e36fc9a326fab3e8d98)
2014-12-04Remove incorrect code inadvertently introduced through commit 59669b6ab.Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> Conflicts: ssl/d1_lib.c
2014-12-03Remove "#if 0" codeMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 4bb8eb9ce4f794fecf020a15b54e8505fced0edf)
2014-12-03Only use the fallback mtu after 2 unsuccessful retransmissions if it is lessMatt Caswell
than the mtu we are already using Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 047f21593eebbc617a410a208ded01e65ca11028)
2014-12-03Updates to s_client and s_server to remove the constant 28 (for IPv4 headerMatt Caswell
and UDP header) when setting an mtu. This constant is not always correct (e.g. if using IPv6). Use the new DTLS_CTRL functions instead. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 464ce92026bd0c79186cbefa75470f39607110be)
2014-12-03If we really get a situation where the underlying mtu is less than the minimumMatt Caswell
we will support then dtls1_do_write can go into an infinite loop. This commit fixes that. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit d3d9eef31661633f5b003a9e115c1822f79d1870)
2014-12-03Fix dtls_query_mtu so that it will always either complete with an mtu that isMatt Caswell
at least the minimum or it will fail. There were some instances in dtls1_query_mtu where the final mtu can end up being less than the minimum, i.e. where the user has set an mtu manually. This shouldn't be allowed. Also remove dtls1_guess_mtu that, despite having logic for guessing an mtu, was actually only ever used to work out the minimum mtu to use. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 1620a2e49c777f31f2ce57966ae74006b48ad759)
2014-12-03Remove instances in libssl of the constant 28 (for size of IPv4 header + UDP)Matt Caswell
and instead use the value provided by the underlying BIO. Also provide some new DTLS_CTRLs so that the library user can set the mtu without needing to know this constant. These new DTLS_CTRLs provide the capability to set the link level mtu to be used (i.e. including this IP/UDP overhead). The previous DTLS_CTRLs required the library user to subtract this overhead first. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 59669b6abf620d1ed2ef4d1e2df25c998b89b64d) Conflicts: ssl/d1_both.c ssl/ssl_lib.c
2014-12-03There are a number of instances throughout the code where the constant 28 isMatt Caswell
used with no explanation. Some of this was introduced as part of RT#1929. The value 28 is the length of the IP header (20 bytes) plus the UDP header (8 bytes). However use of this constant is incorrect because there may be instances where a different value is needed, e.g. an IPv4 header is 20 bytes but an IPv6 header is 40. Similarly you may not be using UDP (e.g. SCTP). This commit introduces a new BIO_CTRL that provides the value to be used for this mtu "overhead". It will be used by subsequent commits. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 0d3ae34df573f477b6b1aaf614d52dcdfcff5fce) Conflicts: crypto/bio/bss_dgram.c
2014-12-03The first call to query the mtu in dtls1_do_write correctly checks that theMatt Caswell
mtu that we have received is not less than the minimum. If its less it uses the minimum instead. The second call to query the mtu does not do that, but instead uses whatever comes back. We have seen an instance in RT#3592 where we have got an unreasonably small mtu come back. This commit makes both query checks consistent. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 6abb0d1f8e702a0daa9c32b8021d01eda0483018)
2014-12-03The SSL_OP_NO_QUERY_MTU option is supposed to stop the mtu from beingMatt Caswell
automatically updated, and we should use the one provided instead. Unfortunately there are a couple of locations where this is not respected. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 001235778a6e9c645dc0507cad6092d99c9af8f5)
2014-12-03Verify that we have a sensible message len and fail if notMatt Caswell
RT#3592 provides an instance where the OPENSSL_assert that this commit replaces can be hit. I was able to recreate this issue by forcing the underlying BIO to misbehave and come back with very small mtu values. This happens the second time around the while loop after we have detected that the MTU has been exceeded following the call to dtls1_write_bytes. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit cf75017bfd60333ff65edf9840001cd2c49870a3)
2014-12-02Use the SSLv23 method by defaultKurt Roeckx
If SSLv2 and SSLv3 are both disabled we still support SSL/TLS. Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-11-28Check for FindNextFile when defining it rather than FindFirstFileRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org>
2014-11-28[PR3597] Advance to the next state variant when reusing messages.Richard Levitte
Previously, state variant was not advanced, which resulted in state being stuck in the st1 variant (usually "_A"). This broke certificate callback retry logic when accepting connections that were using SSLv2 ClientHello (hence reusing the message), because their state never advanced to SSL3_ST_SR_CLNT_HELLO_C variant required for the retry code path. Reported by Yichun Zhang (agentzh). Signed-off-by: Piotr Sikora <piotr@cloudflare.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2014-11-28Correct some layout issues, convert all remaining tabs to appropriate ↵Richard Levitte
amounts of spaces. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 8123d158ab6f0a6a468748c133e33c2063ff36b5)
2014-11-28Improves the proxy certificates howto doc.Alok Menghrajani
The current documentation contains a bunch of spelling and grammar mistakes. I also found it hard to understand some paragraphs, so here is my attempt to improve its readability. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 03b637a730e4a298c360cc143de7564060c06324)
2014-11-27Fixed warning in ssl2_encMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-11-27Check EVP_Cipher return values for SSL2Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-11-27Add checks to the return value of EVP_Cipher to prevent silent encryption ↵Matt Caswell
failure. PR#1767 Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-11-27Remove redundant checks in ssl_cert_dup. This was causing spurious error ↵Matt Caswell
messages when using GOST PR#3613 Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit fc3968a25ce0c16cab8730ec0d68a59856158029)
2014-11-27Remove duplicated codeMatt Caswell
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2014-11-27Tidy up ocsp help outputMatt Caswell
Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit 5e31a40f47c6bfd09c718d2af42ba8d8fe6bb932) Conflicts: apps/ocsp.c (cherry picked from commit e16458269036f4334525009906d346f68a73b2a4)
2014-11-27Add documentation on -timeout option in the ocsp utilityAndré Guerreiro
PR#3612 Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit de87dd46c1283f899a9ecf4ccc72db74f36afbf2) (cherry picked from commit 4d3df37bc7fd33d0bec5da04d2572caa0cdbab75)
2014-11-27NetWare compilation fix.Guenter
Workaround for NetWare CodeWarrior compiler which doesn't properly lookup includes when in same directory as the C file which includes it. PR#3569 Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 333fad9f2de1dea99552fcb424b312ca1a390f85)
2014-11-27Updates to X509_NAME_get_index_by_NID.pod submitted by user Bernardh via the ↵Matt Caswell
wiki Minor changes made by Matt Caswell Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit 648495864513da788246f9b75dbbbce0614ed5e8)
2014-11-27Updates to X509_NAME_add_entry_by_txt.pod submitted by user Bernardh via the ↵Matt Caswell
wiki Minor changes made by Matt Caswell. Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit f281b8df704ce0123fa2193f2890a25da1756528)
2014-11-27Updates to EVP_PKEY_encrypt.pod submitted by user Bernardh via the wikiMatt Caswell
Minor changes made by Matt Caswell. Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit 34890ac18eb5ee7bffe9d460480164e1546b491e)