summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-05-28Add SSL_get_client_ciphers() to return ciphers from ClientHelloNick Mathewson
On the server side, if you want to know which ciphers the client offered, you had to use session->ciphers. But that field is no longer visible, so we need a method to get at it. Signed-off-by: Nick Mathewson <nickm@torproject.org> Signed-off-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-27Enable DH testsEmilia Kasper
In master, the 'dh' command is gone, so use 'dhparam' instead to determine if we're compiled with DH. Also, set "@SECLEVEL=1" for the weak DH test, so that it actually passes. Reviewed-by: Dr Stephen Henson <steve@openssl.org>
2015-05-26make updateDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-26scrypt in pkcs8 utilDr. Stephen Henson
Add support for PKCS#8 private key encryption using the scrypt algorithm in the pkcs8 utility. Update documentation. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-26Add function PKCS8_set0_pbeDr. Stephen Henson
This adds a new function which will encrypt a private key using PKCS#8 based on an X509_ALGOR structure and reimplements PKCS8_encrypt to use it. Update pkcs8 utlity to use PKCS8_set0_pbe. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-26Error if memory limit exceeded.Dr. Stephen Henson
Set a specific error if the parameters are otherwise valid but exceed the memory limit. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-26Fix memory leak.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-26Add PBE tests.Dr. Stephen Henson
Add support for PKCS#12 and PBKDF2 password based encryption tests. Add additional test data. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-26Fix ssltest to use 1024-bit DHE parametersEmilia Kasper
Also add more ciphersuite test coverage, and a negative test for 512-bit DHE. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 1ee85aab75d7c9f20058f781bfe9222323df08eb)
2015-05-26Don't check for a negative SRP extension sizeMatt Caswell
The size of the SRP extension can never be negative (the variable |size| is unsigned). Therefore don't check if it is less than zero. RT#3862 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-26Fix error check in GOST engineMatt Caswell
The return value of i2d functions can be negative if an error occurs. Therefore don't assign the return value to an unsigned type and *then* check if it is negative. RT#3862 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-26Handle unsigned struct timeval membersMatt Caswell
The members of struct timeval on OpenVMS are unsigned. The logic for calculating timeouts needs adjusting to deal with this. RT#3862 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-26Configure: replace -mv8 with -mcpu=v8 in SPARC config lines.Andy Polyakov
RT#3860 Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-26fix copy paste error in ec_GF2m function prototypesBilly Brumley
RT#3858 Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-26bn/bn_lcl.h: fix MIPS-specific gcc version check.Andy Polyakov
RT#3859 Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-25RT3861: Mem/bio leak in req commandHanno Böck
The "out" variable is used for both key and csr. Close it after writing the first one so it can be re-used when writing the other. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-25Fix segfault in ec commandRich Salz
Thanks to Brian Carpenter <brian.carpenter@gmail.com> for finding this. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-25Don't send an alert if we've just received oneMatt Caswell
If the record received is for a version that we don't support, previously we were sending an alert back. However if the incoming record already looks like an alert then probably we shouldn't do that. So suppress an outgoing alert if it looks like we've got one incoming. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-25fix s_client crashRich Salz
The 'http proxy' commit broke s_client default host/port value. Thanks to Matt for the simplest fix. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-24Set first_packet for TLS clientsMatt Caswell
Version negotiation was broken (one of the late changes in the review process broke it). The problem is that TLS clients do not set first_packet, whereas TLS/DTLS servers and DTLS clients do. The simple fix is to set first_packet for TLS clients too. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-24bn/asm/x86_64-mont5.pl: fix valgrind error.Andy Polyakov
bn_get_bits5 was overstepping array boundary by 1 byte. It was exclusively read overstep and data could not have been used. The only potential problem would be if array happens to end on the very edge of last accesible page. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-24bn/bn_gf2m.c: appease STACK, unstable code detector.Andy Polyakov
RT#3852 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-23Fix update and depend in engines/Richard Levitte
The update: target in engines/ didn't recurse into engines/ccgost. The update: and depend: targets in engines/ccgost needed a fixup. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-23Missed a couple of spots in the update changeRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-22Fix typo setting up certificate masksMatt Caswell
The certificate masks are used to select which ciphersuite we are going to use. The variables |emask_k| and |emask_a| relate to export grade key exchange and authentication respecitively. The variables |mask_k| and |mask_a| are the equivalent versions for non-export grade. This fixes an instance where the two usages of export/non-export were mixed up. In practice it makes little difference since it still works! Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22Remove export static DH ciphersuitesMatt Caswell
Remove support for the two export grade static DH ciphersuites. These two ciphersuites were newly added (along with a number of other static DH ciphersuites) to 1.0.2. However the two export ones have *never* worked since they were introduced. It seems strange in any case to be adding new export ciphersuites, and given "logjam" it also does not seem correct to fix them. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22Fix off-by-one in BN_randMatt Caswell
If BN_rand is called with |bits| set to 1 and |top| set to 1 then a 1 byte buffer overflow can occur. There are no such instances within the OpenSSL at the moment. Thanks to Mateusz Kocielski (LogicalTrust), Marek Kroemeke, Filip Palian for discovering and reporting this issue. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-22Reject negative shifts for BN_rshift and BN_lshiftMatt Caswell
The functions BN_rshift and BN_lshift shift their arguments to the right or left by a specified number of bits. Unpredicatable results (including crashes) can occur if a negative number is supplied for the shift value. Thanks to Mateusz Kocielski (LogicalTrust), Marek Kroemeke and Filip Palian for discovering and reporting this issue. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-22Add CHANGES entry for OPENSSL_NO_TLSEXT removalMatt Caswell
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22Remove support for OPENSSL_NO_TLSEXTMatt Caswell
Given the pervasive nature of TLS extensions it is inadvisable to run OpenSSL without support for them. It also means that maintaining the OPENSSL_NO_TLSEXT option within the code is very invasive (and probably not well tested). Therefore it is being removed. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22RT266: Add HTTP proxy/CONNECT to s_clientMichael Trapp
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22Fix the update target and remove duplicate file updatesRichard Levitte
We had updates of certain header files in both Makefile.org and the Makefile in the directory the header file lived in. This is error prone and also sometimes generates slightly different results (usually just a comment that differs) depending on which way the update was done. This removes the file update targets from the top level Makefile, adds an update: target in all Makefiles and has it depend on the depend: or local_depend: targets, whichever is appropriate, so we don't get a double run through the whole file tree. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-22Ignore files from other branchesMatt Caswell
There are a number of files that are created on other branches that are not held in git and are not needed in master. When checking out master after working on another branch these files show up in "git status", so just add them to .gitignore Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22Lost alert in DTLSLubom
If a client receives a bad hello request in DTLS then the alert is not sent correctly. RT#2801 Signed-off-by: Matt Caswell <matt@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-22Fix various OPENSSL_NO_* optionsMatt Caswell
This fixes compilation with various OPENSSL_NO_* options that got broken during the big apps cleanup. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-22Fix a memory leak in compressionMatt Caswell
The function RECORD_LAYER_clear() is supposed to clear the contents of the RECORD_LAYER structure, but retain certain data such as buffers that are allocated. Unfortunately one buffer (for compression) got missed and was inadvertently being wiped, thus causing a memory leak. In part this is due to the fact that RECORD_LAYER_clear() was reaching inside SSL3_BUFFERs and SSL3_RECORDs, which it really shouldn't. So, I've rewritten it to only clear the data it knows about, and to defer clearing of SSL3_RECORD and SSL3_BUFFER structures to SSL_RECORD_clear() and the new function SSL3_BUFFER_clear(). Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-21make updateDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-21correctionDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-21Add scrypt PBE algorithm code.Dr. Stephen Henson
This adds support for the ASN.1 structures in draft-josefsson-scrypt-kdf-03 Private keys encrypted by scrypt can now be decrypted transparently as long as they don't exceed the memory limits. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-21Add scrypt OID from draft-josefsson-scrypt-kdf-03Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-20Replace switch/assignments with table lookupRich Salz
Typedef STRINT_PAIR to be the same as OPT_PAIR, and use that structure and a bunch of tables instead of switch statements to lookup various values out of the SSL/TLS message buffers. Shrinks a bunch of code. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-20Correctly check for export size limitKurt Roeckx
40 bit ciphers are limited to 512 bit RSA, 56 bit ciphers to 1024 bit. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-20Add functions to convert between uint64_t and ASN1_INTEGER.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-20Only support >= 256-bit elliptic curves with ecdh_auto (server) or by ↵Emilia Kasper
default (client). Also reorder preferences to prefer prime curves to binary curves, and P-256 to everything else. The result: $ openssl s_server -named_curves "auto" This command will negotiate an ECDHE ciphersuite with P-256: $ openssl s_client This command will negotiate P-384: $ openssl s_client -curves "P-384" This command will not negotiate ECDHE because P-224 is disabled with "auto": $ openssl s_client -curves "P-224" Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-20Remove dh512.pemEmilia Kasper
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-20Update documentation with Diffie-Hellman best practices.Emilia Kasper
- Do not advise generation of DH parameters with dsaparam to save computation time. - Promote use of custom parameters more, and explicitly forbid use of built-in parameters weaker than 2048 bits. - Advise the callback to ignore <keylength> - it is currently called with 1024 bits, but this value can and should be safely ignored by servers. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-20dhparam: fix documentationEmilia Kasper
The default bitlength is now 2048. Also clarify that either the number of bits or the generator must be present: $ openssl dhparam -2 and $ openssl dhparam 2048 generate parameters but $ openssl dhparam does not. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-20make updateDr. Stephen Henson
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-05-20Add scrypt tests.Dr. Stephen Henson
Add scrypt test support to evp_test and add test values from from draft-josefsson-scrypt-kdf-03. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-20Add scrypt support.Dr. Stephen Henson
Add scrypt algorithm as described in draft-josefsson-scrypt-kdf-03 Reviewed-by: Rich Salz <rsalz@openssl.org>