aboutsummaryrefslogtreecommitdiff
path: root/crypto/bn
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2020-03-05 12:50:31 -0500
committerRichard Levitte <levitte@openssl.org>2020-04-16 13:52:22 +0200
commit705536e2b5c4167dbda2e0046d83f9e0f4a65514 (patch)
tree5b76e00908f3d8c5dcbb75f094a4c06d989e97d5 /crypto/bn
parent7165593ce5a07a6860d4d408ad640ee707172936 (diff)
downloadopenssl-705536e2b5c4167dbda2e0046d83f9e0f4a65514.zip
openssl-705536e2b5c4167dbda2e0046d83f9e0f4a65514.tar.gz
openssl-705536e2b5c4167dbda2e0046d83f9e0f4a65514.tar.bz2
Use build.info, not ifdef for crypto modules
Don't wrap conditionally-compiled files in global ifndef tests. Instead, test if the feature is disabled and, if so, do not compile it. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11263)
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_depr.c13
-rw-r--r--crypto/bn/build.info5
2 files changed, 8 insertions, 10 deletions
diff --git a/crypto/bn/bn_depr.c b/crypto/bn/bn_depr.c
index 9c1c3d5..9a7a87e 100644
--- a/crypto/bn/bn_depr.c
+++ b/crypto/bn/bn_depr.c
@@ -13,14 +13,11 @@
*/
#include <openssl/opensslconf.h>
-#ifdef OPENSSL_NO_DEPRECATED_0_9_8
-NON_EMPTY_TRANSLATION_UNIT
-#else
-# include <stdio.h>
-# include <time.h>
-# include "internal/cryptlib.h"
-# include "bn_local.h"
+#include <stdio.h>
+#include <time.h>
+#include "internal/cryptlib.h"
+#include "bn_local.h"
BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
const BIGNUM *add, const BIGNUM *rem,
@@ -64,5 +61,3 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
BN_GENCB_set_old(&cb, callback, cb_arg);
return bn_check_prime_int(a, checks, ctx_passed, do_trial_division, &cb);
}
-
-#endif
diff --git a/crypto/bn/build.info b/crypto/bn/build.info
index bc3fb9b..5e04ed0 100644
--- a/crypto/bn/build.info
+++ b/crypto/bn/build.info
@@ -113,7 +113,10 @@ $COMMON=bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c \
bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \
bn_x931p.c bn_intern.c bn_dh.c \
bn_rsa_fips186_4.c $BNDH $BNASM
-SOURCE[../../libcrypto]=$COMMON bn_print.c bn_err.c bn_depr.c bn_srp.c
+SOURCE[../../libcrypto]=$COMMON bn_print.c bn_err.c bn_srp.c
+IF[{- !$disabled{'deprecated-3.0'} -}]
+ SOURCE[../../libcrypto]=bn_depr.c
+ENDIF
SOURCE[../../providers/libfips.a]=$COMMON
# Implementations are now spread across several libraries, so the defines
# need to be applied to all affected libraries and modules.