summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-11-10Prepare for 1.1.0c releaseOpenSSL_1_1_0cMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-11-10Update CHANGES and NEWSMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-11-10Fix the no-tls optionMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-11-10Fix no-cms (CVE-2016-7053)Richard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-11-10test/evptests.txt: add negative tests for AEAD ciphers.Andy Polyakov
This is done by taking one vector, "corrupting" last bit of the tag value and verifying that decrypt fails. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-11-10test: add TLS application data corruption test.Andy Polyakov
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-11-10add test for CVE-2016-7053Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-11-10Don't set choice selector on parse failure.Dr. Stephen Henson
Don't set choice selector on parse failure: this can pass unexpected values to the choice callback. Instead free up partial structure directly. CVE-2016-7053 Thanks to Tyler Nighswander of ForAllSecure for reporting this issue. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-11-10chacha20/poly1305: make sure to clear the buffer at correct positionRichard Levitte
The offset to the memory to clear was incorrect, causing a heap buffer overflow. CVE-2016-7054 Thanks to Robert Święcki for reporting this Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit b8e4011fb26364e44230946b87ab38cc1c719aae)
2016-11-10aes/asm/aesp8-ppc.pl: improve [backward] portability.Andy Polyakov
Some of stone-age assembler can't cope with r0 in address. It's actually sensible thing to do, because r0 is shunted to 0 in address arithmetic and by refusing r0 assembler effectively makes you understand that. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit a54aba531327285f64cf13a909bc129e9f9d5970)
2016-11-10bn/asm/x86_64-mont.pl: fix for CVE-2016-7055 (Low severity).Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 2fac86d9abeaa643677d1ffd0a139239fdf9406a)
2016-11-10test/bntest.c: regression test for CVE-2016-7055.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit dca2e0ee1745ed2d9cba8c29f334f881a58f85dc)
2016-11-10Fix the evp_test Ctrl keyword processingRichard Levitte
Skip the test if the value after ":" is a disabled algorithm, rather than failing it Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit dfbdf4abb7c62156f36925db95728142c4223225)
2016-11-10Fix no-dso (shlibloadtest)Richard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 586b79d8884b171eb3fae1ef230572921715ce1a)
2016-11-09When no SRP identity is found, no error was reported server sideEasySec
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1859) (cherry picked from commit 7bb37cb5938a0cf76c12c8421950e72634d5f61c)
2016-11-09Unix Makefile: Make sure to use $(PERL) when running ./ConfigureRichard Levitte
For consistency, it's better to use the perl that was specified to Configure last time it was called. Use case: perl v5.8.8 was first along $PATH, perl v5.22.2 was available and specified as: PERL=/opt/local/bin/perl ./config. When make wanted to reconfigure and called './Configure reconf', configuration broke down, complaining about a perl that's too old. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1884) (cherry picked from commit 12ccb021be9e1c4c947e020ea2079e985b329a8a)
2016-11-08Missing BN_RECP_CTX field init.FdaSilvaYY
BN_RECP_CTX_new direclty use bn_init to avoid twice memset calls Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1879) (cherry picked from commit 318447bceb3aa2c50ac0081bdb4e917f8704e7da)
2016-11-08Zero stack variable with DSA nonceRich Salz
Thanks to Falko Strenzke for bringing this to our attention. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1882) (cherry picked from commit e5e71f2857275189577ab7b227608ab4ec985471)
2016-11-08INSTALL: small typoRichard Levitte
libssl, not libddl. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1871) (cherry picked from commit b77b6127e8de38726f37697bbbc736ced7b49771)
2016-11-07Allow null in X509_CRL_METHOD_freeFdaSilvaYY
and fix documentation. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1634) (cherry picked from commit 7cb1ecec59d7c8d6628fb9bfd435306f7e06fd33)
2016-11-07Improve PRF documentationAndrea Grandi
Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1834 (cherry picked from commit 27ed73a98f88c98be996a6ffe7bda1b84bfc8be7)
2016-11-07Improve RSA test coverage.David Benjamin
MD5/SHA1 and MDC-2 have special-case logic beyond the generic DigestInfo wrapping. Test that each of these works, including hash and length mismatches (both input and signature). Also add VerifyRecover tests. It appears 5824cc298174d462c827cd090675e30fc03f0caf added support for VerifyRecover, but forgot to add the test data. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1474 (cherry picked from commit f320555735af7aa52172a2b8c56181445e8490dd)
2016-11-07Make RSA_sign.pod less confusing.David Benjamin
PKCS #1 v2.0 is the name of a document which specifies an algorithm RSASSA-PKCS1-v1_5, often referred to as "PKCS #1 v1.5" after an earlier document which specified it. This gets further confusing because the document PKCS #1 v2.1 specifies two signature algorithms, RSASSA-PKCS1-v1_5 and RSASSA-PSS. RSA_sign implements RSASSA-PKCS1-v1_5. Refer to the document using the RFC number which is easier to find anyway, and refer to the algorithm by its name. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1474 (cherry picked from commit aa90ca11c930114d5c0d68a2c1f446bf97853287)
2016-11-07Implement RSASSA-PKCS1-v1_5 as specified.David Benjamin
RFC 3447, section 8.2.2, steps 3 and 4 states that verifiers must encode the DigestInfo struct and then compare the result against the public key operation result. This implies that one and only one encoding is legal. OpenSSL instead parses with crypto/asn1, then checks that the encoding round-trips, and allows some variations for the parameter. Sufficient laxness in this area can allow signature forgeries, as described in https://www.imperialviolet.org/2014/09/26/pkcs1.html Although there aren't known attacks against OpenSSL's current scheme, this change makes OpenSSL implement the algorithm as specified. This avoids the uncertainty and, more importantly, helps grow a healthy ecosystem. Laxness beyond the spec, particularly in implementations which enjoy wide use, risks harm to the ecosystem for all. A signature producer which only tests against OpenSSL may not notice bugs and accidentally become widely deployed. Thus implementations have a responsibility to honor the specification as tightly as is practical. In some cases, the damage is permanent and the spec deviation and security risk becomes a tax all implementors must forever pay, but not here. Both BoringSSL and Go successfully implemented and deployed RSASSA-PKCS1-v1_5 as specified since their respective beginnings, so this change should be compatible enough to pin down in future OpenSSL releases. See also https://tools.ietf.org/html/draft-thomson-postel-was-wrong-00 As a bonus, by not having to deal with sign/verify differences, this version is also somewhat clearer. It also more consistently enforces digest lengths in the verify_recover codepath. The NID_md5_sha1 codepath wasn't quite doing this right. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1474 (cherry picked from commit 608a026494c1e7a14f6d6cfcc5e4994fe2728836)
2016-11-07Partial revert of "Fix client verify mode to check SSL_VERIFY_PEER"Matt Caswell
This partially reverts commit c636c1c47. It also tweaks the documentation and comments in this area. On the client side the documented interface for SSL_CTX_set_verify()/SSL_set_verify() is that setting the flag SSL_VERIFY_PEER causes verfication of the server certificate to take place. Previously what was implemented was that if *any* flag was set then verification would take place. The above commit improved the semantics to be as per the documented interface. However, we have had a report of at least one application where an application was incorrectly using the interface and used *only* SSL_VERIFY_FAIL_IF_NO_PEER_CERT on the client side. In OpenSSL prior to the above commit this still caused verification of the server certificate to take place. After this commit the application silently failed to verify the server certificate. Ideally SSL_CTX_set_verify()/SSL_set_verify() could be modified to indicate if invalid flags were being used. However these are void functions! The simplest short term solution is to revert to the previous behaviour which at least means we "fail closed" rather than "fail open". Thanks to Cory Benfield for reporting this issue. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit c8e2f98c97ff3327784843946c2d62761572e5d5)
2016-11-07Always ensure that init_msg is initialised for a CCSMatt Caswell
We read it later in grow_init_buf(). If CCS is the first thing received in a flight, then it will use the init_msg from the last flight we received. If the init_buf has been grown in the meantime then it will point to some arbitrary other memory location. This is likely to result in grow_init_buf() attempting to grow to some excessively large amount which is likely to fail. In practice this should never happen because the only time we receive a CCS as the first thing in a flight is in an abbreviated handshake. None of the preceding messages from the server flight would be large enough to trigger this. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit c437757466e7bef632b26eaaf429a9e693330999)
2016-11-06Windows: use default ZLIB1 unless --with-zlib-lib is setRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1772) (cherry picked from commit 475592e2419c5cb3098dfea4c9229d0c09ea7010)
2016-11-06Fix the LIBZ macro on VC config targetsRichard Levitte
If zlib-dynamic was given but not --with-zlib-lib, LIBZ was defined to the empty string. Instead, give it the default "ZLIB1". Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1772) (cherry picked from commit 111b234c8f80371e7e31d922946cbd546491d4e8)
2016-11-06VMS: pretend to use -znodeleteRichard Levitte
VMS only unloads shared libraries at process rundown, so tell the OpenSSL code so by pretending we linked with -znodelete. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1862) (cherry picked from commit 1186a2b3d40e33cbf42d4fd3c7cc679f9f6e14f2)
2016-11-04VMS build file template: assign 'arch' to local symbol tableRichard Levitte
Since the local symbol table is looked up before the global symbol table, 'arch' assigned in the local symbol table of the DCL where MMS is called would be seen before the 'arch' defined in descrip.mms. Assigning it to the local symbol table in descrip.mms removes that issue. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1853) (cherry picked from commit 3ee24d4acaff1c247db89c5cfcac17749dc3d7bc)
2016-11-04Missed a mention of RTRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1849) (cherry picked from commit 1e62cc12f35408508594be254f40bf9b65d2a3a9)
2016-11-04Travis: add a strict buildRichard Levitte
Clang on Linux seems to catch things that we might miss otherwise. Also, throw in 'no-deprecated' to make sure we test that as well. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1839) (cherry picked from commit 7b1954384114643e1a3c3a0ababa3fd7a112c5e3)
2016-11-04Don't assume to know the shared library extensionRichard Levitte
test/shlibloadtest.c assumes all Unix style platforms use .so as shared library extension. This is not the case for Mac OS X, which uses .dylib. Instead of this, have the test recipe find out the extension from configuration data. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1844) (cherry picked from commit 62dd3351a16089aedb0f1e62e3b6df371c93389c)
2016-11-03Update CRYPTO_set_mem_debug() docRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1842) (cherry picked from commit 00bb5504cc62693e05ff4e699f379011c55ecc84)
2016-11-03Enable memory debugging while testingRichard Levitte
Pre 1.1.0, 'make test' would set the environment variable OPENSSL_DEBUG_MEMORY to "on". This got lost when translating the old build files to the new templates. This changes reintroduces that variable. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1840) (cherry picked from commit 6d4bc8a3d2c2f7701588bbfdea80a1f7a3973f26)
2016-11-03test/shlibloadtest: small fixesRichard Levitte
- Make sure to initialise SHLIB variables - Make sure to make local variables static Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1838) (cherry picked from commit 3b0478fe03191bedef44644996a5a6da51f77eaf)
2016-11-03Clang doesn't like -znodelete, make it a linker flag insteadRichard Levitte
gcc is kinder, it silently passes quite a few flags to ld, while clang is stricter and wants them prefixed with -Wl, Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1836) (cherry picked from commit 075e9da055454ec5586962b43d9923e44bdcb313)
2016-11-03test/build.info: typo, $ missingRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1832) (cherry picked from commit 9c89c8460a4dcf828a22e2dfc279b5ea8a80ec60)
2016-11-03conf fuzzer: also check for an empty fileKurt Roeckx
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1828 (cherry picked from commit ea6199ea91ac59ae53686335e436d554cdacd2dc)
2016-11-03[fuzzers] do not fail fuzzers with empty inputMike Aizatsky
Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1788 (cherry picked from commit ba7407002d899b614d4728da9004594f947ff3da)
2016-11-02Implement GET_MODULE_HANDLE_EX_FLAG_PIN for windowsMatt Caswell
Rather than leaking a reference, just call GetModuleHandleEx and pin the module on Windows. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 2b59d1beaad43d9cf8eb916a437db63bc8ce1d3a)
2016-11-02Link using -znodeleteMatt Caswell
Instead of deliberately leaking a reference to ourselves, use nodelete which does this more neatly. Only for Linux at the moment. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit b6d5ba1a9f004d637acac18ae3519fe063b6b5e1)
2016-11-02Add a test to dynamically load and unload the librariesMatt Caswell
This should demonstrate that the atexit() handling is working properly (or at least not crashing) on process exit. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit b987d748e46d4ec19a45e5ec9e890a9003a361d6)
2016-11-02Ensure that libcrypto and libssl do not unload until the process exitsMatt Caswell
Because we use atexit() to cleanup after ourselves, this will cause a problem if we have been dynamically loaded and then unloaded again: the atexit() handler may no longer be there. Most modern atexit() implementations can handle this, however there are still difficulties if libssl gets unloaded before libcrypto, because of the atexit() callback that libcrypto makes to libssl. The most robust solution seems to be to ensure that libcrypto and libssl never unload. This is done by simply deliberately leaking a dlopen() reference to them. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 5836780f436e03be231ff245f04f2f9f2f0ede91)
2016-11-02Add a DSO_dsobyaddr() functionMatt Caswell
This works the same way as DSO_pathbyaddr() but instead returns a ptr to the DSO that contains the provided symbol. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit b39eda7ee69a9277c722f8789736e00dc680cda6)
2016-11-02Partial revert of 3d8b2ec42 to add back DSO_pathbyaddrMatt Caswell
Commit 3d8b2ec42 removed various unused functions. However now we need to use one of them! This commit resurrects DSO_pathbyaddr(). We're not going to resurrect the Windows version though because what we need to achieve can be done a different way on Windows. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit cb6ea61c161e88aa0268c77f308469a67b2ec063)
2016-11-02Add a CHANGES entry for the unrecognised record type changeMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit ce95f3b724f71f42dd57af4a0a8e2f571deaf94d)
2016-11-02Add a test for unrecognised record typesMatt Caswell
We should fail if we receive an unrecognised record type Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 1f3e70a450364e3152973380ea4d3bb6694f3980)
2016-11-02Fail if an unrecognised record type is receivedMatt Caswell
TLS1.0 and TLS1.1 say you SHOULD ignore unrecognised record types, but TLS 1.2 says you MUST send an unexpected message alert. We swap to the TLS 1.2 behaviour for all protocol versions to prevent issues where no progress is being made and the peer continually sends unrecognised record types, using up resources processing them. Issue reported by 郭志攀 Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 436a2a0179416d2cc22b678b63e50c2638384d5f)
2016-11-02Test recipes: remove duplicate OpenSSL::Test usageRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1815) (cherry picked from commit 2c4a3f938ca378d2017275d299f02512b232ceaf)