From 9aeed18ad799c20d3accf6e1535817538dc983f6 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Tue, 1 Mar 2016 17:57:01 +0000 Subject: Import OpenSSL 1.0.2g. --- crypto/cmac/cmac.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crypto/cmac') diff --git a/crypto/cmac/cmac.c b/crypto/cmac/cmac.c index 774e6dc91905..2954b6eb7dcf 100644 --- a/crypto/cmac/cmac.c +++ b/crypto/cmac/cmac.c @@ -160,6 +160,14 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, EVPerr(EVP_F_CMAC_INIT, EVP_R_DISABLED_FOR_FIPS); return 0; } + + /* Switch to FIPS cipher implementation if possible */ + if (cipher != NULL) { + const EVP_CIPHER *fcipher; + fcipher = FIPS_get_cipherbynid(EVP_CIPHER_nid(cipher)); + if (fcipher != NULL) + cipher = fcipher; + } /* * Other algorithm blocking will be done in FIPS_cmac_init, via * FIPS_cipherinit(). -- cgit v1.2.3