From: Matt Caswell Date: Wed, 17 Dec 2014 13:30:41 +0000 (+0000) Subject: Change all instances of OPENSSL_NO_DEPRECATED to OPENSSL_USE_DEPRECATED X-Git-Tag: master-post-reformat~128 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=53e95716f5c11a8a9cbdcbbb3be0e8e538b5a2ea;p=oweals%2Fopenssl.git Change all instances of OPENSSL_NO_DEPRECATED to OPENSSL_USE_DEPRECATED Introduce use of DECLARE_DEPRECATED Reviewed-by: Rich Salz --- diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h index 37adcb312a..68be533d40 100644 --- a/crypto/asn1/asn1.h +++ b/crypto/asn1/asn1.h @@ -70,7 +70,7 @@ #include #include -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #endif diff --git a/crypto/bn/bn.h b/crypto/bn/bn.h index 6bccbfe45a..5daee3858a 100644 --- a/crypto/bn/bn.h +++ b/crypto/bn/bn.h @@ -263,13 +263,13 @@ extern "C" { * BN_mod_inverse() will call BN_mod_inverse_no_branch. */ -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME /* deprecated name for the flag */ /* avoid leaking exponent information through timings * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */ #endif -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #define BN_FLG_FREE 0x8000 /* used for debuging */ #endif @@ -342,7 +342,7 @@ int BN_is_odd(const BIGNUM *a); void BN_zero_ex(BIGNUM *a); -#ifdef OPENSSL_NO_DEPRECATED +#ifndef OPENSSL_USE_DEPRECATED #define BN_zero(a) BN_zero_ex(a) #else #define BN_zero(a) (BN_set_word((a),0)) @@ -464,17 +464,17 @@ BIGNUM *BN_mod_sqrt(BIGNUM *ret, void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); /* Deprecated versions */ -#ifndef OPENSSL_NO_DEPRECATED -BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe, +#ifdef OPENSSL_USE_DEPRECATED +DECLARE_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); -int BN_is_prime(const BIGNUM *p,int nchecks, + void (*callback)(int,int,void *),void *cb_arg)); +DECLARE_DEPRECATED(int BN_is_prime(const BIGNUM *p,int nchecks, void (*callback)(int,int,void *), - BN_CTX *ctx,void *cb_arg); -int BN_is_prime_fasttest(const BIGNUM *p,int nchecks, + BN_CTX *ctx,void *cb_arg)); +DECLARE_DEPRECATED(int BN_is_prime_fasttest(const BIGNUM *p,int nchecks, void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg, - int do_trial_division); -#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + int do_trial_division)); +#endif /* defined(OPENSSL_USE_DEPRECATED) */ /* Newer versions */ int BN_generate_prime_ex(BIGNUM *ret,int bits,int safe, const BIGNUM *add, @@ -517,9 +517,9 @@ int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *); int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *); -#ifndef OPENSSL_NO_DEPRECATED -unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *); -void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long); +#ifdef OPENSSL_USE_DEPRECATED +DECLARE_DEPRECATED(unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *)); +DECLARE_DEPRECATED(void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long)); #endif CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *); unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); @@ -530,9 +530,9 @@ BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), BN_MONT_CTX *m_ctx); -#ifndef OPENSSL_NO_DEPRECATED -void BN_set_params(int mul,int high,int low,int mont); -int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ +#ifdef OPENSSL_USE_DEPRECATED +DECLARE_DEPRECATED(void BN_set_params(int mul,int high,int low,int mont)); +DECLARE_DEPRECATED(int BN_get_params(int which)); /* 0, mul, 1 high, 2 low, 3 mont */ #endif BN_RECP_CTX *BN_RECP_CTX_new(void); diff --git a/crypto/crypto.h b/crypto/crypto.h index c4c173f6df..d4be37bf17 100644 --- a/crypto/crypto.h +++ b/crypto/crypto.h @@ -442,10 +442,14 @@ void CRYPTO_THREADID_current(CRYPTO_THREADID *id); int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b); void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src); unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id); -#ifndef OPENSSL_NO_DEPRECATED -void CRYPTO_set_id_callback(unsigned long (*func)(void)); +#ifdef OPENSSL_USE_DEPRECATED +DECLARE_DEPRECATED(void CRYPTO_set_id_callback(unsigned long (*func)(void))); +/* + * mkdef.pl cannot handle this next one so not inside DECLARE_DEPRECATED, + * but still inside OPENSSL_USE_DEPRECATED + */ unsigned long (*CRYPTO_get_id_callback(void))(void); -unsigned long CRYPTO_thread_id(void); +DECLARE_DEPRECATED(unsigned long CRYPTO_thread_id(void)); #endif const char *CRYPTO_get_lock_name(int type); diff --git a/crypto/dh/dh.h b/crypto/dh/dh.h index beaeac9212..3f7dca1284 100644 --- a/crypto/dh/dh.h +++ b/crypto/dh/dh.h @@ -69,7 +69,7 @@ #include #endif #include -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #endif @@ -204,10 +204,10 @@ int DH_set_ex_data(DH *d, int idx, void *arg); void *DH_get_ex_data(DH *d, int idx); /* Deprecated version */ -#ifndef OPENSSL_NO_DEPRECATED -DH * DH_generate_parameters(int prime_len,int generator, - void (*callback)(int,int,void *),void *cb_arg); -#endif /* !defined(OPENSSL_NO_DEPRECATED) */ +#ifdef OPENSSL_USE_DEPRECATED +DECLARE_DEPRECATED(DH * DH_generate_parameters(int prime_len,int generator, + void (*callback)(int,int,void *),void *cb_arg)); +#endif /* defined(OPENSSL_USE_DEPRECATED) */ /* New version */ int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, BN_GENCB *cb); diff --git a/crypto/dsa/dsa.h b/crypto/dsa/dsa.h index 34d070421e..8feb2a1582 100644 --- a/crypto/dsa/dsa.h +++ b/crypto/dsa/dsa.h @@ -77,7 +77,7 @@ #include #include -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #ifndef OPENSSL_NO_DH # include @@ -236,12 +236,12 @@ DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length); DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length); /* Deprecated version */ -#ifndef OPENSSL_NO_DEPRECATED -DSA * DSA_generate_parameters(int bits, +#ifdef OPENSSL_USE_DEPRECATED +DECLARE_DEPRECATED(DSA * DSA_generate_parameters(int bits, unsigned char *seed,int seed_len, int *counter_ret, unsigned long *h_ret,void - (*callback)(int, int, void *),void *cb_arg); -#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + (*callback)(int, int, void *),void *cb_arg)); +#endif /* defined(OPENSSL_USE_DEPRECATED) */ /* New version */ int DSA_generate_parameters_ex(DSA *dsa, int bits, diff --git a/crypto/ec/ec.h b/crypto/ec/ec.h index f8c927ac79..f448aacc0e 100644 --- a/crypto/ec/ec.h +++ b/crypto/ec/ec.h @@ -84,7 +84,7 @@ #include #include -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #endif diff --git a/crypto/ecdh/ecdh.h b/crypto/ecdh/ecdh.h index 539e212c10..c03072877c 100644 --- a/crypto/ecdh/ecdh.h +++ b/crypto/ecdh/ecdh.h @@ -77,7 +77,7 @@ #include #include -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #endif diff --git a/crypto/ecdsa/ecdsa.h b/crypto/ecdsa/ecdsa.h index 28a4d1c847..657f0b9e98 100644 --- a/crypto/ecdsa/ecdsa.h +++ b/crypto/ecdsa/ecdsa.h @@ -67,7 +67,7 @@ #include #include -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #endif diff --git a/crypto/engine/engine.h b/crypto/engine/engine.h index 830d391f61..5d382fa02d 100644 --- a/crypto/engine/engine.h +++ b/crypto/engine/engine.h @@ -70,7 +70,7 @@ #error ENGINE is disabled. #endif -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #ifndef OPENSSL_NO_RSA #include diff --git a/crypto/err/err.h b/crypto/err/err.h index 974cc9cc6f..2a00e2805f 100644 --- a/crypto/err/err.h +++ b/crypto/err/err.h @@ -354,8 +354,8 @@ void ERR_load_crypto_strings(void); void ERR_free_strings(void); void ERR_remove_thread_state(const CRYPTO_THREADID *tid); -#ifndef OPENSSL_NO_DEPRECATED -void ERR_remove_state(unsigned long pid); /* if zero we look it up */ +#ifdef OPENSSL_USE_DEPRECATED +DECLARE_DEPRECATED(void ERR_remove_state(unsigned long pid)); /* if zero we look it up */ #endif ERR_STATE *ERR_get_state(void); diff --git a/crypto/rsa/rsa.h b/crypto/rsa/rsa.h index f164d74e30..10e187e263 100644 --- a/crypto/rsa/rsa.h +++ b/crypto/rsa/rsa.h @@ -66,7 +66,7 @@ #endif #include #include -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #endif @@ -208,7 +208,7 @@ struct rsa_st * operations and results in faster RSA * private key operations. */ -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME /* deprecated name for the flag*/ /* new with 0.9.7h; the built-in RSA * implementation now uses constant time @@ -310,10 +310,10 @@ int RSA_size(const RSA *rsa); int RSA_security_bits(const RSA *rsa); /* Deprecated version */ -#ifndef OPENSSL_NO_DEPRECATED -RSA * RSA_generate_key(int bits, unsigned long e,void - (*callback)(int,int,void *),void *cb_arg); -#endif /* !defined(OPENSSL_NO_DEPRECATED) */ +#ifdef OPENSSL_USE_DEPRECATED +DECLARE_DEPRECATED(RSA * RSA_generate_key(int bits, unsigned long e,void + (*callback)(int,int,void *),void *cb_arg)); +#endif /* defined(OPENSSL_USE_DEPRECATED) */ /* New version */ int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); diff --git a/crypto/store/store.h b/crypto/store/store.h index 0a28c7d5a2..8b472a7fec 100644 --- a/crypto/store/store.h +++ b/crypto/store/store.h @@ -66,7 +66,7 @@ #endif #include -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #include #include diff --git a/crypto/ui/ui.h b/crypto/ui/ui.h index bd78aa413f..5c4ff49cc5 100644 --- a/crypto/ui/ui.h +++ b/crypto/ui/ui.h @@ -59,7 +59,7 @@ #ifndef HEADER_UI_H #define HEADER_UI_H -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #include #endif #include diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 2fcc107812..ad804f2bdd 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -91,7 +91,7 @@ #include #endif -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #ifndef OPENSSL_NO_RSA #include #endif diff --git a/ssl/ssl.h b/ssl/ssl.h index 02c53c7835..0318d046b1 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h @@ -151,7 +151,7 @@ #ifndef OPENSSL_NO_BIO #include #endif -#ifndef OPENSSL_NO_DEPRECATED +#ifdef OPENSSL_USE_DEPRECATED #ifndef OPENSSL_NO_X509 #include #endif