From 9f2c8eb2a103e17444f48878e4bfe123c08bd265 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 1 Jun 2011 14:28:21 +0000 Subject: [PATCH] Redirect clone digests to FIPS module for FIPS builds. --- crypto/evp/m_dss.c | 7 +++++++ crypto/evp/m_dss1.c | 8 ++++++++ crypto/evp/m_ecdsa.c | 8 ++++++++ 3 files changed, 23 insertions(+) diff --git a/crypto/evp/m_dss.c b/crypto/evp/m_dss.c index 48c2689504..192a29884f 100644 --- a/crypto/evp/m_dss.c +++ b/crypto/evp/m_dss.c @@ -66,6 +66,12 @@ #endif #ifndef OPENSSL_NO_SHA +#ifdef OPENSSL_FIPS +#include + +const EVP_MD *EVP_dss(void) { return FIPS_evp_dss(); } + +#else static int init(EVP_MD_CTX *ctx) { return SHA1_Init(ctx->md_data); } @@ -97,3 +103,4 @@ const EVP_MD *EVP_dss(void) return(&dsa_md); } #endif +#endif diff --git a/crypto/evp/m_dss1.c b/crypto/evp/m_dss1.c index 4f03fb70e0..b730c6e222 100644 --- a/crypto/evp/m_dss1.c +++ b/crypto/evp/m_dss1.c @@ -68,6 +68,13 @@ #include #endif +#ifdef OPENSSL_FIPS +#include + +const EVP_MD *EVP_dss1(void) { return FIPS_evp_dss1(); } + +#else + static int init(EVP_MD_CTX *ctx) { return SHA1_Init(ctx->md_data); } @@ -98,3 +105,4 @@ const EVP_MD *EVP_dss1(void) return(&dss1_md); } #endif +#endif diff --git a/crypto/evp/m_ecdsa.c b/crypto/evp/m_ecdsa.c index 8d87a49ebe..1e64a593bf 100644 --- a/crypto/evp/m_ecdsa.c +++ b/crypto/evp/m_ecdsa.c @@ -116,6 +116,13 @@ #include #ifndef OPENSSL_NO_SHA +#ifdef OPENSSL_FIPS +#include + +const EVP_MD *EVP_ecdsa(void) { return FIPS_evp_ecdsa(); } + +#else + static int init(EVP_MD_CTX *ctx) { return SHA1_Init(ctx->md_data); } @@ -146,3 +153,4 @@ const EVP_MD *EVP_ecdsa(void) return(&ecdsa_md); } #endif +#endif -- 2.40.0