From 06843f826f83b4ffeff8b893ef964f64f545fe8d Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Tue, 31 May 2011 16:22:21 +0000 Subject: [PATCH] Fake CPU caps so fips_standalone_sha1 compiles. Initialise update function for bad digest inits. --- fips/sha/fips_standalone_sha1.c | 1 + fips/utl/fips_md.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/fips/sha/fips_standalone_sha1.c b/fips/sha/fips_standalone_sha1.c index 07bd0091be..80ccae4dfe 100644 --- a/fips/sha/fips_standalone_sha1.c +++ b/fips/sha/fips_standalone_sha1.c @@ -59,6 +59,7 @@ int FIPS_selftest_failed() { return 0; } void FIPS_selftest_check() {} void OPENSSL_cleanse(void *p,size_t len) {} +unsigned int OPENSSL_ia32cap_P[2]; #endif #ifdef OPENSSL_FIPS diff --git a/fips/utl/fips_md.c b/fips/utl/fips_md.c index 8bc028ab3f..d3db1c7188 100644 --- a/fips/utl/fips_md.c +++ b/fips/utl/fips_md.c @@ -171,6 +171,7 @@ int FIPS_digestinit(EVP_MD_CTX *ctx, const EVP_MD *type) { FIPSerr(FIPS_F_FIPS_DIGESTINIT,FIPS_R_FIPS_SELFTEST_FAILED); ctx->digest = &bad_md; + ctx->update = bad_update; return 0; } if(FIPS_module_mode() && !(type->flags & EVP_MD_FLAG_FIPS) && @@ -178,6 +179,7 @@ int FIPS_digestinit(EVP_MD_CTX *ctx, const EVP_MD *type) { EVPerr(EVP_F_FIPS_DIGESTINIT, EVP_R_DISABLED_FOR_FIPS); ctx->digest = &bad_md; + ctx->update = bad_update; return 0; } if (ctx->digest != type)