summaryrefslogtreecommitdiffstats
path: root/crypto/dh
AgeCommit message (Collapse)Author
2018-08-14Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6955)
2018-06-12Reject excessively large primes in DH key generation.Guido Vranken
CVE-2018-0732 Signed-off-by: Guido Vranken <guidovranken@gmail.com> (cherry picked from commit 91f7361f47b082ae61ffe1a7b17bb2adf213c7fe) Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6457)
2018-04-19Return 0 on a non-matching kdf_typeMatt Caswell
If we have a non-matching kdf_type then pkey_dh_derive silently succeeds. It should fail. This is a "should not happen" condition anyway so the impact is negligible. Fixes #2440 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6000)
2017-12-08Standardize syntax around sizeof(foo)Rich Salz
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4875)
2017-11-02make updateMatt Caswell
Reviewed-by: Andy Polyakov <appro@openssl.org>
2017-08-15Fix 'no-cms'Richard Levitte
Fixes #3867 Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3873)
2017-04-03Add missing macros for DHxparamsMatt Caswell
DHparams has d2i_DHparams_fp, d2i_DHxparams_bio etc, but the equivalent macros for DHxparams were omitted. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3112)
2017-01-24Fix error handling in compute_key, BN_CTX_get can return NULLBernd Edlinger
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2132) (cherry picked from commit 7928ee4d685b727619555bc1ec0aee805f6fc8c4)
2016-05-31Parameter copy sanity checks.Dr. Stephen Henson
Don't copy parameters is they're already present in the destination. Return error if an attempt is made to copy different parameters to destination. Update documentation. If key type is not initialised return missing parameters RT#4149 Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit f72f00d49549c6620d7101f5e9bf7963da6df9ee)
2016-01-29Add missing return value checksMatt Caswell
The function DH_check_pub_key() was missing some return value checks in some calls to BN functions. RT#4278 Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit f5a12207eccfd814bde68b880a96910dfa25f164)
2016-01-29Correct value of DH_CHECK_PUBKEY_INVALIDMatt Caswell
A new return value for DH_check_pub_key was recently added: DH_CHECK_PUBKEY_INVALID. As this is a flag which can be ORed with other return values it should have been set to the value 4 not 3. RT#4278 Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit cb389fe80462e20daba30835a9e86354451bd14f)
2016-01-28Add a test for small subgroup attacks on DH/DHEMatt Caswell
Following on from the previous commit, add a test to ensure that DH_compute_key correctly fails if passed a bad y such that: y^q (mod p) != 1 Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-28Prevent small subgroup attacks on DH/DHEMatt Caswell
Historically OpenSSL only ever generated DH parameters based on "safe" primes. More recently (in version 1.0.2) support was provided for generating X9.42 style parameter files such as those required for RFC 5114 support. The primes used in such files may not be "safe". Where an application is using DH configured with parameters based on primes that are not "safe" then an attacker could use this fact to find a peer's private DH exponent. This attack requires that the attacker complete multiple handshakes in which the peer uses the same DH exponent. A simple mitigation is to ensure that y^q (mod p) == 1 CVE-2016-0701 (fix part 1 of 2) Issue reported by Antonio Sanso. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-10-07Properly check return type of DH_compute_key()Pascal Cuoq
It returns -1 on error, not 0. Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> MR #1231 (cherry picked from commit d6e92c0bd6c36fc68291e79ef5753fd7f0420695)
2015-09-15RT4044: Remove .cvsignore files.Rich Salz
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-31RT3959: Fix misleading commentNicholas Cooper
Manual cherry-pick from main branch, since the header file moved in master. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-23Fix 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> (cherry picked from commit 0f539dc1a2f45580435c39dada44dd276e79cb88) Conflicts: Makefile.org apps/Makefile test/Makefile
2015-04-16Code style: space after 'if'Viktor Dukhovni
Reviewed-by: Matt Caswell <gitlab@openssl.org>
2015-03-12Fix dh_pub_encodeMatt Caswell
The return value from ASN1_STRING_new() was not being checked which could lead to a NULL deref in the event of a malloc failure. Also fixed a mem leak in the error path. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 6aa8dab2bbfd5ad3cfc0d07fe5d7243635d5b2a2)
2015-03-08Cleanse PKCS#8 private key components.Dr. Stephen Henson
New function ASN1_STRING_clear_free which cleanses an ASN1_STRING structure before freeing it. Call ASN1_STRING_clear_free on PKCS#8 private key components. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit a8ae0891d4bfd18f224777aed1fbb172504421f1)
2015-03-05Unchecked malloc fixesMatt Caswell
Miscellaneous unchecked malloc fixes. Also fixed some mem leaks on error paths as I spotted them along the way. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 918bb8652969fd53f0c390c1cd909265ed502c7e) Conflicts: crypto/bio/bss_dgram.c
2015-02-22Fix memory leakKurt Roeckx
Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit edac5dc220d494dff7ee259dfd84335ffa50e938)
2015-02-22Avoid a double-free in an error path.Doug Hogan
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 1549a265209d449b6aefd2b49d7d39f7fbe0689b)
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22indent has problems with comments that are on the right hand side of a line.Matt Caswell
Sometimes it fails to format them very well, and sometimes it corrupts them! This commit moves some particularly problematic ones. Conflicts: crypto/bn/bn.h crypto/ec/ec_lcl.h crypto/rsa/rsa.h demos/engines/ibmca/hw_ibmca.c ssl/ssl.h ssl/ssl3.h Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix source where indent will not be able to copeMatt Caswell
Conflicts: apps/ciphers.c ssl/s3_pkt.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22mark all block comments that need format preserving so thatTim Hudson
indent will not alter them when reformatting comments (cherry picked from commit 1d97c8435171a7af575f73c526d79e1ef0ee5960) Conflicts: crypto/bn/bn_lcl.h crypto/bn/bn_prime.c crypto/engine/eng_all.c crypto/rc4/rc4_utl.c crypto/sha/sha.h ssl/kssl.c ssl/t1_lib.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-07Fix irix-cc build.Andy Polyakov
Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit e464403d0bda2f1f74eb68582e4988e591c32433)
2014-03-06dh_check.c: check BN_CTX_get's return value.Andy Polyakov
(cherry picked from commit 53e5161231854d64fd89e993944609a329a92db4)
2013-12-01make updateDr. Stephen Henson
2013-10-01Fix compile errors.Ben Laurie
(cherry picked from commit a0aaa5660a29f0faa86e5e51ce889299c5f3098b)
2013-10-01CMS RFC2631 X9.42 DH enveloped data support.Dr. Stephen Henson
(cherry picked from commit bd59f2b91db8fab86e8610de4565b5ab8de2b44b) Conflicts: crypto/dh/dh.h crypto/dh/dh_err.c Sync error codes with 1.0.1.
2013-10-01Add KDF for DH.Dr. Stephen Henson
Add X9.42 DH KDF. Move sharedinfo generation code to CMS library as the same structure is used by DH and ECDH. Move ASN1_OBJECT typedef to ossl_typ.h so it can be picked up by dh headers without the need to use ASN1. (cherry picked from commit dc1ce3bc64845d16314af1f11acf5384e4ae9b34)
2013-10-01Extend DH parameter generation support.Dr. Stephen Henson
Add support for DH parameter generation using DSA methods including FIPS 186-3. (cherry picked from commit 3909087801729bebb3a1182936a855a47e4ee9c9)
2013-10-01Enhance DH dup functions.Dr. Stephen Henson
Make DHparams_dup work properly with X9.42 DH parameters. (cherry picked from commit d3cc91eee2cba07d8908f0fea531c62863ed3ccf)
2013-10-01If present print j, seed and counter values for DHDr. Stephen Henson
(cherry picked from commit c9577ab5eae56cb00c17a0eb724229f0bc1397a0) Conflicts: crypto/dh/dh_ameth.c
2013-10-01New SP 800-56A compliant version of DH_compute_key().Dr. Stephen Henson
(cherry picked from commit bc91494e064ebdcff68f987947f97e404fbca0b5)
2012-06-03Reduce version skew: trivia (I hope).Ben Laurie
2012-04-07Initial experimental support for X9.42 DH parameter format to handleDr. Stephen Henson
RFC5114 parameters and X9.42 DH public and private keys. (backport from HEAD)
2012-04-07branches: 1.2.2;Dr. Stephen Henson
Correct some parameter values. (backport from HEAD)
2012-04-07Update DH_check() to peform sensible checks when q parameter is present.Dr. Stephen Henson
(backport from HEAD)
2012-04-07Add RFC5114 DH parameters to OpenSSL. Add test data to dhtest.Dr. Stephen Henson
(backport from HEAD)
2011-11-14DH keys have an (until now) unused 'q' parameter. When creating from DSA copyDr. Stephen Henson
q across and if q present generate DH key in the correct range. (from HEAD)
2011-10-09Backport PSS signature support from HEAD.Dr. Stephen Henson
2011-09-16make dependDr. Stephen Henson
2011-09-16Improved error checking for DRBG calls.Dr. Stephen Henson
New functionality to allow default DRBG type to be set during compilation or during runtime.
2011-06-20Don't set default public key methods in FIPS mode so applicationsDr. Stephen Henson
can switch between modes.
2011-06-09Redirect DH key and parameter generation.Dr. Stephen Henson
2011-06-08Redirect DH operations to FIPS module. Block non-FIPS methods.Dr. Stephen Henson
Sync DH error codes with HEAD.
2009-09-06PR: 1644Dr. Stephen Henson
Submitted by: steve@openssl.org Fix to make DHparams_dup() et al work in C++. For 1.0 fix the final argument to ASN1_dup() so it is void *. Replace some *_dup macros with functions.