aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/dsa/dsa_lib.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix double free bug in error pathMatt Caswell2016-04-091-0/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Make DH opaqueMatt Caswell2016-04-091-12/+28
| | | | | | | Move the dh_st structure into an internal header file and provide relevant accessors for the internal fields. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Make DSA_METHOD opaqueMatt Caswell2016-04-031-20/+18
| | | | | | | | Move the dsa_method structure out of the public header file, and provide getter and setter functions for creating and modifying custom DSA_METHODs. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>
* Make the DSA structure opaqueMatt Caswell2016-04-031-1/+74
| | | | | | | | | Move the dsa_st structure out of the public header file. Add some accessor functions to enable access to the internal fields, and update all internal usage to use the new functions. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>
* Remove #error from include files.Rich Salz2016-03-201-6/+2
| | | | | | | | Don't have #error statements in header files, but instead wrap the contents of that file in #ifndef OPENSSL_NO_xxx This means it is now always safe to include the header file. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Convert CRYPTO_LOCK_{DH,DSA,RSA} to new multi-threading APIAlessandro Ghedini2016-03-081-5/+18
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove kinv/r fields from DSA structure.Dr. Stephen Henson2016-03-071-2/+0
| | | | | | | The kinv/r fields in the DSA structure are not used by OpenSSL internally and should not be used in general. Reviewed-by: Rich Salz <rsalz@openssl.org>
* GH715: Missed some null-check-removals. follow commits 412bafdcf5, and ↵FdaSilvaYY2016-02-281-4/+2
| | | | | | | 7c96dbcdab Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* GH715: ENGINE_finish can take NULLRich Salz2016-02-251-5/+3
| | | | | | | Simplifies calling code. Also fixed up any !ptr tests that were nearby, turning them into NULL tests. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Move to REF_DEBUG, for consistency.Rich Salz2016-02-111-18/+5
| | | | | | | Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT This is also RT 4181 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-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>
* Check for missing DSA parameters.Dr. Stephen Henson2015-12-301-1/+3
| | | | | | | | | | | | | If DSA parameters are absent return -1 (for unknown) in DSA_security_bits. If parameters are absent when a certificate is set in an SSL/SSL_CTX structure this will reject the certificate by default. This will cause DSA certificates which omit parameters to be rejected but that is never (?) done in practice. Thanks to Brian 'geeknik' Carpenter for reporting this issue. Reviewed-by: Emilia Käsper <emilia@openssl.org>
* ex_data part 2: doc fixes and CRYPTO_free_ex_index.Rich Salz2015-12-011-7/+0
| | | | | | | | | | 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>
* remove 0 assignments.Rich Salz2015-09-031-14/+1
| | | | | | | After openssl_zalloc, cleanup more "set to 0/NULL" assignments. Many are from github feedback. Reviewed-by: Tim Hudson <tjh@openssl.org>
* RT3999: Remove sub-component version stringsRich Salz2015-08-101-2/+0
| | | | | | Especially since after the #ifdef cleanups this is not useful. Reviewed-by: Matt Caswell <matt@openssl.org>
* Identify and move common internal libcrypto header filesRichard Levitte2015-05-141-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>
* Use safer sizeof variant in mallocRich Salz2015-05-041-1/+1
| | | | | | | | | | | | | For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
* free NULL cleanup 7Rich Salz2015-04-301-14/+7
| | | | | | | | | | | 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>
* remove malloc castsRich Salz2015-04-281-1/+1
| | | | | | | Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Simplify DSA public key handling.Dr. Stephen Henson2015-03-261-1/+0
| | | | | | | | | | | | DSA public keys could exist in two forms: a single Integer type or a SEQUENCE containing the parameters and public key with a field called "write_params" deciding which form to use. These forms are non standard and were only used by functions containing "DSAPublicKey" in the name. Simplify code to only use the parameter form and encode the public key component directly in the DSA public key method. Reviewed-by: Richard Levitte <levitte@openssl.org>
* free NULL cleanupRich Salz2015-03-241-2/+1
| | | | | | | | Start ensuring all OpenSSL "free" routines allow NULL, and remove any if check before calling them. This gets DH_free, DSA_free, RSA_free Reviewed-by: Matt Caswell <matt@openssl.org>
* Run util/openssl-format-source -v -c .Matt Caswell2015-01-221-204/+205
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Add functions returning security bits.Dr. Stephen Henson2014-03-281-0/+5
| | | | | Add functions to return the "bits of security" for various public key algorithms. Based on SP800-57.
* Make sure overrides work for RSA/DSA.Dr. Stephen Henson2011-04-231-1/+1
|
* DH keys have an (until now) unused 'q' parameter. When creatingDr. Stephen Henson2011-04-071-1/+6
| | | | | from DSA copy q across and if q present generate DH key in the correct range.
* Constify version strings and some structures.Dr. Stephen Henson2007-01-211-1/+1
|
* makeNils Larsch2005-07-161-0/+2
| | | | | | | | ./configure no-deprecated [no-dsa] [no-dh] [no-ec] [no-rsa] make depend all test work again PR: 1159
* (oops) Apologies all, that last header-cleanup commit was from the wrongGeoff Thorpe2004-04-191-0/+1
| | | | | tree. This further reduces header interdependencies, and makes some associated cleanups.
* Add the possibility to build without the ENGINE framework.Richard Levitte2003-01-301-0/+10
| | | | PR: 287
* Remove incorrect assert.Richard Levitte2002-11-291-2/+4
| | | | PR: 360
* Security fixes brought forward from 0.9.7.Ben Laurie2002-11-131-0/+1
|
* Make {RSA,DSA,DH}_new_method obtain and release an ENGINEDr. Stephen Henson2002-03-091-4/+15
| | | | functional reference in all cases.
* This commits changes to various parts of libcrypto required by the recentGeoff Thorpe2001-09-251-75/+42
| | | | | | | | | | | ENGINE surgery. DH, DSA, RAND, and RSA now use *both* "method" and ENGINE pointers to manage their hooking with ENGINE. Previously their use of "method" pointers was replaced by use of ENGINE references. See crypto/engine/README for details. Also, remove the ENGINE iterations from evp_test - even when the cipher/digest code is committed in, this functionality would require a different set of API calls.
* Rename recently introduced functions for improved code clarity:Bodo Möller2001-09-031-2/+2
| | | | [DR]SA_up => [DR]SA_up_ref
* Make the necessary changes to work with the recent "ex_data" overhaul.Geoff Thorpe2001-09-011-9/+5
| | | | | | | | | | | See the commit log message for that for more information. NB: X509_STORE_CTX's use of "ex_data" support was actually misimplemented (initialisation by "memset" won't/can't/doesn't work). This fixes that but requires that X509_STORE_CTX_init() be able to handle errors - so its prototype has been changed to return 'int' rather than 'void'. All uses of that function throughout the source code have been tracked down and adjusted.
* Give DH, DSA, and RSA functions to "up" their reference counts. Otherwise,Geoff Thorpe2001-08-251-0/+16
| | | | | | | dependant code has to directly increment the "references" value of each such structure using the corresponding lock. Apart from code duplication, this provided no "REF_CHECK/REF_PRINT" checking and violated encapsulation.
* The indexes returned by ***_get_ex_new_index() functions are used whenGeoff Thorpe2001-08-121-3/+4
| | | | | | | | setting stack (actually, array) values in ex_data. So only increment the global counters if the underlying CRYPTO_get_ex_new_index() call succeeds. This change doesn't make "ex_data" right (see the comment at the head of ex_data.c to know why), but at least makes the source code marginally less frustrating.
* Fix problem occuring when used from OpenSSH on Solaris 8.Lutz Jänicke2001-07-261-1/+1
|
* In {RSA,DSA,DH}_new_method(x) need to increase the referenceDr. Stephen Henson2001-06-231-8/+15
| | | | | count of the ENGINE is x is not NULL since it will be freed in {RSA,DSA,DH}_free().
* In RSA, DSA, DH, and RAND - if the "***_new()" function fails because theGeoff Thorpe2001-04-301-0/+1
| | | | ENGINE code does not return a default, set an error.
* Make all configuration macros available for application by makingRichard Levitte2001-02-191-1/+1
| | | | | | | | | | | | sure they are available in opensslconf.h, by giving them names starting with "OPENSSL_" to avoid conflicts with other packages and by making sure e_os2.h will cover all platform-specific cases together with opensslconf.h. I've checked fairly well that nothing breaks with this (apart from external software that will adapt if they have used something like NO_KRB5), but I can't guarantee it completely, so a review of this change would be a good thing.
* Do to DH and DSA what has already been done to RSA. This involves movingGeoff Thorpe2000-11-291-4/+4
| | | | | the initialisation and cleanup of "ex_data" elements to before an init() handler and after a finish() handler respectively.
* Constify DSA-related code.Richard Levitte2000-11-071-8/+8
|
* Merge the engine branch into the main trunk. All conflicts resolved.Richard Levitte2000-10-261-8/+59
| | | | At the same time, add VMS support for Rijndael.
* There have been a number of complaints from a number of sources that namesRichard Levitte2000-06-011-3/+3
| | | | | | | | | like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
* The handling of DSA_METHOD and DH_METHOD wasn't quite as problematic asGeoff Thorpe2000-04-201-2/+1
| | | | | | with RSA_METHOD (the **_get_default_methods do set the default value if it's not set). However, the code had some duplication and was a bit conter-intuitive.
* Tidy up CRYPTO_EX_DATA structures.Dr. Stephen Henson2000-01-231-7/+7
|
* Initial support for DH_METHOD. Also added a DH lock. A few changes made toDr. Stephen Henson1999-08-231-6/+3
| | | | DSA_METHOD to make it more consistent with RSA_METHOD.
* Initial support for DSA_METHOD...Dr. Stephen Henson1999-08-221-1/+66
|
* fix the bugBodo Möller1999-08-061-1/+1
|