summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-05-11rsaz_avx2_eligible doesn't take parametersKurt Roeckx
Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #6208
2018-05-11Set the ossl_shim to auto retry if not running asynchronouslyMatt Caswell
In certain circumstances in the DTLS code we have to drop a record (e.g. if it is a stale retransmit). We then have to move on to try and read the next record. Some applications using blocking sockets (e.g. s_server/s_client will hang if there isn't actually any data to be read from the socket yet). Others can tolerate this. Therefore SSL_read()/SSL_write() can sometimes return SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE even when using blocking sockets. Applications can use the mode SSL_MODE_AUTO_RETRY, to switch this behaviour off so that we never return unless we have read the data we wanted to. Commit ad96225285 fixed a DTLS problem where we always retried even if SSL_MODE_AUTO_RETRY was not set. However that fix caused the Boring ossl_shim to fail in some tests because it was relying on the previous (buggy) behaviour. The ossl_shim should be set into SSL_MODE_AUTO_RETRY if it is not operating asynchronously to avoid this problem. [extended tests] Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6216)
2018-05-10PPC assembly pack: add POWER9 results.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2018-05-10.travis.yml: add pair of linux-ppc64le targets.Andy Polyakov
One is clang --strict-warnings and one gcc sanitizer extended test. Sanitizer build is quite expensive, can take >30 mins and is commented for occasions when there is reason to believe that PPC-specific problem can be diagnosed with sanitizer. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6192)
2018-05-09Fix no-cmsMatt Caswell
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6205)
2018-05-09Fix no-tls1_2, no-tls1_2-method, no-chacha and no-poly1305Matt Caswell
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6205)
2018-05-09Fix typos in x509 documentationDr. Matthias St. Pierre
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6207)
2018-05-09Add CHANGES entry for PR#6009Nicola Tuveri
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6070)
2018-05-09Add blinding in BN_GF2m_mod_inv for binary field inversionsBilly Brumley
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6070)
2018-05-09ECC: unify generic ec2 and ecp scalar multiplication, deprecate ec2_mult.cBilly Brumley
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6070)
2018-05-09ECDSA: remove nonce padding (delegated to EC_POINT_mul)Billy Brumley
* EC_POINT_mul is now responsible for constant time point multiplication (for single fixed or variable point multiplication, when the scalar is in the range [0,group_order), so we need to strip the nonce padding from ECDSA. * Entry added to CHANGES * Updated EC_POINT_mul documentation - Integrate existing EC_POINT_mul and EC_POINTs_mul entries in the manpage to reflect the shift in constant-time expectations when performing a single fixed or variable point multiplication; - Add documentation to ec_method_st to reflect the updated "contract" between callers and implementations of ec_method_st.mul. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6070)
2018-05-08VMS rand: assign before check, not the other way aroundRichard Levitte
items->ile3$w_code was checked before it was assigned its value... Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6200)
2018-05-08Fix --strict-warnings build of ppc-linux targetBernd Edlinger
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6191)
2018-05-08ec/ec_mult.c: get BN_CTX_start,end sequence right.Andy Polyakov
Triggered by Coverity analysis. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6190)
2018-05-08Add a DTLS test for dropped recordsMatt Caswell
Drop a record from a handshake and check that we can still complete the handshake. Repeat for all records in the handshake. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6170)
2018-05-08Keep the DTLS timer running after the end of the handshake if appropriateMatt Caswell
During a full handshake the server is the last one to "speak". The timer should continue to run until we know that the client has received our last flight (e.g. because we receive some application data). Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6170)
2018-05-08Only auto-retry for DTLS if configured to do soMatt Caswell
Otherwise we may end up in a hang when using blocking sockets Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6170)
2018-05-08Fix s_client and s_server so that they correctly handle the DTLS timerMatt Caswell
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6170)
2018-05-08Don't fail on an out-of-order CCS in DTLSMatt Caswell
Fixes #4929 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6170)
2018-05-08Add a CMS API testMatt Caswell
Previous tests only invoked CMS via the command line app. This test uses the CMS API directly to do and encrypt and decrypt operation. This test would have caught the memory leak fixed by the previous commit (when building with enable-crypto-mdebug). Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6142)
2018-05-08Fix a mem leak in CMSMatt Caswell
The function CMS_RecipientInfo_set0_pkey() is a "set0" and therefore memory management passes to OpenSSL. If the same function is called again then we should ensure that any previous value that was set is freed first before we set it again. Fixes #5052 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6142)
2018-05-07windows-makefile.tmpl: rearrange cleanup commands to avoid ...FdaSilvaYY
deletion of *.exp files in krb5 sub-module. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6186)
2018-05-07.travis.yml: temporarily mask gcc-5 ubsan build.Andy Polyakov
Linking fails with "unrecognized option '--push-state--no-as-needed'", which is beyond our control. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6185)
2018-05-07.travis.yml: minor faceliftAndy Polyakov
Apparently trusty image has newer clang, there is no need to pull clang-3.9 packages. It's clang-5.0.0, installation is a bit quirky, as it fails to compile for example strcmp(s,"-") without warning, and complains about unreferred -I flags. But it's argued that benefits of exercising newer sanitizer outweights the inconvenience of additional -D__NO_STRING_INLINE and -Wno-unused-command-line-argument. Also pull golang when actually needed. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6185)
2018-05-05CleanupRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6183)
2018-05-05Configure: fix Mac OS X builds that still require makedependTodd Short
Earlier Apple Xcode compilers, e.g. one targeting Mac OS X 10.7, don't support dependency generation and one still has to use makedepend. It's unclear when it was fixed, but all clang-based Apple compilers seem to support -M options. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6169)
2018-05-05Configure: pass more suitable argument to compiler_predefined().Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6174)
2018-05-05Configure: move --noexecstack probe to Configure.Andy Polyakov
config probe doesn't work in cross-compile scenarios or with clang. In addition consolidate -Qunused-arguments handling. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6174)
2018-05-05BIO_s_mem() write: Skip early when input length is zeroRichard Levitte
When the input length is zero, just return zero early. Otherwise, there's a small chance that memory allocation is engaged, fails and returns -1, which is a bit confusing when nothing should be written. Fixes #4782 #4827 Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/6175)
2018-05-04docs: Fix typo EVP_PKEY_new_id -> EVP_PKEY_CTX_new_idRichard Levitte
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6177)
2018-05-03v3_purp.c: add locking to x509v3_cache_extensions()Dr. Matthias St. Pierre
Fixes #6121 Thanks to Mingtao Yang for reporting this bug. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6162)
2018-05-03VMS: modernise rand_pool_acquire_entropy, step 2Richard Levitte
Add more items that could serve as entropy source. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6151)
2018-05-03VMS: modernise rand_pool_acquire_entropy, step 1Richard Levitte
Stop redefining structures that are already defined in system headers. This also means we can stop setting the pointer size globally, because the system structures will have the correct pointer sizes either way. The only exception is passing the right pointer size to a function. Stop trying to twist things around with rand(), that's the job of the DRBG that we feed. Stop assuming the location of the JPI$_FINALEXC item, look it up instead. Signal an exception if the sys$getjpiw call fails (it means the item list isn't set up right, so works as an assertion, but using VMS methodology). Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6151)
2018-05-03Return an error from BN_mod_inverse if n is 1 (or -1)Matt Caswell
Calculating BN_mod_inverse where n is 1 (or -1) doesn't make sense. We should return an error in that case. Instead we were returning a valid result with value 0. Fixes #6004 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6119)
2018-05-02Make X509_VERIFY_PARAM_get_hostflags() take a const argMatt Caswell
Commit 5b748dea5 added this function which should have taken a const argument. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6154)
2018-05-02Add a test for SSL_get_shared_ciphers()Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6113)
2018-05-02Fix a bug in create_ssl_ctx_pair()Matt Caswell
The max protocol version was only being set on the server side. It should have been done on both the client and the server. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6113)
2018-05-02Add some documentation for SSL_get_shared_ciphers()Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6113)
2018-05-02Fix comment in ssl_locl.hMatt Caswell
The ciphers field in a session contains the stack of ciphers offered by the client. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6113)
2018-05-02Fix SSL_get_shared_ciphers()Matt Caswell
The function SSL_get_shared_ciphers() is supposed to return ciphers shared by the client and the server. However it only ever returned the client ciphers. Fixes #5317 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6113)
2018-05-02opensslconf.h inclusion cleanupFdaSilvaYY
No need to buildtest on opensslconf.h Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6149)
2018-05-02bn/asm/*-mont.pl: harmonize with BN_from_montgomery_word.Andy Polyakov
Montgomery multiplication post-conditions in some of code paths were formally non-constant time. Cache access pattern was result-neutral, but a little bit asymmetric, which might have produced a signal [if processor reordered load and stores at run-time]. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6141)
2018-05-02apps/speed.c: merge parameters defining EC curves to test ...FdaSilvaYY
... and unify 'bits' declarations and printing format. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6132)
2018-05-02a_strex.c: prevent out of bound read in do_buf()Dr. Matthias St. Pierre
which is used for ASN1_STRING_print_ex*() and X509_NAME_print_ex*(). Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6105)
2018-05-02Change rand_pool_bytes_needed to handle less entropy than 1 per 8 bitsRichard Levitte
rand_pool_bytes_needed() was constructed in such a way that the smallest acceptable entropy factor was 1 entropy bits per 8 bits of data. At the same time, we have a DRBG_MINMAX_FACTOR that allows weaker source, as small as 1 bit of entropy per 128 bits of data. The conclusion is that rand_pool_bytes_needed() needs to change to support weaker entropy sources. We therefore change the input of entropy per byte to be an entropy factor instead. This entropy factor expresses how many bits of data it takes (on average) to get 1 bit of entropy. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/6150)
2018-05-02Add a note about Nagle's algorithm on the SSL_connect man pageMatt Caswell
Fixes #4237 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/6143)
2018-05-02Fix memory leaks in CA related functions.Pavel Kopyl
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4700)
2018-05-01Fix regression with session cache use by clientsBenjamin Kaduk
Commit d316cdcf6d8d6934663278145fe0a8191e14a8c5 introduced some extra checks into the session-cache update procedure, intended to prevent the caching of sessions whose resumption would lead to a handshake failure, since if the server is authenticating the client, there needs to be an application-set "session id context" to match up to the authentication context. While that change is effective for its stated purpose, there was also some collatoral damage introduced along with the fix -- clients that set SSL_VERIFY_PEER are not expected to set an sid_ctx, and so their usage of session caching was erroneously denied. Fix the scope of the original commit by limiting it to only acting when the SSL is a server SSL. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5967)
2018-05-01Improve error handling in rand_init functionBernd Edlinger
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6124)
2018-05-01Add getter for X509_VERIFY_PARAM_get_hostflagsMatt Caswell
Fixes #5061 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6139)