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;
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);
#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
{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"},
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",
"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",
"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",
};
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
if(outlen<md->md_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;
}
}
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
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
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
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;
}
}