X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=crypto%2Fdsa%2Fdsa_depr.c;h=f14e5876468f46b9cb5b1e70f6da78f08779244d;hb=b39fc560612984e65ec30d7f37487303bf514fb3;hp=f2da680eb466a4c1ff9d888b887fc920a8cfd347;hpb=9d473aa2e4076beb959bc9701786a0860877ee12;p=thirdparty%2Fopenssl.git diff --git a/crypto/dsa/dsa_depr.c b/crypto/dsa/dsa_depr.c index f2da680eb4..f14e587646 100644 --- a/crypto/dsa/dsa_depr.c +++ b/crypto/dsa/dsa_depr.c @@ -7,7 +7,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -53,29 +53,23 @@ * */ -/* This file contains deprecated function(s) that are now wrappers to the new - * version(s). */ - -#undef GENUINE_DSA - -#ifdef GENUINE_DSA -/* Parameter generation follows the original release of FIPS PUB 186, - * Appendix 2.2 (i.e. use SHA as defined in FIPS PUB 180) */ -#define HASH EVP_sha() -#else -/* Parameter generation follows the updated Appendix 2.2 for FIPS PUB 186, - * also Appendix 2.2 of FIPS PUB 186-1 (i.e. use SHA as defined in - * FIPS PUB 180-1) */ -#define HASH EVP_sha1() -#endif +/* + * This file contains deprecated function(s) that are now wrappers to the new + * version(s). + */ -static void *dummy=&dummy; +/* + * Parameter generation follows the updated Appendix 2.2 for FIPS PUB 186, + * also Appendix 2.2 of FIPS PUB 186-1 (i.e. use SHA as defined in FIPS PUB + * 180-1) + */ +#define xxxHASH EVP_sha1() -#ifndef OPENSSL_NO_SHA +static void *dummy = &dummy; #include #include -#include "cryptlib.h" +#include "internal/cryptlib.h" #include #include #include @@ -84,23 +78,30 @@ static void *dummy=&dummy; #ifndef OPENSSL_NO_DEPRECATED DSA *DSA_generate_parameters(int bits, - unsigned char *seed_in, int seed_len, - int *counter_ret, unsigned long *h_ret, - void (*callback)(int, int, void *), - void *cb_arg) - { - BN_GENCB cb; - DSA *ret; + unsigned char *seed_in, int seed_len, + int *counter_ret, unsigned long *h_ret, + void (*callback) (int, int, void *), + void *cb_arg) +{ + BN_GENCB *cb; + DSA *ret; - if ((ret=DSA_new()) == NULL) return NULL; + if ((ret = DSA_new()) == NULL) + return NULL; + cb = BN_GENCB_new(); + if (!cb) + goto err; - BN_GENCB_set_old(&cb, callback, cb_arg); + BN_GENCB_set_old(cb, callback, cb_arg); - if(DSA_generate_parameters_ex(ret, bits, seed_in, seed_len, - counter_ret, h_ret, &cb)) - return ret; - DSA_free(ret); - return NULL; - } -#endif + if (DSA_generate_parameters_ex(ret, bits, seed_in, seed_len, + counter_ret, h_ret, cb)) { + BN_GENCB_free(cb); + return ret; + } + BN_GENCB_free(cb); +err: + DSA_free(ret); + return NULL; +} #endif