diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-05-11 14:43:38 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-05-11 14:43:38 +0000 |
commit | c2fd5989945501b81b7d698c71eb34d767ac55bd (patch) | |
tree | 55053bc68483b680272f347b8c53c6d3119487cc /fips | |
parent | 5024b79f5c41d97f023a5dbb6142af906129bf86 (diff) |
Rename FIPS_mode_set and FIPS_mode. Theses symbols will be defined in
the FIPS capable OpenSSL.
Diffstat (limited to 'fips')
-rw-r--r-- | fips/fips.c | 6 | ||||
-rw-r--r-- | fips/fips.h | 4 | ||||
-rw-r--r-- | fips/fips_test_suite.c | 6 | ||||
-rw-r--r-- | fips/fips_utl.h | 2 | ||||
-rw-r--r-- | fips/rand/fips_rand_lib.c | 14 | ||||
-rw-r--r-- | fips/utl/fips_enc.c | 4 | ||||
-rw-r--r-- | fips/utl/fips_md.c | 2 |
7 files changed, 19 insertions, 19 deletions
diff --git a/fips/fips.c b/fips/fips.c index a18fd58f28..6498595ec5 100644 --- a/fips/fips.c +++ b/fips/fips.c @@ -96,7 +96,7 @@ static void fips_set_mode(int onoff) } } -int FIPS_mode(void) +int FIPS_module_mode(void) { int ret = 0; int owning_thread = fips_is_owning_thread(); @@ -237,7 +237,7 @@ int FIPS_check_incore_fingerprint(void) return rv; } -int FIPS_mode_set(int onoff) +int FIPS_module_mode_set(int onoff) { int fips_set_owning_thread(); int fips_clear_owning_thread(); @@ -254,7 +254,7 @@ int FIPS_mode_set(int onoff) /* Don't go into FIPS mode twice, just so we can do automagic seeding */ - if(FIPS_mode()) + if(FIPS_module_mode()) { FIPSerr(FIPS_F_FIPS_MODE_SET,FIPS_R_FIPS_MODE_ALREADY_SET); fips_selftest_fail = 1; diff --git a/fips/fips.h b/fips/fips.h index c37c32b2fd..d07d190402 100644 --- a/fips/fips.h +++ b/fips/fips.h @@ -67,8 +67,8 @@ struct env_md_st; struct evp_cipher_st; struct evp_cipher_ctx_st; -int FIPS_mode_set(int onoff); -int FIPS_mode(void); +int FIPS_module_mode_set(int onoff); +int FIPS_module_mode(void); const void *FIPS_rand_check(void); int FIPS_selftest(void); int FIPS_selftest_failed(void); diff --git a/fips/fips_test_suite.c b/fips/fips_test_suite.c index 2f9333c35c..5290cb2587 100644 --- a/fips/fips_test_suite.c +++ b/fips/fips_test_suite.c @@ -945,7 +945,7 @@ int main(int argc,char **argv) } if (!no_exit) { fips_algtest_init_nofips(); - if (!FIPS_mode_set(1)) { + if (!FIPS_module_mode_set(1)) { printf("Power-up self test failed\n"); exit(1); } @@ -964,8 +964,8 @@ int main(int argc,char **argv) /* Power-up self test */ ERR_clear_error(); - test_msg("2. Automatic power-up self test", FIPS_mode_set(1)); - if (!FIPS_mode()) + test_msg("2. Automatic power-up self test", FIPS_module_mode_set(1)); + if (!FIPS_module_mode()) exit(1); if (do_drbg_stick) FIPS_drbg_stick(); diff --git a/fips/fips_utl.h b/fips/fips_utl.h index dc29c20ce3..6cb58094b8 100644 --- a/fips/fips_utl.h +++ b/fips/fips_utl.h @@ -136,7 +136,7 @@ void do_entropy_stick(void) void fips_algtest_init(void) { fips_algtest_init_nofips(); - if (!FIPS_mode_set(1)) + if (!FIPS_module_mode_set(1)) { fprintf(stderr, "Error entering FIPS mode\n"); exit(1); diff --git a/fips/rand/fips_rand_lib.c b/fips/rand/fips_rand_lib.c index 9ea6655edf..cc8d7179b6 100644 --- a/fips/rand/fips_rand_lib.c +++ b/fips/rand/fips_rand_lib.c @@ -72,7 +72,7 @@ int FIPS_rand_set_method(const RAND_METHOD *meth) else fips_approved_rand_meth = 0; - if (!fips_approved_rand_meth && FIPS_mode()) + if (!fips_approved_rand_meth && FIPS_module_mode()) { FIPSerr(FIPS_F_FIPS_RAND_SET_METHOD, FIPS_R_NON_FIPS_METHOD); return 0; @@ -83,7 +83,7 @@ int FIPS_rand_set_method(const RAND_METHOD *meth) void FIPS_rand_seed(const void *buf, int num) { - if (!fips_approved_rand_meth && FIPS_mode()) + if (!fips_approved_rand_meth && FIPS_module_mode()) { FIPSerr(FIPS_F_FIPS_RAND_SEED, FIPS_R_NON_FIPS_METHOD); return; @@ -94,7 +94,7 @@ void FIPS_rand_seed(const void *buf, int num) void FIPS_rand_add(const void *buf, int num, double entropy) { - if (!fips_approved_rand_meth && FIPS_mode()) + if (!fips_approved_rand_meth && FIPS_module_mode()) { FIPSerr(FIPS_F_FIPS_RAND_ADD, FIPS_R_NON_FIPS_METHOD); return; @@ -105,7 +105,7 @@ void FIPS_rand_add(const void *buf, int num, double entropy) int FIPS_rand_bytes(unsigned char *buf, int num) { - if (!fips_approved_rand_meth && FIPS_mode()) + if (!fips_approved_rand_meth && FIPS_module_mode()) { FIPSerr(FIPS_F_FIPS_RAND_BYTES, FIPS_R_NON_FIPS_METHOD); return 0; @@ -117,7 +117,7 @@ int FIPS_rand_bytes(unsigned char *buf, int num) int FIPS_rand_pseudo_bytes(unsigned char *buf, int num) { - if (!fips_approved_rand_meth && FIPS_mode()) + if (!fips_approved_rand_meth && FIPS_module_mode()) { FIPSerr(FIPS_F_FIPS_RAND_PSEUDO_BYTES, FIPS_R_NON_FIPS_METHOD); return 0; @@ -129,7 +129,7 @@ int FIPS_rand_pseudo_bytes(unsigned char *buf, int num) int FIPS_rand_status(void) { - if (!fips_approved_rand_meth && FIPS_mode()) + if (!fips_approved_rand_meth && FIPS_module_mode()) { FIPSerr(FIPS_F_FIPS_RAND_STATUS, FIPS_R_NON_FIPS_METHOD); return 0; @@ -153,7 +153,7 @@ int FIPS_rand_strength(void) return 80; else if (fips_approved_rand_meth == 0) { - if (FIPS_mode()) + if (FIPS_module_mode()) return 0; else return 256; diff --git a/fips/utl/fips_enc.c b/fips/utl/fips_enc.c index 55a880d06e..fcff5ece87 100644 --- a/fips/utl/fips_enc.c +++ b/fips/utl/fips_enc.c @@ -136,7 +136,7 @@ int FIPS_cipherinit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, if (cipher) { /* Only FIPS ciphers allowed */ - if (FIPS_mode() && !(cipher->flags & EVP_CIPH_FLAG_FIPS) && + if (FIPS_module_mode() && !(cipher->flags & EVP_CIPH_FLAG_FIPS) && !(ctx->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW)) { EVPerr(EVP_F_FIPS_CIPHERINIT, EVP_R_DISABLED_FOR_FIPS); @@ -288,7 +288,7 @@ int FIPS_cipher_ctx_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in) } /* Only FIPS ciphers allowed */ - if (FIPS_mode() && !(in->cipher->flags & EVP_CIPH_FLAG_FIPS) && + if (FIPS_module_mode() && !(in->cipher->flags & EVP_CIPH_FLAG_FIPS) && !(out->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW)) { EVPerr(EVP_F_FIPS_CIPHER_CTX_COPY, EVP_R_DISABLED_FOR_FIPS); diff --git a/fips/utl/fips_md.c b/fips/utl/fips_md.c index 556267994c..8bc028ab3f 100644 --- a/fips/utl/fips_md.c +++ b/fips/utl/fips_md.c @@ -173,7 +173,7 @@ int FIPS_digestinit(EVP_MD_CTX *ctx, const EVP_MD *type) ctx->digest = &bad_md; return 0; } - if(FIPS_mode() && !(type->flags & EVP_MD_FLAG_FIPS) && + if(FIPS_module_mode() && !(type->flags & EVP_MD_FLAG_FIPS) && !(ctx->flags & EVP_MD_CTX_FLAG_NON_FIPS_ALLOW)) { EVPerr(EVP_F_FIPS_DIGESTINIT, EVP_R_DISABLED_FOR_FIPS); |