add FIPS support to openssl utility (backport from HEAD)
This commit is contained in:
parent
7043fa702f
commit
57dd2ea808
@ -129,6 +129,9 @@
|
|||||||
#include "progs.h"
|
#include "progs.h"
|
||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
#ifdef OPENSSL_FIPS
|
||||||
|
#include <openssl/fips.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with the
|
/* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with the
|
||||||
* base prototypes (we cast each variable inside the function to the required
|
* base prototypes (we cast each variable inside the function to the required
|
||||||
@ -310,6 +313,19 @@ int main(int Argc, char *ARGV[])
|
|||||||
CRYPTO_set_locking_callback(lock_dbg_cb);
|
CRYPTO_set_locking_callback(lock_dbg_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(getenv("OPENSSL_FIPS")) {
|
||||||
|
#ifdef OPENSSL_FIPS
|
||||||
|
if (!FIPS_mode_set(1)) {
|
||||||
|
ERR_load_crypto_strings();
|
||||||
|
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
|
||||||
|
EXIT(1);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
fprintf(stderr, "FIPS mode not supported.\n");
|
||||||
|
EXIT(1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
/* Lets load up our environment a little */
|
/* Lets load up our environment a little */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user