From d3a15e132d8b3063141d25131be2ab33d201ef5b Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sun, 27 Jul 2003 21:13:35 +0000 Subject: [PATCH] Build when not FIPS. --- Makefile.org | 2 +- fips/aes/fips_aesavs.c | 2 ++ fips/dsa/fips_dsa_ossl.c | 8 ++++++++ fips/dsa/fips_dsatest.c | 3 ++- fips/fips_check_sha1 | 3 ++- fips/sha1/fingerprint.sha1 | 2 +- fips/sha1/fips_sha1dgst.c | 6 +++++- fips/sha1/fips_standalone_sha1.c | 2 ++ fips/sha1/standalone.sha1 | 2 +- 9 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Makefile.org b/Makefile.org index 61f11f4147..486db65952 100644 --- a/Makefile.org +++ b/Makefile.org @@ -173,7 +173,7 @@ LIBKRB5= # we might set SHLIB_MARK to '$(SHARED_LIBS)'. SHLIB_MARK= -DIRS= fips crypto ssl $(SHLIB_MARK) apps test tools +DIRS= crypto fips ssl $(SHLIB_MARK) apps test tools SHLIBDIRS= fips crypto ssl # dirs in crypto to build diff --git a/fips/aes/fips_aesavs.c b/fips/aes/fips_aesavs.c index 5ea8731247..4d1d7edcac 100644 --- a/fips/aes/fips_aesavs.c +++ b/fips/aes/fips_aesavs.c @@ -836,7 +836,9 @@ int main(int argc, char **argv) exit(0); */ +#ifdef FIPS FIPS_mode_set(1); +#endif ERR_load_crypto_strings(); if (argc > 1) { diff --git a/fips/dsa/fips_dsa_ossl.c b/fips/dsa/fips_dsa_ossl.c index f5253ac39c..7fc0648c10 100644 --- a/fips/dsa/fips_dsa_ossl.c +++ b/fips/dsa/fips_dsa_ossl.c @@ -68,6 +68,8 @@ #endif #include +#ifdef FIPS + static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp); static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, @@ -364,3 +366,9 @@ static int dsa_bn_mod_exp(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, { return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx); } + +#else /* ndef FIPS */ + +static void *dummy=&dummy; + +#endif /* ndef FIPS */ diff --git a/fips/dsa/fips_dsatest.c b/fips/dsa/fips_dsatest.c index 9c8bd8420c..1107a00b69 100644 --- a/fips/dsa/fips_dsatest.c +++ b/fips/dsa/fips_dsatest.c @@ -143,8 +143,9 @@ int main(int argc, char **argv) unsigned char sig[256]; unsigned int siglen; +#ifdef FIPS FIPS_mode_set(1); - +#endif if (bio_err == NULL) bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); diff --git a/fips/fips_check_sha1 b/fips/fips_check_sha1 index 481bb8410d..ccc70d5f0a 100755 --- a/fips/fips_check_sha1 +++ b/fips/fips_check_sha1 @@ -3,5 +3,6 @@ FP=$1 shift -$TOP/fips/sha1/fips_standalone_sha1 $@ | diff -u $FP - +egrep '^CFLAG=.*-DFIPS ' $TOP/Makefile || exit 0 +$TOP/fips/sha1/fips_standalone_sha1 $@ | diff -u $FP - diff --git a/fips/sha1/fingerprint.sha1 b/fips/sha1/fingerprint.sha1 index b78f2d756b..658fab3f61 100644 --- a/fips/sha1/fingerprint.sha1 +++ b/fips/sha1/fingerprint.sha1 @@ -1,3 +1,3 @@ -SHA1(fips_sha1dgst.c)= 5b541eae6c5dc9caad9ad4fb90cb840ff48b5904 +SHA1(fips_sha1dgst.c)= 609e2cbf5d3cdcf318ec10238a0e82b93b78e6b5 SHA1(fips_sha_locl.h)= 677427c495b571991f013939ea7e5dea87828f8c SHA1(fips_md32_common.h)= 4f41bcde24750b3b8c99a06bcba2fe06ff8db4d0 diff --git a/fips/sha1/fips_sha1dgst.c b/fips/sha1/fips_sha1dgst.c index 86543bdc32..e766095291 100644 --- a/fips/sha1/fips_sha1dgst.c +++ b/fips/sha1/fips_sha1dgst.c @@ -70,7 +70,11 @@ const char *SHA1_version="SHA1" OPENSSL_VERSION_PTEXT; #include "fips_sha_locl.h" -#endif /* def FIPS */ +#else /* ndef FIPS */ + +static void *dummy=&dummy; + +#endif /* ndef FIPS */ #endif diff --git a/fips/sha1/fips_standalone_sha1.c b/fips/sha1/fips_standalone_sha1.c index 81a5d02431..b74cdc44f8 100644 --- a/fips/sha1/fips_standalone_sha1.c +++ b/fips/sha1/fips_standalone_sha1.c @@ -52,6 +52,7 @@ int main(int argc,char **argv) { +#ifdef FIPS int n; if(argc < 2) @@ -97,5 +98,6 @@ int main(int argc,char **argv) printf("%02x",md[i]); printf("\n"); } +#endif return 0; } diff --git a/fips/sha1/standalone.sha1 b/fips/sha1/standalone.sha1 index 47e6eea9d0..a36e466470 100644 --- a/fips/sha1/standalone.sha1 +++ b/fips/sha1/standalone.sha1 @@ -1,4 +1,4 @@ SHA1(fips_standalone_sha1.c)= b6c1f9f1ea9a231c0520460ee1e009f721fbc121 -SHA1(fips_sha1dgst.c)= 5b541eae6c5dc9caad9ad4fb90cb840ff48b5904 +SHA1(fips_sha1dgst.c)= 609e2cbf5d3cdcf318ec10238a0e82b93b78e6b5 SHA1(fips_sha_locl.h)= 677427c495b571991f013939ea7e5dea87828f8c SHA1(fips_md32_common.h)= 4f41bcde24750b3b8c99a06bcba2fe06ff8db4d0 -- 2.25.1