summaryrefslogtreecommitdiffstats
path: root/ssl
AgeCommit message (Collapse)Author
2015-12-07Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy)Richard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-07Adapt the rest of the source to the removal of (EVP_MD_CTX|HMAC_CTX)_cleanupRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-07Adapt the rest of the source to the opaque HMAC_CTXRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-07Adjust all accesses to EVP_MD_CTX to use accessor functions.Richard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-07Adapt HMAC to the EVP_MD_CTX changesRichard Levitte
This change required some special treatment, as HMAC is intertwined with EVP_MD. For now, all local HMAC_CTX variables MUST be initialised with HMAC_CTX_EMPTY, or whatever happens to be on the stack will be mistaken for actual pointers to EVP_MD_CTX. This will change as soon as HMAC_CTX becomes opaque. Also, since HMAC_CTX_init() can fail now, its return type changes from void to int, and it will return 0 on failure, 1 on success. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-06Really disable 56-bit (single-DES) ciphersViktor Dukhovni
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-12-05Remove support for all 40 and 56 bit ciphers.Kurt Roeckx
Reviewed-by: Rich Salz <rsalz@openssl.org> MR: #364
2015-12-04Remove SSL_{CTX_}set_ecdh_auto() and always enable ECDHKurt Roeckx
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2015-12-04Make SSL_{CTX}_set_tmp_ecdh() call SSL_{CTX_}set1_curves()Kurt Roeckx
SSL_{CTX}_set_tmp_ecdh() allows to set 1 EC curve and then tries to use it. On the other hand SSL_{CTX_}set1_curves() allows you to set a list of curves, but only when SSL_{CTX_}set_ecdh_auto() was called to turn it on. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2015-12-04Remove support for SSL_{CTX_}set_tmp_ecdh_callback().Kurt Roeckx
This only gets used to set a specific curve without actually checking that the peer supports it or not and can therefor result in handshake failures that can be avoided by selecting a different cipher. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2015-12-04Fix EAP FAST in the new state machineMatt Caswell
The new state machine code missed an allowed transition when resuming a session via EAP FAST. This commits adds the missing check for the transition. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-12-04Revert unnecessary SSL_CIPHER_get_bits API changeViktor Dukhovni
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-02Remove legacy sign/verify from EVP_MD.Dr. Stephen Henson
Remove sign/verify and required_pkey_type fields of EVP_MD: these are a legacy from when digests were linked to public key types. All signing is now handled by the corresponding EVP_PKEY_METHOD. Only allow supported digest types in RSA EVP_PKEY_METHOD: other algorithms already block unsupported types. Remove now obsolete EVP_dss1() and EVP_ecdsa(). Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-01ex_data part 2: doc fixes and CRYPTO_free_ex_index.Rich Salz
Add CRYPTO_free_ex_index (for shared libraries) Unify and complete the documentation for all "ex_data" API's and objects. Replace xxx_get_ex_new_index functions with a macro. Added an exdata test. Renamed the ex_data internal datatypes. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-30Remove GOST special case: handled automatically now.Dr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-11-30Use digest indices for signature algorithms.Dr. Stephen Henson
Don't hard code EVP_sha* etc for signature algorithms: use table indices instead. Add SHA224 and SHA512 to tables. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-11-30For TLS < 1.2 use default digest for client certificateDr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-30Use digest tables for defaults.Dr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-11-27fix function code discrepancyDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-27PRF and handshake hash revision.Dr. Stephen Henson
Change handshake hash array into a single digest context simplifying the handhake hash code. Use EVP_md5_sha1() if needed for handshake hashes in TLS 1.1 and earlier. Simplify PRF code to also use a single digest and treat EVP_md5_sha1() as a special case. Modify algorithm2 field of ciphers to use a single index value for handshake hash and PRF instead of a bitmap. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-27Updates to GOST2012Matt Caswell
Various updates following feedback from the recent commit of the new GOST2012 code. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-11-25Remove unused cert_verify_mac codeDr. Stephen Henson
Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-11-24ssl3_free(): Return if it wasn't createdPascal Cuoq
If somewhere in SSL_new() there is a memory allocation failure, ssl3_free() can get called with s->s3 still being NULL. Patch also provided by Willy Tarreau <wtarreau@haproxy.com> Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Viktor Dukhovni <openssl-users@dukhovni.org>
2015-11-24Use EVP_md5_sha1() to process client verifyDr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-24Use EVP_md5_sha1() to generate client verifyDr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-24Remove RSA exception when generating server key exchange.Dr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-24Remove RSA exception when processing server key exchange.Dr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-24Use MD5+SHA1 for default digest if appropriate.Dr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-23Fix a few missed "if (!ptr)" cleanupsRich Salz
And a scalar !x --> x==0 test Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-11-23Patch containing TLS implementation for GOST 2012Dmitry Belyavsky
This patch contains the necessary changes to provide GOST 2012 ciphersuites in TLS. It requires the use of an external GOST 2012 engine. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-21Good hygiene with size_t output argument.Viktor Dukhovni
Though the callers check the function return value and ignore the size_t output argument on failure, it is still often not ideal to store (-1) in size_t on error. That might signal an unduly large buffer. Instead set the size_t to 0, to indicate no space. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-11-20Rename start_async_job to ssl_start_async_jobMatt Caswell
Make it clear that this function is ssl specific. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-20Clean up libssl async callsMatt Caswell
Tidy up the libssl async calls and make sure all IO functions are covered. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-20Fix the error code for SSL_get_async_wait_fd()Matt Caswell
0 is a valid file descriptor so SSL_get_async_wait_fd should instead return -1 on error. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-20Remove ASYNC_in_job()Matt Caswell
The ASYNC_in_job() function is redundant. The same effect can be achieved by using ASYNC_get_current_job(). Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-20Initial Async notify code changesMatt Caswell
Initial API implemented for notifying applications that an ASYNC_JOB has completed. Currently only s_server is using this. The Dummy Async engine "cheats" in that it notifies that it has completed *before* it pauses the job. A normal async engine would not do that. Only the posix version of this has been implemented so far, so it will probably fail to compile on Windows at the moment. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-20Async clean upsMatt Caswell
Removed the function ASYNC_job_is_waiting() as it was redundant. The only time user code has a handle on a job is when one is waiting, so all they need to do is check whether the job is NULL. Also did some cleanups to make sure the job really is NULL after it has been freed! Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-20Make libssl async awareMatt Caswell
The following entry points have been made async aware: SSL_accept SSL_read SSL_write Also added is a new mode - SSL_MODE_ASYNC. Calling the above functions with the async mode enabled will initiate a new async job. If an async pause is encountered whilst executing the job (such as for example if using SHA1/RSA with the Dummy Async engine), then the above functions return with SSL_WANT_ASYNC. Calling the functions again (with exactly the same args as per non-blocking IO), will resume the job where it left off. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-20Fix uninitialised variableMatt Caswell
The al variable could be uninitialised in an error path. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-20Ensure all EVP calls have their returns checked where appropriateMatt Caswell
There are lots of calls to EVP functions from within libssl There were various places where we should probably check the return value but don't. This adds these checks. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-11-19Make GOST ciphersuites require TLSv1Dr. Stephen Henson
PR#4141 Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-11-17Add comment explaining why we don't check a return valueMatt Caswell
A call to X509_verify_cert() is used to build a chain of certs for the server to send back to the client. It isn't *actually* used for verifying the cert at all - just building the chain. Therefore the return value is ignored. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-11-17Remove an NULL ptr deref in an error pathMatt Caswell
The |passwd| variable in the code can be NULL if it goes to the err label. Therefore we cannot call strlen on it without first checking that it is non NULL. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-11-14Add "TLSv1.0" cipher alias.Dr. Stephen Henson
This adds a TLSv1.0 cipher alias for ciphersuites requiring at least TLSv1.0: currently only PSK ciphersuites using SHA256 or SHA384 MAC (SSLv3 only supports SHA1 and MD5 MAC). Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-14Don't alow TLS v1.0 ciphersuites for SSLv3Dr. Stephen Henson
This disables some ciphersuites which aren't supported in SSL v3: specifically PSK ciphersuites which use SHA256 or SHA384 for the MAC. Thanks to the Open Crypto Audit Project for identifying this issue. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-14Use SSL_TLSV1 only if at least TLS v1.0 is needed.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-13absent identity hint should be NULLDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-10Fix SSL_use_certificate_chain_fileMatt Caswell
The new function SSL_use_certificate_chain_file was always crashing in the internal function use_certificate_chain_file because it would pass a NULL value for SSL_CTX *, but use_certificate_chain_file would unconditionally try to dereference it. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-11-09Remove redundant check from tls1_get_curvelistMatt Caswell
The function tls1_get_curvelist() has an explicit check to see if s->cert is NULL or not. However the check appears *after* calling the tls1_suiteb macro which derefs s->cert. In reality s->cert can never be NULL because it is created in SSL_new(). If the malloc fails then the SSL_new call fails and no SSL object is created. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-09Standardise our style for checking malloc failuresMatt Caswell
if we have a malloc |x = OPENSSL_malloc(...)| sometimes we check |x| for NULL and sometimes we treat it as a boolean |if(!x) ...|. Standardise the approach in libssl. Reviewed-by: Kurt Roeckx <kurt@openssl.org>