summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/hmac/hmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/hmac/hmac.c')
-rw-r--r--src/lib/libcrypto/hmac/hmac.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c
index 06ee80761f..6c110bd52b 100644
--- a/src/lib/libcrypto/hmac/hmac.c
+++ b/src/lib/libcrypto/hmac/hmac.c
@@ -61,6 +61,8 @@
61#include <openssl/hmac.h> 61#include <openssl/hmac.h>
62#include "cryptlib.h" 62#include "cryptlib.h"
63 63
64#ifndef OPENSSL_FIPS
65
64void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, 66void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
65 const EVP_MD *md, ENGINE *impl) 67 const EVP_MD *md, ENGINE *impl)
66 { 68 {
@@ -77,15 +79,6 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
77 79
78 if (key != NULL) 80 if (key != NULL)
79 { 81 {
80#ifdef OPENSSL_FIPS
81 if (FIPS_mode() && !(md->flags & EVP_MD_FLAG_FIPS)
82 && (!(ctx->md_ctx.flags & EVP_MD_CTX_FLAG_NON_FIPS_ALLOW)
83 || !(ctx->i_ctx.flags & EVP_MD_CTX_FLAG_NON_FIPS_ALLOW)
84 || !(ctx->o_ctx.flags & EVP_MD_CTX_FLAG_NON_FIPS_ALLOW)))
85 OpenSSLDie(__FILE__,__LINE__,
86 "HMAC: digest not allowed in FIPS mode");
87#endif
88
89 reset=1; 82 reset=1;
90 j=EVP_MD_block_size(md); 83 j=EVP_MD_block_size(md);
91 OPENSSL_assert(j <= sizeof ctx->key); 84 OPENSSL_assert(j <= sizeof ctx->key);
@@ -187,3 +180,4 @@ void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags)
187 EVP_MD_CTX_set_flags(&ctx->md_ctx, flags); 180 EVP_MD_CTX_set_flags(&ctx->md_ctx, flags);
188 } 181 }
189 182
183#endif