From: Andy Polyakov Date: Tue, 10 May 2005 22:57:21 +0000 (+0000) Subject: Tidy up an error code. X-Git-Tag: BEN_FIPS_TEST_8~20 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cbd72088ec7d9bba403af741ed218b5da41a7bbc;p=oweals%2Fopenssl.git Tidy up an error code. --- diff --git a/fips/Makefile b/fips/Makefile index be3ab1e296..d1d4561e01 100644 --- a/fips/Makefile +++ b/fips/Makefile @@ -115,7 +115,7 @@ fips_test_suite: fips_test_suite.o $(TOP)/libcrypto.a fips_test: top top_fips_test_suite cd testvectors && perl -p -i -e 's/COUNT=/COUNT = /' des[23]/req/*.req - @for i in dsa sha1 aes des ; \ + @for i in dsa sha1 aes des hmac rand rsa; \ do \ (cd $$i && echo "making fips_test in fips/$$i..." && $(MAKE) fips_test) \ done; diff --git a/fips/fips.h b/fips/fips.h index d76b0de955..b1621b7de9 100644 --- a/fips/fips.h +++ b/fips/fips.h @@ -72,6 +72,7 @@ void FIPS_corrupt_rsa(void); int FIPS_selftest_rsa(void); void FIPS_corrupt_dsa(void); int FIPS_selftest_dsa(void); +void FIPS_corrupt_rng(void); int FIPS_selftest_rng(void); int FIPS_selftest_hmac(void); @@ -103,7 +104,7 @@ void ERR_load_FIPS_strings(void); #define FIPS_F_FIPS_SELFTEST_DSA 109 #define FIPS_F_FIPS_SELFTEST_RNG 118 #define FIPS_F_FIPS_SELFTEST_RSA 108 -#define FIPS_F_FIPS_SELFTEST_SHA1 103 +#define FIPS_F_FIPS_SELFTEST_SHA 103 #define FIPS_F_HASH_FINAL 100 #define FIPS_F_RSA_EAY_PUBLIC_ENCRYPT 114 #define FIPS_F_RSA_GENERATE_KEY 113 diff --git a/fips/fips_err.h b/fips/fips_err.h index aa70f22fcb..779787f35e 100644 --- a/fips/fips_err.h +++ b/fips/fips_err.h @@ -84,7 +84,7 @@ static ERR_STRING_DATA FIPS_str_functs[]= {ERR_FUNC(FIPS_F_FIPS_SELFTEST_DSA), "FIPS_selftest_dsa"}, {ERR_FUNC(FIPS_F_FIPS_SELFTEST_RNG), "FIPS_selftest_rng"}, {ERR_FUNC(FIPS_F_FIPS_SELFTEST_RSA), "FIPS_selftest_rsa"}, -{ERR_FUNC(FIPS_F_FIPS_SELFTEST_SHA1), "FIPS_selftest_sha1"}, +{ERR_FUNC(FIPS_F_FIPS_SELFTEST_SHA), "FIPS_selftest_sha"}, {ERR_FUNC(FIPS_F_HASH_FINAL), "HASH_FINAL"}, {ERR_FUNC(FIPS_F_RSA_EAY_PUBLIC_ENCRYPT), "RSA_EAY_PUBLIC_ENCRYPT"}, {ERR_FUNC(FIPS_F_RSA_GENERATE_KEY), "RSA_generate_key"}, diff --git a/fips/fipshashes.c b/fips/fipshashes.c index c817e8a9bc..1dc7860969 100644 --- a/fips/fipshashes.c +++ b/fips/fipshashes.c @@ -1,8 +1,8 @@ const char * const FIPS_source_hashes[] = { "HMAC-SHA1(fips.c)= 7cbbda3b9e8aec46ee31797179cb72faeef80712", "HMAC-SHA1(fips_err_wrapper.c)= d3e2be316062510312269e98f964cb87e7577898", -"HMAC-SHA1(fips.h)= b36e2f13c0c1ede4dd94f0dbb9f89354b53681d8", -"HMAC-SHA1(fips_err.h)= d356c4436362dba2974f767e06c6be1c90dbfe9f", +"HMAC-SHA1(fips.h)= 8f48edb7734408c1a82cbb97106f8d823f0b7c91", +"HMAC-SHA1(fips_err.h)= 0b2bd6999ee5792fec3739689cde5f352789e63a", "HMAC-SHA1(aes/fips_aes_core.c)= b70bbbd675efe0613da0d57055310926a0104d55", "HMAC-SHA1(aes/asm/fips-ax86-elf.s)= f797b524a79196e7f59458a5b223432fcfd4a868", "HMAC-SHA1(aes/fips_aes_selftest.c)= 98b01502221e7fe529fd981222f2cbb52eb4cbe0", @@ -23,10 +23,10 @@ const char * const FIPS_source_hashes[] = { "HMAC-SHA1(rand/fips_rand_selftest.c)= d9c8985e08feecefafe667ad0119d444b42f807c", "HMAC-SHA1(rsa/fips_rsa_eay.c)= 2596773a7af8f037427217b79f56858296961d66", "HMAC-SHA1(rsa/fips_rsa_gen.c)= beedbc14a7b262d36a2b829494030f3032563bac", -"HMAC-SHA1(rsa/fips_rsa_selftest.c)= dcd0970a4de2d7f0d2333d6a3efb1ae350209b57", +"HMAC-SHA1(rsa/fips_rsa_selftest.c)= a9dc47bd1001f795d1565111d26433c300101e06", "HMAC-SHA1(sha1/fips_sha1dgst.c)= 26e529d630b5e754b4a29bd1bb697e991e7fdc04", "HMAC-SHA1(sha1/fips_standalone_sha1.c)= faae95bc36cc80f5be6a0cde02ebab0f63d4fd97", -"HMAC-SHA1(sha1/fips_sha1_selftest.c)= c8cb6e96a4b8c56f75f1b657ebf77a90545b774d", +"HMAC-SHA1(sha1/fips_sha1_selftest.c)= a08f9c1e2c0f63b9aa96b927c0333a03b020749f", "HMAC-SHA1(sha1/asm/fips-sx86-elf.s)= ae66fb23ab8e1a2287e87a0a2dd30a4b9039fe63", "HMAC-SHA1(sha1/fips_sha_locl.h)= 30b6d6bdbdc9db0d66dc89010c1f4fe1c7b60574", "HMAC-SHA1(sha1/fips_md32_common.h)= c34d8b7785d3194ff968cf6d3efdd2bfcaec1fad", @@ -34,5 +34,5 @@ const char * const FIPS_source_hashes[] = { "HMAC-SHA1(sha1/fips_sha256.c)= 826e768677e67b7c87dfc9e084245b619804d01c", "HMAC-SHA1(sha1/fips_sha512.c)= 27e16912ff196982425c00fe266fa84ef4f48fcd", "HMAC-SHA1(hmac/fips_hmac.c)= a477cec1da76c0092979c4a875b6469339bff7ef", -"HMAC-SHA1(hmac/fips_hmac_selftest.c)= 380df511aa9330f317900effefb50d5dc3582082", +"HMAC-SHA1(hmac/fips_hmac_selftest.c)= 63aa4e9699ae8178051c59fec7d18d3bd9aad25d", }; diff --git a/fips/hmac/Makefile b/fips/hmac/Makefile index 88d1e29e7c..268c0cf033 100644 --- a/fips/hmac/Makefile +++ b/fips/hmac/Makefile @@ -62,6 +62,21 @@ tags: tests: +top_fips_hmactest: + (cd $(TOP); $(MAKE) DIRS=fips FDIRS=$(DIR) TARGET=fips_hmactest sub_target) + +fips_hmactest: fips_hmactest.o $(TOP)/libcrypto.a + $(CC) $(CFLAGS) -o fips_hmactest fips_hmactest.o $(PEX_LIBS) $(TOP)/libcrypto.a $(EX_LIBS) + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_hmactest + +Q=../testvectors/hmac/req +A=../testvectors/hmac/rsp + +fips_test: top top_fips_hmactest + -rm -rf $(A) + mkdir $(A) + ./fips_hmactest < $(Q)/HMAC.req > $(A)/HMAC.rsp + lint: lint -DLINT $(INCLUDES) $(SRC)>fluff diff --git a/fips/hmac/fips_hmac_selftest.c b/fips/hmac/fips_hmac_selftest.c index 98a6457333..71e26d1eed 100644 --- a/fips/hmac/fips_hmac_selftest.c +++ b/fips/hmac/fips_hmac_selftest.c @@ -126,7 +126,7 @@ int FIPS_selftest_hmac() if(outlenmd_size || memcmp(out,t->kaval,md->md_size)) { - FIPSerr(FIPS_F_FIPS_SELFTEST_SHA1,FIPS_R_SELFTEST_FAILED); + FIPSerr(FIPS_F_FIPS_SELFTEST_SHA,FIPS_R_SELFTEST_FAILED); return 0; } } diff --git a/fips/rand/Makefile b/fips/rand/Makefile index 71780b2147..85852f4b5b 100644 --- a/fips/rand/Makefile +++ b/fips/rand/Makefile @@ -73,10 +73,10 @@ Q=../testvectors/rng/req A=../testvectors/rng/rsp fips_test: top_fips_rngvs - -rm -rf $A - mkdir $A - ./fips_rngvs mct < $Q/MCT.req > $A/MCT.rsp - ./fips_rngvs vst < $Q/VST.req > $A/VST.rsp + -rm -rf $(A) + mkdir $(A) + ./fips_rngvs mct < $(Q)/MCT.req > $(A)/MCT.rsp + ./fips_rngvs vst < $(Q)/VST.req > $(A)/VST.rsp lint: lint -DLINT $(INCLUDES) $(SRC)>fluff diff --git a/fips/rsa/Makefile b/fips/rsa/Makefile index 54a4dcd537..be750a1b18 100644 --- a/fips/rsa/Makefile +++ b/fips/rsa/Makefile @@ -62,6 +62,29 @@ tags: tests: +top_fips_rsastest: + (cd $(TOP); $(MAKE) DIRS=fips FDIRS=$(DIR) TARGET=fips_rsastest sub_target) + +top_fips_rsavtest: + (cd $(TOP); $(MAKE) DIRS=fips FDIRS=$(DIR) TARGET=fips_rsavtest sub_target) + +fips_rsastest: fips_rsastest.o $(TOP)/libcrypto.a + $(CC) $(CFLAGS) -o fips_rsastest fips_rsastest.o $(PEX_LIBS) $(TOP)/libcrypto.a $(EX_LIBS) + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_rsastest + +fips_rsavtest: fips_rsavtest.o $(TOP)/libcrypto.a + $(CC) $(CFLAGS) -o fips_rsavtest fips_rsavtest.o $(PEX_LIBS) $(TOP)/libcrypto.a $(EX_LIBS) + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_rsavtest + +Q=../testvectors/rsa/req +A=../testvectors/rsa/rsp + +fips_test: top top_fips_rsastest top_fips_rsavtest + -rm -rf $(A) + mkdir $(A) + ./fips_rsastest < $(Q)/SigGen15.req > $(A)/SigGen15.rsp + ./fips_rsavtest < $(Q)/SigVer15.req > $(A)/SigVer15.rsp + lint: lint -DLINT $(INCLUDES) $(SRC)>fluff diff --git a/fips/rsa/fips_rsa_selftest.c b/fips/rsa/fips_rsa_selftest.c index 0da4905374..0b620c717b 100644 --- a/fips/rsa/fips_rsa_selftest.c +++ b/fips/rsa/fips_rsa_selftest.c @@ -222,7 +222,7 @@ int FIPS_selftest_rsa() SHA1(original_ptext,sizeof(original_ptext) - 1,md); if(memcmp(md,mdkat,SHA_DIGEST_LENGTH)) { - FIPSerr(FIPS_F_FIPS_SELFTEST_SHA1,FIPS_R_SELFTEST_FAILED); + FIPSerr(FIPS_F_FIPS_SELFTEST_SHA,FIPS_R_SELFTEST_FAILED); return 0; } /* ...3) then encrypt the digest, and compare the ciphertext diff --git a/fips/sha1/fips_sha1_selftest.c b/fips/sha1/fips_sha1_selftest.c index a52530c34f..73a65cdc06 100644 --- a/fips/sha1/fips_sha1_selftest.c +++ b/fips/sha1/fips_sha1_selftest.c @@ -86,7 +86,7 @@ int FIPS_selftest_sha1() SHA1((unsigned char*)test[n],strlen(test[n]),md); if(memcmp(md,ret[n],sizeof md)) { - FIPSerr(FIPS_F_FIPS_SELFTEST_SHA1,FIPS_R_SELFTEST_FAILED); + FIPSerr(FIPS_F_FIPS_SELFTEST_SHA,FIPS_R_SELFTEST_FAILED); return 0; } }