File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ typedef struct {
42
42
EVP_CIPHER * evp_cipher ;
43
43
} openssl_ctx ;
44
44
45
- static int openssl_fips_status = 0 ;
46
45
static unsigned int openssl_external_init = 0 ;
47
46
static unsigned int openssl_init_count = 0 ;
48
47
static sqlite3_mutex * openssl_rand_mutex = NULL ;
@@ -77,14 +76,16 @@ static int sqlcipher_openssl_activate(void *ctx) {
77
76
openssl_external_init = 1 ;
78
77
}
79
78
80
- if (openssl_init_count == 0 && openssl_external_init == 0 ) {
81
79
#ifdef SQLCIPHER_FIPS
82
- openssl_fips_status = FIPS_mode_set ( 1 );
83
- if (!openssl_fips_status ){
80
+ if (! FIPS_mode ()){
81
+ if (!FIPS_mode_set ( 1 ) ){
84
82
ERR_load_crypto_strings ();
85
- ERR_print_errors_fp (stdout );
83
+ ERR_print_errors_fp (stderr );
86
84
}
85
+ }
87
86
#endif
87
+
88
+ if (openssl_init_count == 0 && openssl_external_init == 0 ) {
88
89
/* if the library was not externally initialized, then should be now */
89
90
OpenSSL_add_all_algorithms ();
90
91
}
@@ -232,7 +233,7 @@ static int sqlcipher_openssl_ctx_free(void **ctx) {
232
233
}
233
234
234
235
static int sqlcipher_openssl_fips_status (void * ctx ) {
235
- return openssl_fips_status ;
236
+ return FIPS_mode () ;
236
237
}
237
238
238
239
int sqlcipher_openssl_setup (sqlcipher_provider * p ) {
You can’t perform that action at this time.
0 commit comments