From: Geoff Thorpe Date: Wed, 29 Oct 2003 04:06:50 +0000 (+0000) Subject: When OPENSSL_NO_DEPRECATED is defined, deprecated functions are (or should X-Git-Tag: BEN_FIPS_TEST_4^2~11^2~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d473aa2e4076beb959bc9701786a0860877ee12;p=thirdparty%2Fopenssl.git When OPENSSL_NO_DEPRECATED is defined, deprecated functions are (or should be) precompiled out in the API headers. This change is to ensure that if it is defined when compiling openssl, the deprecated functions aren't implemented either. --- diff --git a/CHANGES b/CHANGES index c0f18ff1b45..666cf68d647 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,10 @@ Changes between 0.9.7c and 0.9.8 [xx XXX xxxx] + *) Ensure that deprecated functions do not get compiled when + OPENSSL_NO_DEPRECATED is defined. + [Geoff Thorpe] + *) Reorganise PKCS#7 code to separate the digest location functionality into PKCS7_find_digest(), digest addtion into PKCS7_bio_add_digest(). New function PKCS7_set_digest() to set the digest type for PKCS#7 diff --git a/crypto/bn/bn_depr.c b/crypto/bn/bn_depr.c index 35e91272881..09ad52e7c63 100644 --- a/crypto/bn/bn_depr.c +++ b/crypto/bn/bn_depr.c @@ -62,6 +62,9 @@ #include "bn_lcl.h" #include +static void *dummy=&dummy; + +#ifndef OPENSSL_NO_DEPRECATED BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add, const BIGNUM *rem, void (*callback)(int,int,void *), void *cb_arg) @@ -78,6 +81,7 @@ BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, } else rnd=ret; + bn_verify(rnd); if(!BN_generate_prime_ex(rnd, bits, safe, add, rem, &cb)) goto err; @@ -85,6 +89,7 @@ BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, found = 1; err: if (!found && (ret == NULL) && (rnd != NULL)) BN_free(rnd); + if(found) bn_verify(rnd); return(found ? rnd : NULL); } @@ -106,3 +111,4 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks, return BN_is_prime_fasttest_ex(a, checks, ctx_passed, do_trial_division, &cb); } +#endif diff --git a/crypto/dh/dh_depr.c b/crypto/dh/dh_depr.c index 3eb319e2a85..acc05f252c1 100644 --- a/crypto/dh/dh_depr.c +++ b/crypto/dh/dh_depr.c @@ -61,6 +61,9 @@ #include #include +static void *dummy=&dummy; + +#ifndef OPENSSL_NO_DEPRECATED DH *DH_generate_parameters(int prime_len, int generator, void (*callback)(int,int,void *), void *cb_arg) { @@ -77,3 +80,4 @@ DH *DH_generate_parameters(int prime_len, int generator, DH_free(ret); return NULL; } +#endif diff --git a/crypto/dsa/dsa_depr.c b/crypto/dsa/dsa_depr.c index cb80457211e..f2da680eb46 100644 --- a/crypto/dsa/dsa_depr.c +++ b/crypto/dsa/dsa_depr.c @@ -69,6 +69,8 @@ #define HASH EVP_sha1() #endif +static void *dummy=&dummy; + #ifndef OPENSSL_NO_SHA #include @@ -80,6 +82,7 @@ #include #include +#ifndef OPENSSL_NO_DEPRECATED DSA *DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len, int *counter_ret, unsigned long *h_ret, @@ -100,3 +103,4 @@ DSA *DSA_generate_parameters(int bits, return NULL; } #endif +#endif diff --git a/crypto/rsa/rsa_depr.c b/crypto/rsa/rsa_depr.c index 3773d037c65..2d87cd39f31 100644 --- a/crypto/rsa/rsa_depr.c +++ b/crypto/rsa/rsa_depr.c @@ -62,6 +62,9 @@ #include #include +static void *dummy=&dummy; + +#ifndef OPENSSL_NO_DEPRECATED RSA *RSA_generate_key(int bits, unsigned long e_value, void (*callback)(int,int,void *), void *cb_arg) { @@ -78,4 +81,4 @@ RSA *RSA_generate_key(int bits, unsigned long e_value, RSA_free(rsa); return 0; } - +#endif