From c9ee3ccd45f19e4b828b4770b57678fae526278b Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sat, 4 Oct 2003 14:11:45 +0000 Subject: [PATCH] Fingerprinting needs to work even if OpenSSL isn't installed yet. --- fips/aes/Makefile.ssl | 2 +- fips/des/Makefile.ssl | 2 +- fips/dsa/Makefile.ssl | 2 +- fips/openssl_fips_fingerprint | 7 +++++++ fips/sha1/Makefile.ssl | 2 +- test/Makefile.ssl | 12 ++++++------ 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/fips/aes/Makefile.ssl b/fips/aes/Makefile.ssl index b3101a2d0e..192912cee1 100644 --- a/fips/aes/Makefile.ssl +++ b/fips/aes/Makefile.ssl @@ -74,7 +74,7 @@ top_fips_aesavs: fips_aesavs: fips_aesavs.o $(TOP)/libcrypto.a $(CC) $(CFLAGS) -o fips_aesavs fips_aesavs.o $(TOP)/libcrypto.a - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_aesavs + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_aesavs fips_test: top top_fips_aesavs find ../testvectors/aes/req -name '*.req' > testlist diff --git a/fips/des/Makefile.ssl b/fips/des/Makefile.ssl index 72562c804a..6f753585b0 100644 --- a/fips/des/Makefile.ssl +++ b/fips/des/Makefile.ssl @@ -72,7 +72,7 @@ top_fips_desmovs: fips_desmovs: fips_desmovs.o $(TOP)/libcrypto.a $(CC) $(CFLAGS) -o fips_desmovs fips_desmovs.o $(TOP)/libcrypto.a - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_desmovs + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_desmovs fips_test: top_fips_desmovs find ../testvectors/des/req -name '*.req' > testlist diff --git a/fips/dsa/Makefile.ssl b/fips/dsa/Makefile.ssl index 11d23bcc3e..4aabe5553a 100644 --- a/fips/dsa/Makefile.ssl +++ b/fips/dsa/Makefile.ssl @@ -72,7 +72,7 @@ top_fips_dssvs: fips_dssvs: fips_dssvs.o $(TOP)/libcrypto.a $(CC) $(CFLAGS) -o fips_dssvs fips_dssvs.o $(TOP)/libcrypto.a - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_dssvs + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_dssvs Q=../testvectors/dsa/req A=../testvectors/dsa/rsp diff --git a/fips/openssl_fips_fingerprint b/fips/openssl_fips_fingerprint index 98f69f2c4d..6d86c90033 100755 --- a/fips/openssl_fips_fingerprint +++ b/fips/openssl_fips_fingerprint @@ -6,6 +6,13 @@ lib=$1 exe=$2 +# deal with the case where we're run from within the build and OpenSSL is +# not yet installed +if [ "X$TOP" != "X" ] +then + PATH=$PATH:$TOP/apps +fi + elib=`echo $lib| sed 's/\//\\\\\//g'` echo "Checking library fingerprint for $lib" openssl sha1 $lib | sed "s/$elib/libcrypto.a/" | diff -u ${lib%.a}.sha1 - || { echo "$libs fingerprint mismatch"; exit 1; } diff --git a/fips/sha1/Makefile.ssl b/fips/sha1/Makefile.ssl index 18657c9136..00ce6d15fa 100644 --- a/fips/sha1/Makefile.ssl +++ b/fips/sha1/Makefile.ssl @@ -82,7 +82,7 @@ top_fips_sha1test: fips_sha1test: fips_sha1test.o $(TOP)/libcrypto.a $(CC) $(CFLAGS) -o fips_sha1test fips_sha1test.o $(TOP)/libcrypto.a - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_sha1test + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a fips_sha1test fips_test: top_fips_sha1test -rm -rf ../testvectors/sha1/rsp diff --git a/test/Makefile.ssl b/test/Makefile.ssl index 83a86964c0..ca247529f7 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -322,7 +322,7 @@ $(FIPS_AESTEST): $(FIPS_AESTEST).o $(DLIBCRYPTO) $(CC) -o $(FIPS_AESTEST) $(CFLAGS) $(FIPS_AESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ fi if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_AESTEST); \ + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_AESTEST); \ fi $(RSATEST): $(RSATEST).o $(DLIBCRYPTO) @@ -396,7 +396,7 @@ $(FIPS_SHA1TEST): $(FIPS_SHA1TEST).o $(DLIBCRYPTO) $(CC) -o $(FIPS_SHA1TEST) $(CFLAGS) $(FIPS_SHA1TEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ fi if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_SHA1TEST); \ + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_SHA1TEST); \ fi $(RMDTEST): $(RMDTEST).o $(DLIBCRYPTO) @@ -495,7 +495,7 @@ $(FIPS_DESTEST): $(FIPS_DESTEST).o $(DLIBCRYPTO) $(CC) -o $(FIPS_DESTEST) $(CFLAGS) $(FIPS_DESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ fi if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_DESTEST); \ + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_DESTEST); \ fi $(RANDTEST): $(RANDTEST).o $(DLIBCRYPTO) @@ -513,7 +513,7 @@ $(FIPS_RANDTEST): $(FIPS_RANDTEST).o $(DLIBCRYPTO) $(CC) -o $(FIPS_RANDTEST) $(CFLAGS) $(FIPS_RANDTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ fi if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_RANDTEST); \ + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_RANDTEST); \ fi $(DHTEST): $(DHTEST).o $(DLIBCRYPTO) @@ -539,7 +539,7 @@ $(FIPS_DSATEST): $(FIPS_DSATEST).o $(DLIBCRYPTO) $(CC) -o $(FIPS_DSATEST) $(CFLAGS) $(FIPS_DSATEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ fi if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_DSATEST); \ + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_DSATEST); \ fi $(METHTEST): $(METHTEST).o $(DLIBCRYPTO) @@ -558,7 +558,7 @@ $(SSLTEST): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) $(CC) -o $(SSLTEST) $(CFLAGS) $(SSLTEST).o $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \ fi if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ - $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(SSLTEST); \ + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(SSLTEST); \ fi $(ENGINETEST): $(ENGINETEST).o $(DLIBCRYPTO) -- 2.25.1