Skip to content

Commit 88d54fd

Browse files
committed
FIPS: make it possible to specify fipshmac binary.
Signed-off-by: Michal Suchanek <[email protected]>
1 parent a70dfe1 commit 88d54fd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

openssl-fipshmac

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh -e
2+
3+
if [ "$#" -eq 0 ] ; then
4+
echo "No library to hash specified." >&2
5+
exit 22
6+
fi
7+
8+
while [ -n "$1" ] ; do
9+
dgst="$(openssl dgst -sha256 -mac hmac -macopt hexkey:00000000 "$1")"
10+
echo "$dgst" | sed -e 's/^.* //' > "$(dirname "$1")/.$(basename "$1")".hmac
11+
shift
12+
done

src/Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ mp.S : mp.pl
4646
./mp.pl mp.S
4747

4848
if ICA_FIPS
49+
FIPSHMAC ?= ${top_srcdir}/openssl-fipshmac
4950
hmac-file-lnk: hmac-file
5051
$(AM_V_GEN) cd ${top_builddir}/src/.libs && ln -sf .libica.so.$(VERSION1).hmac .libica.so.$(MAJOR).hmac
5152
$(AM_V_GEN) cd ${top_builddir}/src/.libs && ln -sf .libica-cex.so.$(VERSION1).hmac .libica-cex.so.$(MAJOR).hmac
5253

5354
hmac-file: libica.la libica-cex.la
54-
$(AM_V_GEN) openssl dgst -sha256 -mac hmac -macopt hexkey:00000000 ${top_builddir}/src/.libs/libica.so.$(VERSION1) | sed -e 's/^.* //' > ${top_builddir}/src/.libs/.libica.so.$(VERSION1).hmac
55-
$(AM_V_GEN) openssl dgst -sha256 -mac hmac -macopt hexkey:00000000 ${top_builddir}/src/.libs/libica-cex.so.$(VERSION1) | sed -e 's/^.* //' > ${top_builddir}/src/.libs/.libica-cex.so.$(VERSION1).hmac
55+
$(AM_V_GEN) $(FIPSHMAC) ${top_builddir}/src/.libs/libica.so.$(VERSION1) ${top_builddir}/src/.libs/libica-cex.so.$(VERSION1)
5656

5757
hmac_files = hmac-file hmac-file-lnk
5858

0 commit comments

Comments
 (0)