aboutsummaryrefslogtreecommitdiff
path: root/util
AgeCommit message (Collapse)AuthorFilesLines
2016-03-08Convert RSA blinding to new multi-threading APIAlessandro Ghedini1-3/+7
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-08Convert CRYPTO_LOCK_SSL_* to new multi-threading APIAlessandro Ghedini1-0/+1
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-08OpenSSLDie --> OPENSSL_dieRich Salz1-1/+1
Also removed a bunch of unused define's from e_os.h Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-08make updateDr. Stephen Henson1-6/+7
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-08make updateAlessandro Ghedini1-0/+2
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-08Add an SSL_has_pending() functionMatt Caswell1-5/+0
This is similar to SSL_pending() but just returns a 1 if there is data pending in the internal OpenSSL buffers or 0 otherwise (as opposed to SSL_pending() which returns the number of bytes available). Unlike SSL_pending() this will work even if "read_ahead" is set (which is the case if you are using read pipelining, or if you are doing DTLS). A 1 return value means that we have unprocessed data. It does *not* necessarily indicate that there will be application data returned from a call to SSL_read(). The unprocessed data may not be application data or there could be errors when we attempt to parse the records. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-08Add an ability to set the SSL read buffer sizeMatt Caswell1-0/+5
This capability is required for read pipelining. We will only read in as many records as will fit in the read buffer (and the network can provide in one go). The bigger the buffer the more records we can process in parallel. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-08Add cipher query functionsTodd Short1-0/+3
Add functions to determine authentication, key-exchange, FIPS and AEAD. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-08Convert ERR_STATE to new multi-threading APIAlessandro Ghedini1-2/+2
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-08Make mk1mf recognise the --classic flagRichard Levitte1-0/+1
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-07GH812: Fix for no-ui build on WindowsMat1-0/+2
Add UI to known algorithms in mkdef.pl Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-07Rename EVP_CIPHER_CTX_cipher_data to EVP_CIPHER_CTX_get_cipher_dataMatt Caswell2-1/+4737
We had the function EVP_CIPHER_CTX_cipher_data which is newly added for 1.1.0. As we now also need an EVP_CIPHER_CTX_set_cipher_data it makes more sense for the former to be called EVP_CIPHER_CTX_get_cipher_data. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add an SSL_has_pending() functionMatt Caswell2-0/+423
This is similar to SSL_pending() but just returns a 1 if there is data pending in the internal OpenSSL buffers or 0 otherwise (as opposed to SSL_pending() which returns the number of bytes available). Unlike SSL_pending() this will work even if "read_ahead" is set (which is the case if you are using read pipelining, or if you are doing DTLS). A 1 return value means that we have unprocessed data. It does *not* necessarily indicate that there will be application data returned from a call to SSL_read(). The unprocessed data may not be application data or there could be errors when we attempt to parse the records. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add an ability to set the SSL read buffer sizeMatt Caswell1-0/+2
This capability is required for read pipelining. We will only read in as many records as will fit in the read buffer (and the network can provide in one go). The bigger the buffer the more records we can process in parallel. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Update the dasync engine to add a pipeline cipherMatt Caswell1-0/+1
Implement aes128-cbc as a pipeline capable cipher in the dasync engine. As dasync is just a dummy engine, it actually just performs the parallel encrypts/decrypts in serial. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07make updateMatt Caswell1-2/+3
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07make updateDr. Stephen Henson1-2/+2
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-05New ordinal files, recreated from scratchRichard Levitte2-0/+4425
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-05Change names of ordinals and libs, libeay => libcrypto and ssleay => libsslRichard Levitte5-30/+30
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-05Remove the old ordinalsRichard Levitte2-5238/+0
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-04Adds CT validation to SSL connectionsRob Percival1-0/+8
Disabled by default, but can be enabled by setting the ct_validation_callback on a SSL or SSL_CTX. Reviewed-by: Ben Laurie <ben@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-02make updateDr. Stephen Henson1-0/+1
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-02add kdf.h to mkdef.plDr. Stephen Henson1-0/+1
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-02make updateDr. Stephen Henson1-0/+2
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-02Provide getters for default_passwd_cb and userdataChristian Heimes1-0/+4
This patch provides getters for default_passwd_cb and userdata for SSL and SSL_CTX. The getter functions are required to port Python's ssl module to OpenSSL 1.1.0. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-01CT policy validationRob Percival1-0/+13
Specifies a callback that will, in the future, be used by the SSL code to decide whether to abort a connection on Certificate Transparency grounds. Reviewed-by: Ben Laurie <ben@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-01Verify SCT signaturesRob Percival1-0/+22
Tests included in future commit, which adds CT policy validation. Reviewed-by: Ben Laurie <ben@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-29Refactor the async wait fd logicMatt Caswell2-4/+13
Implementation experience has shown that the original plan for async wait fds was too simplistic. Originally the async logic created a pipe internally and user/engine code could then get access to it via API calls. It is more flexible if the engine is able to create its own fd and provide it to the async code. Another issue is that there can be a lot of churn in the fd value within the context of (say) a single SSL connection leading to continually adding and removing fds from (say) epoll. It is better if we can provide some stability of the fd value across a whole SSL connection. This is problematic because an engine has no concept of an SSL connection. This commit refactors things to introduce an ASYNC_WAIT_CTX which acts as a proxy for an SSL connection down at the engine layer. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-29Workaround for VisualStudio 2015 bugMatt Caswell1-1/+2
VisualStudio 2015 has a bug where an internal compiler error was occurring. By reordering the DEFINE_STACK_OF declarations for SSL_CIPHER and SSL_COMP until after the ssl3.h include everything seems ok again. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-28make updateDr. Stephen Henson1-0/+1
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-02-28Fix mk1mf buildRich Salz4-12/+2
Removing certs broke the mk1mf build. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-26Public API for Certificate TransparencyRob Percival2-2/+34
Reviewed-by: Ben Laurie <ben@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-26Fix a mkdef.pl warningMatt Caswell1-1/+9
mkdef.pl was issuing the following error: Use of uninitialized value within %tag in numeric eq (==) at util/mkdef.pl line 560, <IN> line 92 This was because it was treating a __cplusplus "#ifdef" check as a "tag" but then skipping over the corresponding "#endif". Therefore after processing a file it still had "left over" tags from processing the previous file. It was also getting confused by "#if" checks that didn't match is pre-defined styles. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-26Implement new multi-threading APIAlessandro Ghedini2-0/+14
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-25CVE-2016-0798: avoid memory leak in SRPEmilia Kasper1-1/+3
The SRP user database lookup method SRP_VBASE_get_by_user had confusing memory management semantics; the returned pointer was sometimes newly allocated, and sometimes owned by the callee. The calling code has no way of distinguishing these two cases. Specifically, SRP servers that configure a secret seed to hide valid login information are vulnerable to a memory leak: an attacker connecting with an invalid username can cause a memory leak of around 300 bytes per connection. Servers that do not configure SRP, or configure SRP but do not configure a seed are not vulnerable. In Apache, the seed directive is known as SSLSRPUnknownUserSeed. To mitigate the memory leak, the seed handling in SRP_VBASE_get_by_user is now disabled even if the user has configured a seed. Applications are advised to migrate to SRP_VBASE_get1_by_user. However, note that OpenSSL makes no strong guarantees about the indistinguishability of valid and invalid logins. In particular, computations are currently not carried out in constant time. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-22The build files use %disabled, make sure to pass it to themRichard Levitte1-0/+1
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-21Don't use 'parent' in util/dofile.plRichard Levitte5-5/+11
Because we're requiring Perl 5.10.0 and the 'parent' didn't appear before Perl 5.10.1, we need to resort to the older parent module declaration style, modifying @ISA. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-20Work-around for proxy->s_server retry logicViktor Dukhovni1-1/+3
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-20Build dynamic engines even if configured "no-shared"Richard Levitte1-4/+2
Until now, the engines in engines/ were only built as dynamicaly loadable ones if shared libraries were built. We not dissociate the two and can build dynamicaly loadable engines even if we only build static libcrypto and libssl. This is controlled with the option (enable|disable|no)-static-engine, defaulting to no-static-engine. Note that the engines in crypto/engine/ (dynamic and cryptodev) will always be built into libcrypto. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-20Always build library object files with shared library cflagsRichard Levitte2-4/+5
This takes us away from the idea that we know exactly how our static libraries are going to get used. Instead, we make them available to build shareable things with, be it other shared libraries or DSOs. On the other hand, we also have greater control of when the shared library cflags. They will never be used with object files meant got binaries, such as apps/openssl or test/test*. With unified, we take this a bit further and prepare for having to deal with extra cflags specifically to be used with DSOs (dynamic engines), libraries and binaries (applications). Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-19TLS: reject duplicate extensionsEmilia Kasper3-10/+28
Adapted from BoringSSL. Added a test. The extension parsing code is already attempting to already handle this for some individual extensions, but it is doing so inconsistently. Duplicate efforts in individual extension parsing will be cleaned up in a follow-up. Reviewed-by: Stephen Henson <steve@openssl.org>
2016-02-18Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPENDRichard Levitte1-2/+2
All those flags existed because we had all the dependencies versioned in the repository, and wanted to have it be consistent, no matter what the local configuration was. Now that the dependencies are gone from the versioned Makefile.ins, it makes much more sense to use the exact same flags as when compiling the object files. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18Remove outdated DEBUG flags.Rich Salz1-1/+0
Add -DBIO_DEBUG to --strict-warnings. Remove comments about outdated debugging ifdef guards. Remove md_rand ifdef guarding an assert; it doesn't seem used. Remove the conf guards in conf_api since we use OPENSSL_assert, not assert. For pkcs12 stuff put OPENSSL_ in front of the macro name. Merge TLS_DEBUG into SSL_DEBUG. Various things just turned on/off asserts, mainly for checking non-NULL arguments, which is now removed: camellia, bn_ctx, crypto/modes. Remove some old debug code, that basically just printed things to stderr: DEBUG_PRINT_UNKNOWN_CIPHERSUITES, DEBUG_ZLIB, OPENSSL_RI_DEBUG, RL_DEBUG, RSA_DEBUG, SCRYPT_DEBUG. Remove OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-17Remove "experimental" in code and comments, too.Rich Salz1-12/+0
Thanks to Viktor for additional review. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-17Finish 02f7114a7fbb3f3ac171bae87be8c13bc69e4005David Woodhouse1-2/+2
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-17Be more verbose when debugging is onRichard Levitte1-6/+10
It's near impossible to figure out what goes wrong with the execution of sub-commands otherwise. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-17Remove JPAKERich Salz5-35/+0
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-15Correct deprecation of OPENSSL_configRichard Levitte1-1/+1
Reported in GH#684 Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-14Misc fixes in util/mk1mf.plRichard Levitte1-0/+3
mk1mf was wondering about the options no-heartbeats and no-crypto-mdebug-backtrace, so we add option hooks them. They only need to become OPENSSL_NO_ macros in opensslconf.h, so nothing additional needs to be done. Also, add "-DOPENSSL_PIC" when shared libraries are produced. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-14make updateRichard Levitte1-7/+7
Reviewed-by: Andy Polyakov <appro@openssl.org>