aboutsummaryrefslogtreecommitdiff
path: root/crypto/dh/dh_check.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-29Add missing return value checksMatt Caswell1-4/+3
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>
2016-01-28Prevent small subgroup attacks on DH/DHEMatt Caswell1-9/+25
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 Issue reported by Antonio Sanso. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz1-1/+0
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte1-1/+1
There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-30free NULL cleanup 7Rich Salz1-2/+1
This gets BN_.*free: BN_BLINDING_free BN_CTX_free BN_FLG_FREE BN_GENCB_free BN_MONT_CTX_free BN_RECP_CTX_free BN_clear_free BN_free BUF_MEM_free Also fix a call to DSA_SIG_free to ccgost engine and remove some #ifdef'd dead code in engines/e_ubsec. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-02-03Dead code: crypto/dh,modes,pkcs12,ripemd,rsa,srpRich Salz1-9/+1
And an uncompiled C++ test file. Also remove srp_lcl.h, with help from Richard. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell1-97/+96
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-30mark all block comments that need format preserving so thatTim Hudson1-1/+2
indent will not alter them when reformatting comments Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2014-03-06dh_check.c: check BN_CTX_get's return value.Andy Polyakov1-0/+1
2011-12-01Update DH_check() to peform sensible checks when q parameter is present.Dr. Stephen Henson1-9/+39
2007-09-24TyposLutz Jänicke1-1/+1
PR: 1578 Submitted by: Charles Longeau <chl@tuxfamily.org>
2005-08-21Make D-H safer, include well-known primes.Ben Laurie1-0/+22
2002-12-08This is a first-cut at improving the callback mechanisms used inGeoff Thorpe1-2/+2
key-generation and prime-checking functions. Rather than explicitly passing callback functions and caller-defined context data for the callbacks, a new structure BN_GENCB is defined that encapsulates this; a pointer to the structure is passed to all such functions instead. This wrapper structure allows the encapsulation of "old" and "new" style callbacks - "new" callbacks return a boolean result on the understanding that returning FALSE should terminate keygen/primality processing. The BN_GENCB abstraction will allow future callback modifications without needing to break binary compatibility nor change the API function prototypes. The new API functions have been given names ending in "_ex" and the old functions are implemented as wrappers to the new ones. The OPENSSL_NO_DEPRECATED symbol has been introduced so that, if defined, declaration of the older functions will be skipped. NB: Some openssl-internal code will stick with the older callbacks for now, so appropriate "#undef" logic will be put in place - this is in case the user is *building* openssl (rather than *including* its headers) with this symbol defined. There is another change in the new _ex functions; the key-generation functions do not return key structures but operate on structures passed by the caller, the return value is a boolean. This will allow for a smoother transition to having key-generation as "virtual function" in the various ***_METHOD tables.
2000-11-07Constify DH-related code.Richard Levitte1-1/+1
2000-01-22Document the DH library, and make some minor changes along the way.Ulf Möller1-6/+8
2000-01-12Turn BN_prime_checks into a macro.Bodo Möller1-2/+2
Primes p where (p-1)/2 is prime too are called "safe", not "strong".
1999-04-23Change #include filenames from <foo.h> to <openssl.h>.Bodo Möller1-2/+2
Submitted by: Reviewed by: PR:
1999-04-19Change functions to ANSI C.Ulf Möller1-3/+1
1998-12-21Import of old SSLeay release: SSLeay 0.9.0bRalf S. Engelschall1-3/+3
1998-12-21Import of old SSLeay release: SSLeay 0.8.1bRalf S. Engelschall1-0/+120