aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2022-02-17 10:28:05 +0900
committerNIIBE Yutaka <[email protected]>2022-02-17 10:28:05 +0900
commit3c8b6c4a9cad59c5e1db5706f6774a3141b60210 (patch)
tree45d3bf5d5056f51f385c16006e597a3caed3bfd7
parent5420cbbd3ec7ebf081224796e8d1f8299f7ad985 (diff)
downloadlibgcrypt-3c8b6c4a9cad59c5e1db5706f6774a3141b60210.tar.gz
libgcrypt-3c8b6c4a9cad59c5e1db5706f6774a3141b60210.tar.bz2
libgcrypt-3c8b6c4a9cad59c5e1db5706f6774a3141b60210.zip
fips: Fix gen-note-integrity.sh script not to use cmp utility.
* src/gen-note-integrity.sh: Simplify detecting 32-bit machine or 64-bit machine. -- GnuPG-bug-id: 5835 Signed-off-by: NIIBE Yutaka <[email protected]>
-rwxr-xr-xsrc/gen-note-integrity.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gen-note-integrity.sh b/src/gen-note-integrity.sh
index 969fdca6..878d7095 100755
--- a/src/gen-note-integrity.sh
+++ b/src/gen-note-integrity.sh
@@ -73,9 +73,9 @@ FILE=.libs/libgcrypt.so
#
# Fixup the ELF header to clean up section information
#
-printf '%b' '\002' > 2.bin
-dd ibs=1 skip=4 count=1 if=$FILE status=none > class-byte.bin
-if cmp class-byte.bin 2.bin; then
+BYTE002=$(printf '%b' '\002')
+CLASS_BYTE=$(dd ibs=1 skip=4 count=1 if=$FILE status=none)
+if test "$CLASS_BYTE" = "$BYTE002"; then
CLASS=64
HEADER_SIZE=64
else
@@ -112,4 +112,4 @@ END { print offset}")
dd ibs=1 skip=$HEADER_SIZE count=$OFFSET if=$FILE status=none) \
| ./hmac256 --stdkey --binary
-rm -f 2.bin class-byte.bin header-fixed.bin
+rm -f header-fixed.bin