summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-02-14Harmonize the make variables across all known platforms familiesRichard Levitte
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in addition to CFLAGS and so on. This works without problem on Unix and Windows, where options with different purposes (such as -D and -I) can appear anywhere on the command line and get accumulated as they come. This is not necessarely so on VMS. For example, macros must all be collected and given through one /DEFINE, and the same goes for inclusion directories (/INCLUDE). So, to harmonize all platforms, we repurpose make variables starting with LIB_, DSO_ and BIN_ to be all encompassing variables that collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES, INCLUDES and so on together with possible config target values specific for libraries DSOs and programs, and use them instead of the general ones everywhere. This will, for example, allow VMS to use the exact same generators for generated files that go through cpp as all other platforms, something that has been impossible to do safely before now. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-14d2i_X509.pod: clarify usage of the 'pp' function parameterDr. Matthias St. Pierre
The 'pp' function parameters of d2i_TYPE() and i2d_TYPE() are referenced in the DESCRIPTION section as 'in' resp. 'out'. This commit renames the references to 'ppin' resp. 'ppout' and adds an explaining sentence. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5365)
2018-02-14Ignore an s_client psk in TLSv1.3 if not TLSv1.3 suitableMatt Caswell
The s_client psk_use_session_cb callback has a comment stating that we should ignore a key that isn't suitable for TLSv1.3. However we were actually causing the connection to fail. Changing the return value fixes the issue. Also related to this is that the early_data extension was not marked as TLSv1.3 only which it should be. Fixes #5202 Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/5205)
2018-02-14Make sure we check the return value of extract_min_max()Matt Caswell
Commit 42d7d7dd6 turned this function from returning void to returning an int error code. This instance of calling it was missed. Found by Coverity. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5338)
2018-02-14Fix a memory leak in an error pathMatt Caswell
Found by Coverity. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/5336)
2018-02-14Build files: parametrize cppRichard Levitte
Instead of having the knowledge of the exact flags to run the C preprocessor only and have it output on standard output in the deeper recesses of the build file template, make it a config parameter, or rely on build CPP in value ('$(CC) -E' on Unix). Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/5356)
2018-02-14VMS: simplify config targetsRichard Levitte
All VMS config targets were literally copies of each other, only differing in what argument the parameter seeking function vms_info() received (the pointer size). This could be hugely simplified by letting vms_info() detect what pointer size was desired from the desired config target name instead. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5364)
2018-02-13Avoid fragile aliasing of SHA224/384 update/finalViktor Dukhovni
This is purported to save a few cycles, but makes the code less obvious and more brittle, and in fact breaks on platforms where for ABI continuity reasons there is a SHA2 implementation in libc, and so EVP needs to call those to avoid conflicts. A sufficiently good optimizer could simply generate the same entry points for: foo(...) { ... } and bar(...) { return foo(...); } but, even without that, the different is negligible, with the "winner" varying from run to run (openssl speed -evp sha384): Old: type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes sha384 28864.28k 117362.62k 266469.21k 483258.03k 635144.87k 649123.16k New: type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes sha384 30055.18k 120725.98k 272057.26k 482847.40k 634585.09k 650308.27k Reviewed-by: Rich Salz <rsalz@openssl.org>
2018-02-13Use both getrandom() and /dev/urandom by default on Linux.Kurt Roeckx
getrandom() is now used on Linux by default when using Linux >= 3.17 and glibc >= 2.25 Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #5314
2018-02-13VMS: for testutil, make sure to use BIO_f_linebufferRichard Levitte
Without that, output comes one character per line. It's the same issue as has been observed before, this happens when using write() on a record oriented stream (possibly unbuffered too). This also uncovered a bug in BIO_f_linebuffer, where this would cause an error: BIO_write(bio, "1\n", 1); I.e. there's a \n just after the part of the string that we currently ask to get written. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5352)
2018-02-13Configure: if a file is generated, never assume it's in the source dirRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5355)
2018-02-13s390x assembly pack: implement OPENSSL_rdtsc as STCKFPatrick Steuer
.. if avalable. STCK has an artificial delay to ensure uniqueness which can result in a performance penalty if used heavily concurrently. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5284)
2018-02-13Generate copyright year properlyRich Salz
Output copyright year depends on any input file(s) and the script. This is not perfect, but better than what we had. Also run 'make update' Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5350)
2018-02-13OPENSSL_cleanup: cleanup secure memoryDr. Matthias St. Pierre
If the global DRBGs are allocated on the secure heap, then calling CRYPTO_secure_malloc_done() inside main() will have no effect, unless OPENSSL_cleanup() has been called explicitely before that, because otherwise the DRBGs will still be allocated. So it is better to cleanup the secure heap automatically at the end of OPENSSL_cleanup(). Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5294)
2018-02-13DRBG: make the derivation function the default for ctr_drbgDr. Matthias St. Pierre
The NIST standard presents two alternative ways for seeding the CTR DRBG, depending on whether a derivation function is used or not. In Section 10.2.1 of NIST SP800-90Ar1 the following is assessed: The use of the derivation function is optional if either an approved RBG or an entropy source provides full entropy output when entropy input is requested by the DRBG mechanism. Otherwise, the derivation function shall be used. Since the OpenSSL DRBG supports being reseeded from low entropy random sources (using RAND_POOL), the use of a derivation function is mandatory. For that reason we change the default and replace the opt-in flag RAND_DRBG_FLAG_CTR_USE_DF with an opt-out flag RAND_DRBG_FLAG_CTR_NO_DF. This change simplifies the RAND_DRBG_new() calls. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5294)
2018-02-13DRBG: unify initialization and cleanup codeDr. Matthias St. Pierre
The functions drbg_setup() and drbg_cleanup() used to duplicate a lot of code from RAND_DRBG_new() and RAND_DRBG_free(). This duplication has been removed, which simplifies drbg_setup() and makes drbg_cleanup() obsolete. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5294)
2018-02-13DRBG: add locking apiDr. Matthias St. Pierre
This commit adds three new accessors to the internal DRBG lock int RAND_DRBG_lock(RAND_DRBG *drbg) int RAND_DRBG_unlock(RAND_DRBG *drbg) int RAND_DRBG_enable_locking(RAND_DRBG *drbg) The three shared DRBGs are intended to be used concurrently, so they have locking enabled by default. It is the callers responsibility to guard access to the shared DRBGs by calls to RAND_DRBG_lock() and RAND_DRBG_unlock(). All other DRBG instances don't have locking enabled by default, because they are intendended to be used by a single thread. If it is desired, locking can be enabled by using RAND_DRBG_enable_locking(). Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5294)
2018-02-13Prepare for 1.1.1-pre2-devMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2018-02-13Prepare for 1.1.1-pre1 releaseOpenSSL_1_1_1-pre1Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2018-02-13Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2018-02-13OpenSSL 1.1.1 is now in pre releaseMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2018-02-13Update last release letter for CHANGES and NEWSMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2018-02-13Fix whitespace issues in CHANGES and NEWSDr. Matthias St. Pierre
Removed mixed tabs (converted tabs to eight spaces) Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5344)
2018-02-13Document new random generator in NEWS and CHANGESDr. Matthias St. Pierre
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5344)
2018-02-12Update NEWS file for new releaseMatt Caswell
Updated the NEWS file with the most significant items from CHANGES Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5333)
2018-02-12Some minor tweaks following TLSv1.3 becoming defaultMatt Caswell
Fix a typo in INSTALL and update the link in CHANGES Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5329)
2018-02-12Remove code that prints "<SPACES/NULS>" in hexdumpsBernd Edlinger
when the data block ends with SPACEs or NULs. The problem is, you can't see if the data ends with SPACE or NUL or a combination of both. This can happen for instance with openssl rsautl -decrypt -hexdump Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5328)
2018-02-12sha/asm/sha512-armv8.pl: add hardware-assisted SHA512 subroutine.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2018-02-12crypto/armcap.c: detect hardware-assisted SHA512 support.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2018-02-12The function ssl_get_min_max_version() can failMatt Caswell
We should always check the return code. This fixes a coverity issue. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5308)
2018-02-12Don't overestimate the ticket ageMatt Caswell
On the client we calculate the age of the ticket in seconds but the server may work in ms. Due to rounding errors we could overestimate the age by up to 1s. It is better to underestimate it. Otherwise, if the RTT is very short, when the server calculates the age reported by the client it could be bigger than the age calculated on the server - which should never happen. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5306)
2018-02-11Fix include in manpage of X509_check_hostDaniƫl van Eeden
Fixes Issue #5255 CLA: trivial Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5256)
2018-02-10Copy name string in BIO_meth_newRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5318)
2018-02-09Avoid leaking peername data via accept BIOsViktor Dukhovni
Reviewed-by: Rich Salz <rsalz@openssl.org>
2018-02-09Swap the check in ssl3_write_pending to avoid usingBernd Edlinger
the possibly indeterminate pointer value in wpend_buf. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5305)
2018-02-09Fixes for no-tls1_2 and no-tls1_2-methodMatt Caswell
The no-tls1_2 option does not work properly in conjunction with TLSv1.3 being enabled (which is now the default). This commit fixes the issues. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5301)
2018-02-09Run "make update"Nick Mathewson
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5150)
2018-02-09In err_all.c, include the *err.h headers.Nick Mathewson
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5150)
2018-02-09Improve #include structure of pem{,2}.hNick Mathewson
- pem2.h is empty, so pem.h doesn't need to include it. - pem2.h once declared ERR_load_PEM_strings(), so it should now include pemerr.h Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5150)
2018-02-09Remove redundant declarations of ERR_load_*_strings()Nick Mathewson
In commit 52df25cf2e656146cb3b206d8220124f0417d03f, the ERR_load_FOO_strings() functions were moved from their original location in foo.h into new headers called fooerr.h. But they were never removed from their original locations. This duplication causes redundant-declaration warnings on programs that use OpenSSL's headers with such warnings enabled. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5150)
2018-02-09Don't calculate the Finished MAC twiceMatt Caswell
In <= TLSv1.2 a Finished message always comes immediately after a CCS except in the case of NPN where there is an additional message between the CCS and Finished. Historically we always calculated the Finished MAC when we processed the CCS. However to deal with NPN we also calculated it when we receive the Finished message. Really this should only have been done if we hand negotiated NPN. This simplifies the code to only calculate the MAC when we receive the Finished. In 1.1.1 we need to do it this way anyway because there is no CCS (except in middlebox compat mode) in TLSv1.3. Coincidentally, this commit also fixes the fact that no-nextprotoneg does not currently work in master. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5285)
2018-02-09Configuration: move the handling of zlib_include to config filesRichard Levitte
It was a bit absurd to have this being specially handled in the build file templates, especially that we have the 'includes' attribute. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5296)
2018-02-09Turn off printf format checking for BIO_printf et al on Mac OS/XRichard Levitte
Mac OS/X has a type for %j that doesn't agree with how we define it, which gives incorrect warnings. The easiest way out of that situation is simply to turn off that check on Mac OS/X. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5302)
2018-02-09Small simplification in mkerr.plFdaSilvaYY
As suggested in https://github.com/openssl/openssl/pull/5275 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5288)
2018-02-09VMS: take care of includesRichard Levitte
Configurations/descrip.mms.tmpl didn't treat the includes config attribute very well. In fact, it didn't treat it at all! Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5295)
2018-02-09Fix glibc version detection.Pauli
Simplify Posix timer detection. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5279)
2018-02-09Fix check of cpuid_asm_src config attributeRichard Levitte
The contents of that attribute is C file names, not object file names. This went undetected because quite a lot of systems have assembler implementations anyway, so setting OPENSSL_CPUID_OBJ was correct for them. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5291)
2018-02-09Revert ".travis.yml: remove osx from build matrix."Richard Levitte
Recent changes seem to have gotten OS X back on track, so we should be able to run our tests there again. This reverts commit e12e903e9ac675d08f9dd0db1f0c1a2049232c21. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5292)
2018-02-09CRYPTO_THREAD_run_once.pod: fix typo and punktuationDr. Matthias St. Pierre
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5293)
2018-02-08Fix no-chacha and no-poly1305Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5287)