From: Andy Polyakov Date: Tue, 19 Apr 2005 15:11:59 +0000 (+0000) Subject: Maintain fingerprint hashes as C source. X-Git-Tag: BEN_FIPS_TEST_8~75 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f868b61376f3aaf764e30b1093d54653d49cda01;p=oweals%2Fopenssl.git Maintain fingerprint hashes as C source. --- diff --git a/fips/fipshashes.c b/fips/fipshashes.c new file mode 100644 index 0000000000..a9c3c2266b --- /dev/null +++ b/fips/fipshashes.c @@ -0,0 +1,32 @@ +const char * const FIPS_source_hashes[] = { +"HMAC-SHA1(fips.c)= f14ae9175119f045f1c645a2458602ccd2b2a34e", +"HMAC-SHA1(fips_err_wrapper.c)= d3e2be316062510312269e98f964cb87e7577898", +"HMAC-SHA1(fips.h)= 70f0181f269e6b09a9e3e6d9ff82f3461bd41222", +"HMAC-SHA1(fips_err.h)= 03468e3b593f7528fd934e49bf052c23cc98d301", +"HMAC-SHA1(aes/fips_aes_core.c)= b70bbbd675efe0613da0d57055310926a0104d55", +"HMAC-SHA1(aes/asm/fips-ax86-elf.s)= 0d1c89f93cbf7bf4854bb238627c99ecda462f17", +"HMAC-SHA1(aes/fips_aes_selftest.c)= 98b01502221e7fe529fd981222f2cbb52eb4cbe0", +"HMAC-SHA1(aes/fips_aes_locl.h)= a98eb0aa449f1d95b8064e261b2ac2b1f328685e", +"HMAC-SHA1(des/fips_des_enc.c)= 9527f8ea81602358f1aa11348237fdb1e9eeff32", +"HMAC-SHA1(des/asm/fips-dx86-elf.s)= 9570b03422ffbe5d3d090f91758ebfd46acd5d57", +"HMAC-SHA1(des/fips_des_selftest.c)= 3bc574e51647c5f5ab45d1007b2cf461d67764a9", +"HMAC-SHA1(des/fips_set_key.c)= cd1ba25d29376849523a9ddc194c3156a8a7a913", +"HMAC-SHA1(des/fips_des_locl.h)= e008da40dc6913e374edd66a20d44e1752f00583", +"HMAC-SHA1(dh/fips_dh_check.c)= 63347e2007e224381d4a7b6d871633889de72cf3", +"HMAC-SHA1(dh/fips_dh_gen.c)= 93fe69b758ca9d70d70cda1c57fff4eb5c668e85", +"HMAC-SHA1(dh/fips_dh_key.c)= a84970913f0eaa098fc4e48d4487b45ebe27bcc3", +"HMAC-SHA1(dsa/fips_dsa_ossl.c)= e02fac446e5f89d22ffa0468fbc97d8dab7a5da8", +"HMAC-SHA1(dsa/fips_dsa_gen.c)= c252db14699f3ff641db052311da7d7521569c53", +"HMAC-SHA1(dsa/fips_dsa_selftest.c)= 7c2ba8d82feda2aadc8b769a3b6c4c25a6356e01", +"HMAC-SHA1(rand/fips_rand.c)= 29139e29f56f3ecd99f527af8742d5afb12f409a", +"HMAC-SHA1(rand/fips_rand.h)= bf009ea8963e79b1e414442ede9ae7010a03160b", +"HMAC-SHA1(rsa/fips_rsa_eay.c)= dc0c262df0a218b290192edb21639ced4532e857", +"HMAC-SHA1(rsa/fips_rsa_gen.c)= 713d2e0d7a1a682b1794f1224b7afe01272ba755", +"HMAC-SHA1(rsa/fips_rsa_selftest.c)= 8c915b5a4e354dcede93ba08c42858d4dd884e67", +"HMAC-SHA1(sha1/fips_sha1dgst.c)= 867e990149be16fe9e758b916b5ffc9d9fa61afb", +"HMAC-SHA1(sha1/fips_standalone_sha1.c)= 93203c569097189b47a0085bc9fc55193867d4ce", +"HMAC-SHA1(sha1/fips_sha1_selftest.c)= bd5c6ece3ef96237440bb0c51c7cf2bd42d39483", +"HMAC-SHA1(sha1/asm/fips-sx86-elf.s)= ae66fb23ab8e1a2287e87a0a2dd30a4b9039fe63", +"HMAC-SHA1(sha1/fips_sha_locl.h)= c1b4c82eec5f0ee119658456690f3ea9d77ed1c5", +"HMAC-SHA1(sha1/fips_md32_common.h)= 08a057a7b94acf5df4301ea6c894ce14082e1ec4", +}; diff --git a/fips/fipshashes.sha1 b/fips/fipshashes.sha1 deleted file mode 100644 index 9d2714dc98..0000000000 --- a/fips/fipshashes.sha1 +++ /dev/null @@ -1,30 +0,0 @@ -HMAC-SHA1(fips.c)= f14ae9175119f045f1c645a2458602ccd2b2a34e -HMAC-SHA1(fips_err_wrapper.c)= d3e2be316062510312269e98f964cb87e7577898 -HMAC-SHA1(fips.h)= 70f0181f269e6b09a9e3e6d9ff82f3461bd41222 -HMAC-SHA1(fips_err.h)= 03468e3b593f7528fd934e49bf052c23cc98d301 -HMAC-SHA1(aes/fips_aes_core.c)= b70bbbd675efe0613da0d57055310926a0104d55 -HMAC-SHA1(aes/asm/fips-ax86-elf.s)= 0d1c89f93cbf7bf4854bb238627c99ecda462f17 -HMAC-SHA1(aes/fips_aes_selftest.c)= 98b01502221e7fe529fd981222f2cbb52eb4cbe0 -HMAC-SHA1(aes/fips_aes_locl.h)= a98eb0aa449f1d95b8064e261b2ac2b1f328685e -HMAC-SHA1(des/fips_des_enc.c)= 9527f8ea81602358f1aa11348237fdb1e9eeff32 -HMAC-SHA1(des/asm/fips-dx86-elf.s)= 9570b03422ffbe5d3d090f91758ebfd46acd5d57 -HMAC-SHA1(des/fips_des_selftest.c)= 3bc574e51647c5f5ab45d1007b2cf461d67764a9 -HMAC-SHA1(des/fips_set_key.c)= cd1ba25d29376849523a9ddc194c3156a8a7a913 -HMAC-SHA1(des/fips_des_locl.h)= e008da40dc6913e374edd66a20d44e1752f00583 -HMAC-SHA1(dh/fips_dh_check.c)= 63347e2007e224381d4a7b6d871633889de72cf3 -HMAC-SHA1(dh/fips_dh_gen.c)= 93fe69b758ca9d70d70cda1c57fff4eb5c668e85 -HMAC-SHA1(dh/fips_dh_key.c)= a84970913f0eaa098fc4e48d4487b45ebe27bcc3 -HMAC-SHA1(dsa/fips_dsa_ossl.c)= e02fac446e5f89d22ffa0468fbc97d8dab7a5da8 -HMAC-SHA1(dsa/fips_dsa_gen.c)= c252db14699f3ff641db052311da7d7521569c53 -HMAC-SHA1(dsa/fips_dsa_selftest.c)= 7c2ba8d82feda2aadc8b769a3b6c4c25a6356e01 -HMAC-SHA1(rand/fips_rand.c)= 29139e29f56f3ecd99f527af8742d5afb12f409a -HMAC-SHA1(rand/fips_rand.h)= bf009ea8963e79b1e414442ede9ae7010a03160b -HMAC-SHA1(rsa/fips_rsa_eay.c)= dc0c262df0a218b290192edb21639ced4532e857 -HMAC-SHA1(rsa/fips_rsa_gen.c)= 713d2e0d7a1a682b1794f1224b7afe01272ba755 -HMAC-SHA1(rsa/fips_rsa_selftest.c)= 8c915b5a4e354dcede93ba08c42858d4dd884e67 -HMAC-SHA1(sha1/fips_sha1dgst.c)= 867e990149be16fe9e758b916b5ffc9d9fa61afb -HMAC-SHA1(sha1/fips_standalone_sha1.c)= 93203c569097189b47a0085bc9fc55193867d4ce -HMAC-SHA1(sha1/fips_sha1_selftest.c)= bd5c6ece3ef96237440bb0c51c7cf2bd42d39483 -HMAC-SHA1(sha1/asm/fips-sx86-elf.s)= ae66fb23ab8e1a2287e87a0a2dd30a4b9039fe63 -HMAC-SHA1(sha1/fips_sha_locl.h)= c1b4c82eec5f0ee119658456690f3ea9d77ed1c5 -HMAC-SHA1(sha1/fips_md32_common.h)= 08a057a7b94acf5df4301ea6c894ce14082e1ec4 diff --git a/fips/sha1/standalone.sha1 b/fips/sha1/standalone.sha1 deleted file mode 100644 index d929a1e6d2..0000000000 --- a/fips/sha1/standalone.sha1 +++ /dev/null @@ -1,6 +0,0 @@ -HMAC-SHA1(fips_sha1dgst.c)= 867e990149be16fe9e758b916b5ffc9d9fa61afb -HMAC-SHA1(fips_sha1_selftest.c)= bd5c6ece3ef96237440bb0c51c7cf2bd42d39483 -HMAC-SHA1(asm/fips-sx86-elf.s)= ae66fb23ab8e1a2287e87a0a2dd30a4b9039fe63 -HMAC-SHA1(fips_standalone_sha1.c)= 93203c569097189b47a0085bc9fc55193867d4ce -HMAC-SHA1(fips_sha_locl.h)= c1b4c82eec5f0ee119658456690f3ea9d77ed1c5 -HMAC-SHA1(fips_md32_common.h)= 08a057a7b94acf5df4301ea6c894ce14082e1ec4 diff --git a/util/checkhash.pl b/util/checkhash.pl index 2b8df90263..b4a21a4935 100644 --- a/util/checkhash.pl +++ b/util/checkhash.pl @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -w +#!/usr/bin/env perl -w my $package = caller; @@ -22,7 +22,7 @@ sub check_hashes my $badfiles = 0; my $rebuild = 0; my $force_rewrite = 0; - my $hash_file = "fipshashes.sha1"; + my $hash_file = "fipshashes.c"; my $recurse = 0; my @fingerprint_files; @@ -98,8 +98,9 @@ sub check_hashes while () { chomp; - if (!(($file, $hash) = /^HMAC-SHA1\((.*)\)\s*=\s*(\w*)$/)) + if (!(($file, $hash) = /^[\"]*HMAC-SHA1\((.*)\)\s*=\s*(\w*)[\",]*$/)) { + /^\"/ || next; print STDERR "FATAL: Invalid syntax in file $fp\n"; print STDERR "Line:\n$_\n"; fatal_error(); @@ -194,10 +195,12 @@ sub check_hashes print STDERR "Error rewriting $hash_file"; return 1; } + print OUT "const char * const FIPS_source_hashes[] = {\n"; foreach (@hashed_files) { - print OUT "HMAC-SHA1($_)= $hashes{$_}\n"; + print OUT "\"HMAC-SHA1($_)= $hashes{$_}\",\n"; } + print OUT "};\n"; close OUT; }