X-Git-Url: http://git.rot13.org/?p=bcm963xx.git;a=blobdiff_plain;f=userapps%2Fopensource%2Fopenssl%2Fapps%2Fopenssl.c;h=65a9ee8a66b42aa6cff1f1d595ee4c1a13916b95;hp=e0d89d4ab413fee3c8c22ee62d96b6f687227c2b;hb=864458111a0e69d94bbae210d5b7349ca072a6b7;hpb=a69849c98808437716b821267cd97529c56f45b0 diff --git a/userapps/opensource/openssl/apps/openssl.c b/userapps/opensource/openssl/apps/openssl.c index e0d89d4a..65a9ee8a 100755 --- a/userapps/opensource/openssl/apps/openssl.c +++ b/userapps/opensource/openssl/apps/openssl.c @@ -129,6 +129,7 @@ #include "progs.h" #include "s_apps.h" #include +#include /* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with the * base prototypes (we cast each variable inside the function to the required @@ -147,6 +148,7 @@ char *default_config_file=NULL; #ifdef MONOLITH CONF *config=NULL; BIO *bio_err=NULL; +int in_FIPS_mode=0; #endif @@ -227,10 +229,31 @@ int main(int Argc, char *Argv[]) char **argv,*p; LHASH *prog=NULL; long errline; - + arg.data=NULL; arg.count=0; + in_FIPS_mode = 0; + +#ifdef OPENSSL_FIPS + if(getenv("OPENSSL_FIPS")) { +#if defined(_WIN32) + char filename[MAX_PATH] = ""; + GetModuleFileNameA( NULL, filename, MAX_PATH) ; + p = filename; +#else + p = Argv[0]; +#endif + if (!FIPS_mode_set(1,p)) { + ERR_load_crypto_strings(); + ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE)); + EXIT(1); + } + in_FIPS_mode = 1; + if (getenv("OPENSSL_FIPS_MD5")) + FIPS_allow_md5(1); + } +#endif if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);