diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2022-02-17 10:28:05 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2022-02-17 10:28:05 +0900 |
commit | 3c8b6c4a9cad59c5e1db5706f6774a3141b60210 (patch) | |
tree | 45d3bf5d5056f51f385c16006e597a3caed3bfd7 | |
parent | 5420cbbd3ec7ebf081224796e8d1f8299f7ad985 (diff) | |
download | libgcrypt-3c8b6c4a9cad59c5e1db5706f6774a3141b60210.tar.gz |
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 <gniibe@fsij.org>
-rwxr-xr-x | src/gen-note-integrity.sh | 8 |
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 |