summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-07-09Prepare for 1.0.1p releaseOpenSSL_1_0_1pMatt Caswell
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-07-09Update CHANGES and NEWS for the new releaseMatt Caswell
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-07-07Fix alt chains bugMatt Caswell
This is a follow up to the alternate chains certificate forgery issue (CVE-2015-1793). That issue is exacerbated in 1.0.1 by a related bug which means that we *always* check for an alternative chain, even if we have already found a chain. The code is supposed to stop as soon as it has found one (and does do in master and 1.0.2). Reviewed-by: Stephen Henson <steve@openssl.org>
2015-07-07Reject calls to X509_verify_cert that have not been reinitialisedMatt Caswell
The function X509_verify_cert checks the value of |ctx->chain| at the beginning, and if it is NULL then it initialises it, along with the value of ctx->untrusted. The normal way to use X509_verify_cert() is to first call X509_STORE_CTX_init(); then set up various parameters etc; then call X509_verify_cert(); then check the results; and finally call X509_STORE_CTX_cleanup(). The initial call to X509_STORE_CTX_init() sets |ctx->chain| to NULL. The only place in the OpenSSL codebase where |ctx->chain| is set to anything other than a non NULL value is in X509_verify_cert itself. Therefore the only ways that |ctx->chain| could be non NULL on entry to X509_verify_cert is if one of the following occurs: 1) An application calls X509_verify_cert() twice without re-initialising in between. 2) An application reaches inside the X509_STORE_CTX structure and changes the value of |ctx->chain| directly. With regards to the second of these, we should discount this - it should not be supported to allow this. With regards to the first of these, the documentation is not exactly crystal clear, but the implication is that you must call X509_STORE_CTX_init() before each call to X509_verify_cert(). If you fail to do this then, at best, the results would be undefined. Calling X509_verify_cert() with |ctx->chain| set to a non NULL value is likely to have unexpected results, and could be dangerous. This commit changes the behaviour of X509_verify_cert() so that it causes an error if |ctx->chain| is anything other than NULL (because this indicates that we have not been initialised properly). It also clarifies the associated documentation. This is a follow up commit to CVE-2015-1793. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-07-07Add test for CVE-2015-1793Matt Caswell
This adds a test for CVE-2015-1793. This adds a new test file verify_extra_test.c, which could form the basis for additional verification tests. Reviewed-by: Stephen Henson <steve@openssl.org> Conflicts: test/Makefile
2015-07-07Fix alternate chains certificate forgery issueMatt Caswell
During certificate verfification, OpenSSL will attempt to find an alternative certificate chain if the first attempt to build such a chain fails. An error in the implementation of this logic can mean that an attacker could cause certain checks on untrusted certificates to be bypassed, such as the CA flag, enabling them to use a valid leaf certificate to act as a CA and "issue" an invalid certificate. This occurs where at least one cert is added to the first chain from the trust store, but that chain still ends up being untrusted. In that case ctx->last_untrusted is decremented in error. Patch provided by the BoringSSL project. CVE-2015-1793 Reviewed-by: Stephen Henson <steve@openssl.org>
2015-07-06Relax CCM tag check.Dr. Stephen Henson
In CCM mode don't require a tag before initialising decrypt: this allows the tag length to be set without requiring the tag. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 9cca7be11d62298b2af0722f94345012c86eaed4)
2015-07-06document -2 return valueDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 5727582cf51e98e5e0faa435e7da2c8929533c0d)
2015-07-02Fix PSK handling.Dr. Stephen Henson
The PSK identity hint should be stored in the SSL_SESSION structure and not in the parent context (which will overwrite values used by other SSL structures with the same SSL_CTX). Use BUF_strndup when copying identity as it may not be null terminated. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 3c66a669dfc7b3792f7af0758ea26fe8502ce70c)
2015-06-29Check for errors with SRPDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 5fced2395ddfb603a50fd1bd87411e603a59dc6f)
2015-06-25Don't output bogus errors in PKCS12_parseDr. Stephen Henson
PR#3923 Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit ffbf304d4832bd51bb0618f8ca5b7c26647ee664)
2015-06-22RT3907-fixRich Salz
Typo in local variable name; introduced by previous fix. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit cc3f3fc2b1c94d65824ab8d69595b6d89b17cf8d)
2015-06-22RT3907: avoid "local" in testssl scriptRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 75ba5c58c6b3b3326a6c3198100830afa120e7c3)
2015-06-21Cleanup mttest.c : because we no longer use stdio here, don't include itRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 8ca96efd24b73f917837fdd45b1c22d7b8ff8cbd)
2015-06-21Add -ldl to the build of mttest.cRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit d62c98c81c7b47b7b1878fd7e91e5fd33818faf0)
2015-06-21Cleanup mttest.c : do not try to output reference counts when threads are doneRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 964626957f79e07ed97756527cdc7e84007c60c9)
2015-06-21Cleanup mttest.c : better error reporting when certs are missingRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 7a1789d254c561bd3024c971b5cfeeedd12d63f3)
2015-06-21Cleanup mttest.c : make ssl_method a pointer to constRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit f4c73bfe0ab7a0e8f82fe2947c0f77fe3d98acab) Conflicts: crypto/threads/mttest.c
2015-06-21Cleanup mttest.c : more output changesRichard Levitte
More fprintf()s and printf()s to turn into BIO calls. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-21Cleanup mttest.c : modernise outputRichard Levitte
Construct bio_err and bio_stdout from file handles instead of FILE pointers, since the latter might not be implemented (when OPENSSL_NO_STDIO is defined). Convert all output to use BIO_printf. Change lh_foo to lh_SSL_SESSION_foo. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit bb8abd6735e198de36c1eb9098a7f1516d156220) Conflicts: crypto/threads/mttest.c
2015-06-21Cleanup mttest.c : modernise the threads setupRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 5c78e1835285ce4acdc7cc4f4c06aa7d6661c9b4) Conflicts: crypto/threads/mttest.c
2015-06-21Cleanup mttest.c : remove MS_CALLBACKRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit a3f9286556d6d78c1800caae97a9328afb2557e6)
2015-06-21RT1688: Add dependencies for parallel makeRich Salz
Backport to 1.0.1 and 1.0.2 to fix RT 3905 Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 8e6bb99979b95ee8b878e22e043ceb78d79c32a1)
2015-06-16Make preprocessor error into real preprocessor errorRichard Levitte
Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit b4f0d1a4a89b964dba80036a6348ca0a1913c526)
2015-06-16Remove one extraneous parenthesisRichard Levitte
Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit 30cf91784bfde82622f79d87d17d20ce73329532)
2015-06-12Prepare for 1.0.1p-devMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-12Prepare for 1.0.1o releaseOpenSSL_1_0_1oMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-12Updated CHANGES and NEWS entries for new releaseMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-12Allow a zero length extension blockAdam Langley
It is valid for an extension block to be present in a ClientHello, but to be of zero length. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-12Fix ABI break with HMACMatt Caswell
Recent HMAC changes broke ABI compatibility due to a new field in HMAC_CTX. This backs that change out, and does it a different way. Thanks to Timo Teras for the concept. Conflicts: crypto/hmac/hmac.c Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-11Prepare for 1.0.1o-devMatt Caswell
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-06-11Prepare for 1.0.1n releaseOpenSSL_1_0_1nMatt Caswell
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-06-11bn/bn_gf2m.c: avoid infinite loop wich malformed ECParamters.Andy Polyakov
CVE-2015-1788 Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 4924b37ee01f71ae19c94a8934b80eeb2f677932)
2015-06-11Update CHANGES and NEWSMatt Caswell
Updates to CHANGES and NEWS to take account of the latest security fixes. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-11PKCS#7: Fix NULL dereference with missing EncryptedContent.Emilia Kasper
CVE-2015-1790 Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-11Fix length checks in X509_cmp_time to avoid out-of-bounds reads.Emilia Kasper
Also tighten X509_cmp_time to reject more than three fractional seconds in the time; and to reject trailing garbage after the offset. CVE-2015-1789 Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-11Fix infinite loop in CMSDr. Stephen Henson
Fix loop in do_free_upto if cmsbio is NULL: this will happen when attempting to verify and a digest is not recognised. Reported by Johannes Bauer. CVE-2015-1792 Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-11Correction of make depend merge errorRichard Levitte
$(PROGS) was mistakenly removed, adding it back. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 5ef5b9ffa91ad6061c42291564a1dc786300ebdd)
2015-06-11More ssl_session_dup fixesMatt Caswell
Fix error handling in ssl_session_dup, as well as incorrect setting up of the session ticket. Follow on from CVE-2015-1791. Thanks to LibreSSL project for reporting these issues. Conflicts: ssl/ssl_sess.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-06-11Only allow a temporary rsa key exchange when they key is larger than 512.Kurt Roeckx
Reviewed-by: Rich Salz <rsalz@openssl.org> MR #838 (cherry picked from commit 57e477b9ec66542afc8c9c13ae7c4271209fb88f)
2015-06-11Properly check certificate in case of export ciphers.Kurt Roeckx
Reviewed-by: Rich Salz <rsalz@openssl.org> MR #838 (cherry picked from commit 39a298a1c0e7a76e301b9f2ebe8d33d90ad0a3b4)
2015-06-10DTLS handshake message fragments musn't span packetsMatt Caswell
It should not be possible for DTLS message fragments to span multiple packets. However previously if the message header fitted exactly into one packet, and the fragment body was in the next packet then this would work. Obviously this would fail if packets get re-ordered mid-flight. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-06-10Fix leak in HMAC error pathMatt Caswell
In the event of an error in the HMAC function, leaks can occur because the HMAC_CTX does not get cleaned up. Thanks to the BoringSSL project for reporting this issue. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit e43a13c807e42688c72c4f3d001112bf0a110464)
2015-06-10EC_POINT_is_on_curve does not return a booleanMatt Caswell
The function EC_POINT_is_on_curve does not return a boolean value. It returns 1 if the point is on the curve, 0 if it is not, and -1 on error. Many usages within OpenSSL were incorrectly using this function and therefore not correctly handling error conditions. With thanks to the Open Crypto Audit Project for reporting this issue. Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit 68886be7e2cd395a759fcd41d2cede461b68843d)
2015-06-10Tighten extension handlingMatt Caswell
This adds additional checks to the processing of extensions in a ClientHello to ensure that either no extensions are present, or if they are then they take up the exact amount of space expected. With thanks to the Open Crypto Audit Project for reporting this issue. Reviewed-by: Stephen Henson <steve@openssl.org> Conflicts: ssl/t1_lib.c
2015-06-10Fix memory leaks in BIO_dup_chain()Matt Caswell
This fixes a memory leak that can occur whilst duplicating a BIO chain if the call to CRYPTO_dup_ex_data() fails. It also fixes a second memory leak where if a failure occurs after successfully creating the first BIO in the chain, then the beginning of the new chain was not freed. With thanks to the Open Crypto Audit Project for reporting this issue. Reviewed-by: Stephen Henson <steve@openssl.org> Conflicts: crypto/bio/bio_lib.c
2015-06-10Replace memset with OPENSSL_cleanse()Matt Caswell
BUF_MEM_free() attempts to cleanse memory using memset immediately prior to a free. This is at risk of being optimised away by the compiler, so replace with a call to OPENSSL_cleanse() instead. With thanks to the Open Crypto Audit Project for reporting this issue. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-06-10Fix Kerberos issue in ssl_session_dupMatt Caswell
The fix for CVE-2015-1791 introduced an error in ssl_session_dup for Kerberos. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit dcad51bc13c9b716d9a66248bcc4038c071ff158)
2015-06-10When making libcrypto from apps or test, make sure to include enginesRichard Levitte
For librypto to be complete, the stuff in both crypto/ and engines/ have to be built. Doing 'make test' or 'make apps' from a clean source tree failed to do so. Corrected by using the new 'build_libcrypto' in the top Makefile. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit acaff3b797f50a0a0e17a0be45b7fafad962004e)
2015-06-10Add and rearrange building of librariesRichard Levitte
There's a need for a target that will build all of libcrypto, so let's add 'build_libcrypto' that does this. For ortogonality, let's also add 'build_libssl'. Have both also depend on 'libcrypto.pc' and 'libssl.pc' so those get built together with the libraries. This makes 'all' depend on fewer things directly. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 177b5f9c82e1152d6ce20a83556db629697fff65) Conflicts: Makefile.org