summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-04-18 22:42:06 +0000
committerDr. Stephen Henson <steve@openssl.org>2012-04-18 22:42:06 +0000
commit068fc255aca09e8e96116787e1ee7de866742729 (patch)
tree7b2c1908fef0ab18415f3a7e9ee78a0f5a36b835 /crypto/evp
parentcc8f2fb917ff81789790691c1c81464c965ed3a1 (diff)
only call FIPS_cipherinit in FIPS mode
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/evp_enc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index 691072655b..8835d9a6ed 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -170,7 +170,8 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *imp
#endif
#ifdef OPENSSL_FIPS
- return FIPS_cipherinit(ctx, cipher, key, iv, enc);
+ if (FIPS_mode())
+ return FIPS_cipherinit(ctx, cipher, key, iv, enc);
#else
ctx->cipher=cipher;
if (ctx->cipher->ctx_size)
@@ -207,7 +208,8 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *imp
skip_to_init:
#endif
#ifdef OPENSSL_FIPS
- return FIPS_cipherinit(ctx, cipher, key, iv, enc);
+ if (FIPS_mode())
+ return FIPS_cipherinit(ctx, cipher, key, iv, enc);
#else
/* we assume block size is a power of 2 in *cryptUpdate */
OPENSSL_assert(ctx->cipher->block_size == 1