diff options
author | Viktor Dukhovni <openssl-users@dukhovni.org> | 2016-01-04 23:00:33 -0500 |
---|---|---|
committer | Viktor Dukhovni <openssl-users@dukhovni.org> | 2016-01-07 20:53:18 -0500 |
commit | 98186eb4e4aef6262ed6b0f499348defa2c26893 (patch) | |
tree | 38ddc0aea1be4b31a4a48d74dc307ad30288af47 | |
parent | cddd424a5bda94e238e4ff06c0efc80cff3b07d1 (diff) |
Backwards-compatibility subject to OPENSSL_API_COMPAT
Provide backwards-compatiblity for functions, macros and include
files if OPENSSL_API_COMPAT is either not defined or defined less
than the version number of the release in which the feature was
deprecated.
Reviewed-by: Richard Levitte <levitte@openssl.org>
41 files changed, 253 insertions, 116 deletions
@@ -4,6 +4,35 @@ Changes between 1.0.2e and 1.1.0 [xx XXX xxxx] + *) Revert default OPENSSL_NO_DEPRECATED setting. Instead OpenSSL + continues to support deprecated interfaces in default builds. + However, applications are strongly advised to compile their + source files with -DOPENSSL_API_COMPAT=0x10100000L, which hides + the declarations of all interfaces deprecated in 0.9.8, 1.0.0 + or the 1.1.0 releases. + + In environments in which all applications have been ported to + not use any deprecated interfaces OpenSSL's Configure script + should be used with the --api=1.1.0 option to entirely remove + support for the deprecated features from the library and + unconditionally disable them in the installed headers. + Essentially the same effect can be achieved with the "no-deprecated" + argument to Configure, except that this will always restrict + the build to just the latest API, rather than a fixed API + version. + + As applications are ported to future revisions of the API, + they should update their compile-time OPENSSL_API_COMPAT define + accordingly, but in most cases should be able to continue to + compile with later releases. + + The OPENSSL_API_COMPAT versions for 1.0.0, and 0.9.8 are + 0x10000000L and 0x00908000L, respectively. However those + versions did not support the OPENSSL_API_COMPAT feature, and + so applications are not typically tested for explicit support + of just the undeprecated features of either release. + [Viktor Dukhovni] + *) Add support for setting the minimum and maximum supported protocol. It can bet set via the SSL_set_min_proto_version() and SSL_set_max_proto_version(), or via the SSL_CONF's MinProtocol and @@ -35,6 +35,9 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta # # --cross-compile-prefix Add specified prefix to binutils components. # +# --api One of 0.9.8, 1.0.0 or 1.1.0. Do not compile support for +# interfaces deprecated as of the specified OpenSSL version. +# # no-hw-xxx do not compile support for specific crypto hardware. # Generic OpenSSL-style methods relating to this support # are always compiled but return NULL if the hardware @@ -137,6 +140,16 @@ my $bits2="SIXTY_FOUR_BIT "; # seems to be sufficient? my $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT"; +# +# API compability name to version number mapping. +# +my $maxapi = "1.1.0"; # API for "no-deprecated" builds +my $apitable = { + "1.1.0" => "0x10100000L", + "1.0.0" => "0x10000000L", + "0.9.8" => "0x00908000L", +}; + # table of known configurations, read in from files # # The content of each entry can take one of two forms: @@ -890,7 +903,6 @@ my @disablables = ( # All of the following is disabled by default (RC5 was enabled before 0.9.8): my %disabled = ( # "what" => "comment" [or special keyword "experimental"] - "deprecated" => "default", "ec_nistp_64_gcc_128" => "default", "jpake" => "experimental", "md2" => "default", @@ -932,6 +944,7 @@ my $openssl_other_defines; my $libs; my $target; my $options; +my $api; my $make_depend=0; my %withargs=(); my $build_prefix = "release_"; @@ -1086,6 +1099,10 @@ PROCESS_ARGS: { $prefix=$1; } + elsif (/^--api=(.*)$/) + { + $api=$1; + } elsif (/^--libdir=(.*)$/) { $libdir=$1; @@ -1157,6 +1174,10 @@ PROCESS_ARGS: } } + if (defined($api) && !exists $apitable->{$api}) { + die "***** Unsupported api compatibility level: $api\n", + } + if (keys %unsupported_options) { die "***** Unsupported options: ", @@ -1542,11 +1563,10 @@ if ($zlib) } } -#Build the library with OPENSSL_USE_DEPRECATED if deprecation is not disabled -if(!defined($disabled{"deprecated"})) - { - $cflags = "-DOPENSSL_USE_DEPRECATED $cflags"; - } +# With "deprecated" disable all deprecated features. +if (defined($disabled{"deprecated"})) { + $api = $maxapi; +} # You will find shlib_mark1 and shlib_mark2 explained in Makefile.org my $shared_mark = ""; @@ -1744,7 +1764,7 @@ open(IN,'<include/openssl/opensslv.h') || die "unable to read opensslv.h:$!\n"; while (<IN>) { $version=$1 if /OPENSSL.VERSION.TEXT.*OpenSSL (\S+) /; - $version_num=$1 if /OPENSSL.VERSION.NUMBER.*0x(\S+)/; + $version_num=$1 if /OPENSSL.VERSION.NUMBER.*(0x\S+)/; $shlib_version_number=$1 if /SHLIB_VERSION_NUMBER *"([^"]+)"/; $shlib_version_history=$1 if /SHLIB_VERSION_HISTORY *"([^"]*)"/; } @@ -1763,6 +1783,12 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/) $shlib_minor=$2; } +if (defined($api)) { + my $apiflag = sprintf("-DOPENSSL_API_COMPAT=%s", $apitable->{$api}); + $default_depflags .= " $apiflag"; + $cflags .= " $apiflag"; +} + my $ecc = $cc; $ecc = "clang" if `$cc --version 2>&1` =~ /clang/; @@ -1991,6 +2017,11 @@ print OUT "#ifdef __cplusplus\n"; print OUT "extern \"C\" {\n"; print OUT "#endif\n"; print OUT "/* OpenSSL was configured with the following options: */\n"; + +my $openssl_api_defines = ""; +if (defined($api)) { + $openssl_api_defines = sprintf "#define OPENSSL_MIN_API %s\n", $apitable->{$api}; +} my $openssl_algorithm_defines_trans = $openssl_algorithm_defines; $openssl_experimental_defines =~ s/^\s*#\s*define\s+OPENSSL_NO_(.*)/#ifndef OPENSSL_EXPERIMENTAL_$1\n# ifndef OPENSSL_NO_$1\n# define OPENSSL_NO_$1\n# endif\n#endif/mg; $openssl_algorithm_defines_trans =~ s/^\s*#\s*define\s+OPENSSL_(.*)/# if defined(OPENSSL_$1) \&\& !defined($1)\n# define $1\n# endif/mg; @@ -1999,9 +2030,11 @@ $openssl_algorithm_defines = " /* no ciphers excluded */\n" if $openssl_algori $openssl_thread_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#endif/mg; $openssl_sys_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#endif/mg; $openssl_other_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#endif/mg; + print OUT $openssl_sys_defines; print OUT "#ifndef OPENSSL_DOING_MAKEDEPEND\n\n"; print OUT $openssl_experimental_defines; +print OUT $openssl_api_defines; print OUT "\n"; print OUT $openssl_algorithm_defines; print OUT "\n#endif /* OPENSSL_DOING_MAKEDEPEND */\n\n"; @@ -2162,7 +2195,7 @@ EOF # create the ms/version32.rc file if needed if ($IsMK1MF && ($target !~ /^netware/)) { my ($v1, $v2, $v3, $v4); - if ($version_num =~ /(^[0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i) { + if ($version_num =~ /^0x([0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})L$/i) { $v1=hex $1; $v2=hex $2; $v3=hex $3; @@ -23,6 +23,11 @@ o EC revision: now operations use new EC_KEY_METHOD. o Support for OCB mode added to libcrypto o Support for asynchronous crypto operations added to libcrypto and libssl + o Deprecated interfaces can now be disabled at build time either + relative to the latest relate via the "no-deprecated" Configure + argument, or via the "--api=1.1.0|1.0.0|0.9.8" option. + o Application software can be compiled with -DOPENSSL_API_COMPAT=version + to ensure that features deprecated before that version are not exposed. Major changes between OpenSSL 1.0.2d and OpenSSL 1.0.2e [3 Dec 2015] diff --git a/crypto/bn/bn_blind.c b/crypto/bn/bn_blind.c index 7ca13bb31e..bc2918e99b 100644 --- a/crypto/bn/bn_blind.c +++ b/crypto/bn/bn_blind.c @@ -109,6 +109,7 @@ * [including the GNU Public Licence.] */ +#include <openssl/opensslconf.h> #include "internal/cryptlib.h" #include "bn_lcl.h" @@ -119,7 +120,7 @@ struct bn_blinding_st { BIGNUM *Ai; BIGNUM *e; BIGNUM *mod; /* just a reference */ -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10000000L unsigned long thread_id; /* added in OpenSSL 0.9.6j and 0.9.7b; used * only by crypto/rsa/rsa_eay.c, rsa_lib.c */ #endif @@ -271,7 +272,7 @@ int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, return (ret); } -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10000000L unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *b) { return b->thread_id; diff --git a/crypto/bn/bn_depr.c b/crypto/bn/bn_depr.c index c4a5c820d0..b64aa5fb29 100644 --- a/crypto/bn/bn_depr.c +++ b/crypto/bn/bn_depr.c @@ -62,11 +62,12 @@ #include <time.h> #include "internal/cryptlib.h" #include "bn_lcl.h" +#include <openssl/opensslconf.h> #include <openssl/rand.h> static void *dummy = &dummy; -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x00908000L BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add, const BIGNUM *rem, void (*callback) (int, int, void *), void *cb_arg) diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index b9e96b553e..6393a34f8a 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -65,9 +65,10 @@ #include <limits.h> #include "internal/cryptlib.h" #include "bn_lcl.h" +#include <openssl/opensslconf.h> /* This stuff appears to be completely unused, so is deprecated */ -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x00908000L /*- * For a 32 bit machine * 2 - 4 == 128 @@ -258,7 +259,7 @@ void BN_free(BIGNUM *a) if (a->flags & BN_FLG_MALLOCED) OPENSSL_free(a); else { -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x00908000L a->flags |= BN_FLG_FREE; #endif a->d = NULL; diff --git a/crypto/dh/dh_depr.c b/crypto/dh/dh_depr.c index de93472189..78875fbc6b 100644 --- a/crypto/dh/dh_depr.c +++ b/crypto/dh/dh_depr.c @@ -59,10 +59,11 @@ #include "internal/cryptlib.h" #include <openssl/bn.h> #include <openssl/dh.h> +#include <openssl/opensslconf.h> static void *dummy = &dummy; -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x00908000L DH *DH_generate_parameters(int prime_len, int generator, void (*callback) (int, int, void *), void *cb_arg) { diff --git a/crypto/dsa/dsa_depr.c b/crypto/dsa/dsa_depr.c index 0b18776845..90dbd8d18e 100644 --- a/crypto/dsa/dsa_depr.c +++ b/crypto/dsa/dsa_depr.c @@ -75,8 +75,9 @@ static void *dummy = &dummy; #include <openssl/dsa.h> #include <openssl/rand.h> #include <openssl/sha.h> +#include <openssl/opensslconf.h> -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x00908000L DSA *DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len, int *counter_ret, unsigned long *h_ret, diff --git a/crypto/err/err.c b/crypto/err/err.c index 9f81768ecc..77e8223de4 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -118,6 +118,7 @@ #include <openssl/buffer.h> #include <openssl/bio.h> #include <openssl/err.h> +#include <openssl/opensslconf.h> DECLARE_LHASH_OF(ERR_STRING_DATA); DECLARE_LHASH_OF(ERR_STATE); @@ -861,7 +862,7 @@ void ERR_remove_thread_state(const CRYPTO_THREADID *id) int_thread_del_item(&tmp); } -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10000000L void ERR_remove_state(unsigned long pid) { ERR_remove_thread_state(NULL); diff --git a/crypto/evp/e_old.c b/crypto/evp/e_old.c index a23d143b7f..d5c4b4e09d 100644 --- a/crypto/evp/e_old.c +++ b/crypto/evp/e_old.c @@ -57,7 +57,9 @@ * */ -#ifdef OPENSSL_NO_DEPRECATED +#include <openssl/opensslconf.h> + +#if OPENSSL_API_COMPAT >= 0x00908000L static void *dummy = &dummy; #else diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index 3bc93a8841..72daed13dd 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -61,6 +61,7 @@ #include <string.h> #include "internal/cryptlib.h" #include <openssl/hmac.h> +#include <openssl/opensslconf.h> #include "hmac_lcl.h" int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, @@ -127,7 +128,7 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, return 0; } -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10100000L int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md) { if (key && md) diff --git a/crypto/opensslconf.h.in b/crypto/opensslconf.h.in index f12117963f..20a420fa7b 100644 --- a/crypto/opensslconf.h.in +++ b/crypto/opensslconf.h.in @@ -1,20 +1,44 @@ /* crypto/opensslconf.h.in */ /* - * Applications should use -DOPENSSL_USE_DEPRECATED to enable access to - * deprecated functions. But if the library has been built to disable - * deprecated functions then this will not work + * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the + * declarations of functions deprecated in or before <version>. Otherwise, they + * still won't see them if the library has been built to disable deprecated + * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) && defined(OPENSSL_USE_DEPRECATED) -#error "OPENSSL_USE_DEPRECATED has been defined, but OpenSSL has been built without support for deprecated functions" +#if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +#else +# define DECLARE_DEPRECATED(f) f; +#endif + +#ifndef OPENSSL_MIN_API +#define OPENSSL_MIN_API 0 +#endif + +#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API +#undef OPENSSL_API_COMPAT +#define OPENSSL_API_COMPAT OPENSSL_MIN_API +#endif + +#if OPENSSL_API_COMPAT < 0x10100000L +# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_1_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x10000000L +# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_0_0(f) #endif -/* Test for support for deprecated attribute */ -#if __GNUC__ > 3 || \ - (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -#define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)) +#if OPENSSL_API_COMPAT < 0x00908000L +# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) #else -#define DECLARE_DEPRECATED(f) f +# define DEPRECATEDIN_0_9_8(f) #endif /* Generate 80386 code? */ diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c index c2dfce419a..13ad774d8a 100644 --- a/crypto/rand/md_rand.c +++ b/crypto/rand/md_rand.c @@ -128,6 +128,7 @@ # include <time.h> #endif +#include <openssl/opensslconf.h> #include <openssl/crypto.h> #include <openssl/rand.h> #include <openssl/async.h> @@ -172,7 +173,7 @@ static int rand_seed(const void *buf, int num); static int rand_add(const void *buf, int num, double add_entropy); static int rand_bytes(unsigned char *buf, int num, int pseudo); static int rand_nopseudo_bytes(unsigned char *buf, int num); -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10100000L static int rand_pseudo_bytes(unsigned char *buf, int num); #endif static int rand_status(void); @@ -182,7 +183,7 @@ static RAND_METHOD rand_meth = { rand_nopseudo_bytes, rand_cleanup, rand_add, -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10100000L rand_pseudo_bytes, #else NULL, @@ -627,7 +628,7 @@ static int rand_nopseudo_bytes(unsigned char *buf, int num) return rand_bytes(buf, num, 0); } -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10100000L /* * pseudo-random bytes that are guaranteed to be unique but not unpredictable */ diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c index 308b9e2c30..4a425d7e58 100644 --- a/crypto/rand/rand_lib.c +++ b/crypto/rand/rand_lib.c @@ -59,6 +59,7 @@ #include <stdio.h> #include <time.h> #include "internal/cryptlib.h" +#include <openssl/opensslconf.h> #include <openssl/rand.h> #ifndef OPENSSL_NO_ENGINE @@ -159,7 +160,7 @@ int RAND_bytes(unsigned char *buf, int num) return (-1); } -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10100000L int RAND_pseudo_bytes(unsigned char *buf, int num) { const RAND_METHOD *meth = RAND_get_rand_method(); diff --git a/crypto/rsa/rsa_depr.c b/crypto/rsa/rsa_depr.c index 5bd0275856..59e1e7b38e 100644 --- a/crypto/rsa/rsa_depr.c +++ b/crypto/rsa/rsa_depr.c @@ -61,10 +61,11 @@ #include <stdio.h> #include <time.h> #include "internal/cryptlib.h" +#include <openssl/opensslconf.h> #include <openssl/bn.h> #include <openssl/rsa.h> -#ifdef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT >= 0x00908000L static void *dummy = &dummy; diff --git a/crypto/thr_id.c b/crypto/thr_id.c index 51088e4fb5..73711d89e3 100644 --- a/crypto/thr_id.c +++ b/crypto/thr_id.c @@ -115,8 +115,9 @@ */ #include "internal/cryptlib.h" +#include <openssl/opensslconf.h> -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10000000L static unsigned long (*id_callback) (void) = 0; #endif static void (*threadid_callback) (CRYPTO_THREADID *) = 0; @@ -189,7 +190,7 @@ void CRYPTO_THREADID_current(CRYPTO_THREADID *id) threadid_callback(id); return; } -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10000000L /* If the deprecated callback was set, fall back to that */ if (id_callback) { CRYPTO_THREADID_set_numeric(id, id_callback()); @@ -220,7 +221,7 @@ unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id) return id->val; } -#ifndef OPENSSL_NO_DEPRECATED +#if OPENSSL_API_COMPAT < 0x10000000L unsigned long (*CRYPTO_get_id_callback(void)) (void) { return (id_callback); } diff --git a/doc/crypto/BN_BLINDING_new.pod b/doc/crypto/BN_BLINDING_new.pod index 2e575c6d37..8688e48722 100644 --- a/doc/crypto/BN_BLINDING_new.pod +++ b/doc/crypto/BN_BLINDING_new.pod @@ -22,10 +22,6 @@ functions. BN_CTX *ctx); int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *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); - #endif CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *); unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); @@ -35,6 +31,13 @@ functions. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), BN_MONT_CTX *m_ctx); +Deprecated: + + #if OPENSSL_API_COMPAT < 0x10000000L + unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *); + void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long); + #endif + =head1 DESCRIPTION BN_BLINDING_new() allocates a new B<BN_BLINDING> structure and copies diff --git a/doc/crypto/BN_generate_prime.pod b/doc/crypto/BN_generate_prime.pod index 90f399dea6..8ea3d0bf3c 100644 --- a/doc/crypto/BN_generate_prime.pod +++ b/doc/crypto/BN_generate_prime.pod @@ -35,6 +35,7 @@ for primality Deprecated: + #if OPENSSL_API_COMPAT < 0x00908000L BIGNUM *BN_generate_prime(BIGNUM *ret, int num, int safe, BIGNUM *add, BIGNUM *rem, void (*callback)(int, int, void *), void *cb_arg); @@ -44,6 +45,7 @@ Deprecated: int BN_is_prime_fasttest(const BIGNUM *a, int checks, void (*callback)(int, int, void *), BN_CTX *ctx, void *cb_arg, int do_trial_division); + #endif =head1 DESCRIPTION diff --git a/doc/crypto/BN_zero.pod b/doc/crypto/BN_zero.pod index e0f653f81e..5334aaa41a 100644 --- a/doc/crypto/BN_zero.pod +++ b/doc/crypto/BN_zero.pod @@ -9,7 +9,7 @@ operations #include <openssl/bn.h> - int BN_zero(BIGNUM *a); + void BN_zero(BIGNUM *a); int BN_one(BIGNUM *a); const BIGNUM *BN_value_one(void); @@ -17,6 +17,12 @@ operations int BN_set_word(BIGNUM *a, unsigned long w); unsigned long BN_get_word(BIGNUM *a); +Deprecated: + + #if OPENSSL_API_COMPAT < 0x00908000L + int BN_zero(BIGNUM *a); + #endif + =head1 DESCRIPTION BN_zero(), BN_one() and BN_set_word() set B<a> to the values 0, 1 and @@ -33,8 +39,10 @@ long. BN_get_word() returns the value B<a>, and 0xffffffffL if B<a> cannot be represented as an unsigned long. -BN_zero(), BN_one() and BN_set_word() return 1 on success, 0 otherwise. +BN_one(), BN_set_word() and the deprecated version of BN_zero() +return 1 on success, 0 otherwise. BN_value_one() returns the constant. +The preferred version of BN_zer() never fails and returns no value. =head1 BUGS diff --git a/doc/crypto/DH_generate_parameters.pod b/doc/crypto/DH_generate_parameters.pod index 1491d9f679..93d7b9c3b4 100644 --- a/doc/crypto/DH_generate_parameters.pod +++ b/doc/crypto/DH_generate_parameters.pod @@ -16,8 +16,10 @@ DH_check - generate and check Diffie-Hellman parameters Deprecated: + #if OPENSSL_API_COMPAT < 0x00908000L DH *DH_generate_parameters(int prime_len, int generator, void (*callback)(int, int, void *), void *cb_arg); + #endif =head1 DESCRIPTION diff --git a/doc/crypto/DSA_generate_parameters.pod b/doc/crypto/DSA_generate_parameters.pod index efe46eb734..b639db6d84 100644 --- a/doc/crypto/DSA_generate_parameters.pod +++ b/doc/crypto/DSA_generate_parameters.pod @@ -14,9 +14,11 @@ DSA_generate_parameters_ex, DSA_generate_parameters - generate DSA parameters Deprecated: + #if OPENSSL_API_COMPAT < 0x00908000L 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 =head1 DESCRIPTION |