From ae02fc534856d7fe7ce3e95c097499de911b6a47 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 30 Jun 2000 11:02:02 +0000 Subject: [PATCH] Make it possible to turn off compilation of hardware support through the configuration parameter 'no-hw'. --- Configure | 8 +++++++- crypto/engine/engine_int.h | 4 ++++ crypto/engine/engine_list.c | 2 ++ crypto/engine/hw_atalla.c | 2 ++ crypto/engine/hw_cswift.c | 2 ++ crypto/engine/hw_ncipher.c | 2 ++ 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Configure b/Configure index fba942b7ba..d729173ea6 100755 --- a/Configure +++ b/Configure @@ -10,7 +10,7 @@ use strict; # see INSTALL for instructions. -my $usage="Usage: Configure [no- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx] [rsaref] [no-threads] [no-asm] [no-dso] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] os/compiler[:flags]\n"; +my $usage="Usage: Configure [no- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [rsaref] [no-threads] [no-asm] [no-dso] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] os/compiler[:flags]\n"; # Options: # @@ -27,6 +27,7 @@ my $usage="Usage: Configure [no- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [- # Generic OpenSSL-style methods relating to this support # are always compiled but return NULL if the hardware # support isn't compiled. +# no-hw do not compile support for any crypto hardware. # rsaref use RSAref # [no-]threads [don't] try to create a library that is suitable for # multithreaded applications (default is "threads" if we @@ -481,6 +482,11 @@ foreach (@ARGV) $flags .= "-DNO_HW_$hw "; $openssl_other_defines .= "#define NO_HW_$hw\n"; } + elsif (/^no-hw$/) + { + $flags .= "-DNO_HW "; + $openssl_other_defines .= "#define NO_HW\n"; + } elsif (/^386$/) { $processor=386; } elsif (/^rsaref$/) diff --git a/crypto/engine/engine_int.h b/crypto/engine/engine_int.h index 194110cc39..510810f2c0 100644 --- a/crypto/engine/engine_int.h +++ b/crypto/engine/engine_int.h @@ -130,6 +130,8 @@ typedef struct engine_st /* Returns a structure of software only methods (the default). */ ENGINE *ENGINE_openssl(); +#ifndef NO_HW + #ifndef NO_HW_CSWIFT /* Returns a structure of cswift methods ... NB: This can exist and be * "used" even on non-cswift systems because the "init" will fail if the @@ -146,6 +148,8 @@ ENGINE *ENGINE_ncipher(); ENGINE *ENGINE_atalla(); #endif /* !NO_HW_ATALLA */ +#endif /* !NO_HW */ + #ifdef __cplusplus } #endif diff --git a/crypto/engine/engine_list.c b/crypto/engine/engine_list.c index 6426453622..d764c60661 100644 --- a/crypto/engine/engine_list.c +++ b/crypto/engine/engine_list.c @@ -185,6 +185,7 @@ static int engine_internal_check(void) * with our statically compiled-in engines. */ if(!engine_list_add(ENGINE_openssl())) return 0; +#ifndef NO_HW #ifndef NO_HW_CSWIFT if(!engine_list_add(ENGINE_cswift())) return 0; @@ -197,6 +198,7 @@ static int engine_internal_check(void) if(!engine_list_add(ENGINE_atalla())) return 0; #endif /* !NO_HW_ATALLA */ +#endif /* !NO_HW */ engine_list_flag = 1; return 1; } diff --git a/crypto/engine/hw_atalla.c b/crypto/engine/hw_atalla.c index f9ff3efdbe..7e6a351c35 100644 --- a/crypto/engine/hw_atalla.c +++ b/crypto/engine/hw_atalla.c @@ -63,6 +63,7 @@ #include "engine_int.h" #include +#ifndef NO_HW #ifndef NO_HW_ATALLA #include "vendor_defns/atalla.h" @@ -434,3 +435,4 @@ static int atalla_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p, } #endif /* !NO_HW_ATALLA */ +#endif /* !NO_HW */ diff --git a/crypto/engine/hw_cswift.c b/crypto/engine/hw_cswift.c index c170eb3e0f..13eab370be 100644 --- a/crypto/engine/hw_cswift.c +++ b/crypto/engine/hw_cswift.c @@ -63,6 +63,7 @@ #include "engine_int.h" #include +#ifndef NO_HW #ifndef NO_HW_CSWIFT /* Attribution notice: Rainbow have generously allowed me to reproduce @@ -730,3 +731,4 @@ static int cswift_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p, } #endif /* !NO_HW_CSWIFT */ +#endif /* !NO_HW */ diff --git a/crypto/engine/hw_ncipher.c b/crypto/engine/hw_ncipher.c index 6d4fc9edd0..1a0c41ef10 100644 --- a/crypto/engine/hw_ncipher.c +++ b/crypto/engine/hw_ncipher.c @@ -64,6 +64,7 @@ #include "engine_int.h" #include +#ifndef NO_HW #ifndef NO_HW_NCIPHER /* Attribution notice: nCipher har said several times that it's OK for @@ -773,3 +774,4 @@ static void log_message(void *logstream, const char *message) } #endif /* !NO_HW_NCIPHER */ +#endif /* !NO_HW */ -- 2.25.1