summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-04-20Fix misc NULL derefs in sureware engineMatt Caswell
Fix miscellaneous NULL pointer derefs in the sureware engine. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 7b611e5fe8eaac9512f72094c460f3ed6040076a)
2015-04-18Fix encoding bug in i2c_ASN1_INTEGERDr. Stephen Henson
Fix bug where i2c_ASN1_INTEGER mishandles zero if it is marked as negative. Thanks to Huzaifa Sidhpurwala <huzaifas@redhat.com> and Hanno Böck <hanno@hboeck.de> for reporting this issue. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit a0eed48d37a4b7beea0c966caf09ad46f4a92a44)
2015-04-17Error out immediately on empty ciphers list.Emilia Kasper
A 0-length ciphers list is never permitted. The old code only used to reject an empty ciphers list for connections with a session ID. It would later error out on a NULL structure, so this change just moves the alert closer to the problem source. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 3ae91cfb327c9ed689b9aaf7bca01a3f5a0657cb)
2015-04-16Code style: space after 'if'Viktor Dukhovni
Reviewed-by: Matt Caswell <gitlab@openssl.org>
2015-04-16Please Clang's sanitizer, addendum.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-16Limit depth of nested sequences when generating ASN.1Dr. Stephen Henson
Reported by Hanno Böck <hanno@hboeck.de> PR#3800 Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit c4137b5e828d8fab0b244defb79257619dad8fc7)
2015-04-16Reject empty generation strings.Dr. Stephen Henson
Reported by Hanno Böck <hanno@hboeck.de> Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 111b60bea01d234b5873488c19ff2b9c5d4d58e9)
2015-04-14Fix ssl_get_prev_session overrunMatt Caswell
If OpenSSL is configured with no-tlsext then ssl_get_prev_session can read past the end of the ClientHello message if the session_id length in the ClientHello is invalid. This should not cause any security issues since the underlying buffer is 16k in size. It should never be possible to overrun by that many bytes. This is probably made redundant by the previous commit - but you can never be too careful. With thanks to Qinghao Tang for reporting this issue. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 5e0a80c1c9b2b06c2d203ad89778ce1b98e0b5ad)
2015-04-14Check for ClientHello message overrunsMatt Caswell
The ClientHello processing is insufficiently rigorous in its checks to make sure that we don't read past the end of the message. This does not have security implications due to the size of the underlying buffer - but still needs to be fixed. With thanks to Qinghao Tang for reporting this issue. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit c9642eb1ff79a30e2c7632ef8267cc34cc2b0d79)
2015-04-11do_dirname: Don't change gen on failuresKurt Roeckx
It would set gen->d.dirn to a freed pointer in case X509V3_NAME_from_section failed. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 8ec5c5dd361343d9017eff8547b19e86e4944ebc)
2015-04-11X509_VERIFY_PARAM_free: Check param for NULLKurt Roeckx
Reviewed-by: Viktor Dukhovni <openssl-users@dukhovni.org> (cherry picked from commit f49baeff50d0be9c8d86aed6fb4a08841aa3da41)
2015-04-10Don't set *pval to NULL in ASN1_item_ex_new.Dr. Stephen Henson
While *pval is usually a pointer in rare circumstances it can be a long value. One some platforms (e.g. WIN64) where sizeof(long) < sizeof(ASN1_VALUE *) this will write past the field. *pval is initialised correctly in the rest of ASN1_item_ex_new so setting it to NULL is unecessary anyway. Thanks to Julien Kauffmann for reporting this issue. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit f617b4969a9261b9d7d381670aefbe2cf766a2cb) Conflicts: crypto/asn1/tasn_new.c
2015-04-08Have mkerr.pl treat already existing multiline string defs properlyRichard Levitte
Since source reformat, we ended up with some error reason string definitions that spanned two lines. That in itself is fine, but we sometimes edited them to provide better strings than what could be automatically determined from the reason macro, for example: {ERR_REASON(SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER), "Peer haven't sent GOST certificate, required for selected ciphersuite"}, However, mkerr.pl didn't treat those two-line definitions right, and they ended up being retranslated to whatever the macro name would indicate, for example: {ERR_REASON(SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER), "No gost certificate sent by peer"}, Clearly not what we wanted. This change fixes this problem. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 2cfdfe0918f03f8323c9523a2beb2b363ae86ca7)
2015-04-08Ignore the non-dll windows specific build directoriesRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 37d92b1b2bb6e6e04d62d6f7774a2d8190a99174)
2015-04-08Harden SSLv2-supporting servers against Bleichenbacher's attack.Emilia Kasper
There is no indication that the timing differences are exploitable in OpenSSL, and indeed there is some indication (Usenix '14) that they are too small to be exploitable. Nevertheless, be careful and apply the same countermeasures as in s3_srvr.c Thanks to Nimrod Aviram, Sebastian Schinzel and Yuval Shavitt for reporting this issue. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit ae50d8270026edf5b3c7f8aaa0c6677462b33d97)
2015-04-07Fix intermittent s_server issues with ECDHEJohn Foley
Resolve a problem when using s_server with ECDHE cipher suites in OpenSSL_1_0_1-stable. Due to an uninitialized variable, SSL_CTX_set_tmp_ecdh() is not always invoked within s_server. This bug appears to have been introduced by 059907771b89549cbd07a81df1a5bdf51e062066. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-03-31Ensure EC private keys retain leading zerosDouglas E Engert
RFC5915 requires the use of the I2OSP primitive as defined in RFC3447 for storing an EC Private Key. This converts the private key into an OCTETSTRING and retains any leading zeros. This commit ensures that those leading zeros are present if required. Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 30cd4ff294252c4b6a4b69cbef6a5b4117705d22) Conflicts: crypto/ec/ec_asn1.c
2015-03-25Fix uninitialized variable warningEmilia Kasper
While a true positive, it's almost harmless because EVP_DecryptInit_ex would have to fail and that doesn't happen under normal operation. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25Fix bug in s_client. Previously default verify locations would only be loadedMatt Caswell
if CAfile or CApath were also supplied and successfully loaded first. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 70e5fd877890489a3972bf8bf50bfec1fca3875e)
2015-03-25Fix HMAC to pass invalid key len testMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25Add HMAC test for invalid key lenMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25Ensure that both the MD and key have been initialised before attempting toMatt Caswell
create an HMAC Inspired by BoringSSL commit 2fe7f2d0d9a6fcc75b4e594eeec306cc55acd594 Reviewed-by: Richard Levitte <levitte@openssl.org> Conflicts: crypto/hmac/hmac.c
2015-03-25Add more HMAC testsMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25Fix RAND_(pseudo_)?_bytes returnsMatt Caswell
Ensure all calls to RAND_bytes and RAND_pseudo_bytes have their return value checked correctly Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 8f8e4e4f5253085ab673bb74094c3e492c56af44) Conflicts: crypto/evp/e_des3.c
2015-03-24Don't send a for ServerKeyExchange for kDHr and kDHdKurt Roeckx
The certificate already contains the DH parameters in that case. ssl3_send_server_key_exchange() would fail in that case anyway. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 93f1c13619c5b41f2dcfdbf6ae666f867922a87a)
2015-03-24Configuration file examples.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 7b68c30da01b4eedcd546f81844156646387cacb)
2015-03-24Make OCSP response verification more flexible.Dr. Stephen Henson
If a set of certificates is supplied to OCSP_basic_verify use those in addition to any present in the OCSP response as untrusted CAs when verifying a certificate chain. PR#3668 Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 4ca5efc2874e094d6382b30416824eda6dde52fe)
2015-03-24Fix malloc define typoMike Frysinger
Fix compilation failure when SCTP is compiled due to incorrect define. Reported-by: Conrad Kostecki <ck+gentoobugzilla@bl4ckb0x.de> URL: https://bugs.gentoo.org/543828 RT#3758 Signed-off-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 7c82e339a677f8546e1456c7a8f6788598a9de43)
2015-03-19Prepare for 1.0.1n-devMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19Prepare for 1.0.1m releaseOpenSSL_1_0_1mMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19make updateMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19Fix unsigned/signed warningsMatt Caswell
Fix some unsigned/signed warnings introduced as part of the fix for CVE-2015-0293 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19Fix a failure to NULL a pointer freed on error.Matt Caswell
Reported by the LibreSSL project as a follow on to CVE-2015-0209 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19Update NEWS fileMatt Caswell
Update the NEWS file with the latest entries from CHANGES ready for the release. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19Update CHANGES for releaseMatt Caswell
Update CHANGES fiel with all the latest fixes ready for the release. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19Remove overlapping CHANGES/NEWS entriesMatt Caswell
Remove entries from CHANGES and NEWS from letter releases that occur *after* the next point release. Without this we get duplicate entries for the same issue appearing multiple times. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19Fix reachable assert in SSLv2 servers.Emilia Kasper
This assert is reachable for servers that support SSLv2 and export ciphers. Therefore, such servers can be DoSed by sending a specially crafted SSLv2 CLIENT-MASTER-KEY. Also fix s2_srvr.c to error out early if the key lengths are malformed. These lengths are sent unencrypted, so this does not introduce an oracle. CVE-2015-0293 This issue was discovered by Sean Burford (Google) and Emilia Käsper of the OpenSSL development team. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-03-19PKCS#7: avoid NULL pointer dereferences with missing contentEmilia Kasper
In PKCS#7, the ASN.1 content component is optional. This typically applies to inner content (detached signatures), however we must also handle unexpected missing outer content correctly. This patch only addresses functions reachable from parsing, decryption and verification, and functions otherwise associated with reading potentially untrusted data. Correcting all low-level API calls requires further work. CVE-2015-0289 Thanks to Michal Zalewski (Google) for reporting this issue. Reviewed-by: Steve Henson <steve@openssl.org>
2015-03-19Fix ASN1_TYPE_cmpDr. Stephen Henson
Fix segmentation violation when ASN1_TYPE_cmp is passed a boolean type. This can be triggered during certificate verification so could be a DoS attack against a client or a server enabling client authentication. CVE-2015-0286 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-18Free up ADB and CHOICE if already initialised.Dr. Stephen Henson
CVE-2015-0287 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-03-17Dead code removal from appsMatt Caswell
Some miscellaneous removal of dead code from apps. Also fix an issue with error handling with pkcs7. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 11abf92259e899f4f7da4a3e80781e84b0fb1a64)
2015-03-17Remove dead code from cryptoMatt Caswell
Some miscellaneous removal of dead code from lib crypto. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit b7573c597c1932ef709b2455ffab47348b5c54e5)
2015-03-17Fix seg fault in s_timeMatt Caswell
Passing a negative value for the "-time" option to s_time results in a seg fault. This commit fixes it so that time has to be greater than 0. Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit dfef52f6f277327e118fdd0fe34486852c2789b6)
2015-03-17Add sanity check to PRFMatt Caswell
The function tls1_PRF counts the number of digests in use and partitions security evenly between them. There always needs to be at least one digest in use, otherwise this is an internal error. Add a sanity check for this. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 668f6f08c62177ab5893fc26ebb67053aafdffc8)
2015-03-17Fix memset call in stack.cMatt Caswell
The function sk_zero is supposed to zero the elements held within a stack. It uses memset to do this. However it calculates the size of each element as being sizeof(char **) instead of sizeof(char *). This probably doesn't make much practical difference in most cases, but isn't a portable assumption. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 7132ac830fa08d9a936e011d7c541b0c52115b33)
2015-03-17Move malloc fail checks closer to mallocMatt Caswell
Move memory allocation failure checks closer to the site of the malloc in dgst app. Only a problem if the debug flag is set...but still should be fixed. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit be1477adc97e76f4b83ed8075589f529069bd5d1)
2015-03-17Add malloc failure checksMatt Caswell
Add some missing checks for memory allocation failures in ca app. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit a561bfe944c0beba73551731cb98af70dfee3549)
2015-03-14Avoid reading an unused byte after the bufferAndy Polyakov
Other curves don't have this problem. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 9fbbdd73c58c29dc46cc314f7165e45e6d43fd60)
2015-03-13Fix undefined behaviour in shifts.Emilia Kasper
Td4 and Te4 are arrays of u8. A u8 << int promotes the u8 to an int first then shifts. If the mathematical result of a shift (as modelled by lhs * 2^{rhs}) is not representable in an integer, behaviour is undefined. In other words, you can't shift into the sign bit of a signed integer. Fix this by casting to u32 whenever we're shifting left by 24. (For consistency, cast other shifts, too.) Caught by -fsanitize=shift Submitted by Nick Lewycky (Google) Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 8b37e5c14f0eddb10c7f91ef91004622d90ef361)
2015-03-12additional configuration documentationDr. Stephen Henson
Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 3d764db7a24e3dca1a3ee57202ce3c818d592141)