diff options
author | Dave Heller <hellerda@linux.vnet.ibm.com> | 2018-01-20 21:45:27 -0500 |
---|---|---|
committer | Dave Heller <hellerda@linux.vnet.ibm.com> | 2018-01-20 21:45:27 -0500 |
commit | e34abf2f58039ff51c40982210891080662cda9a (patch) | |
tree | c421892b15e6de4a9a2fe7d5465b74ae1d802811 | |
parent | 9c5eef8b773b5a96e68b1a19214b59709dffc807 (diff) | |
download | sb-signing-utils-e34abf2f58039ff51c40982210891080662cda9a.tar.gz sb-signing-utils-e34abf2f58039ff51c40982210891080662cda9a.zip |
Remove dependence on 'xxd' (part 1)
There is no 'xxd' command in AIX. This patch removes one of the two
dependencies in crtSignedContainer.sh: in the is_key_raw() function.
This is now done with a shell comparison instead.
Signed-off-by: Dave Heller <hellerda@linux.vnet.ibm.com>
-rwxr-xr-x | crtSignedContainer.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crtSignedContainer.sh b/crtSignedContainer.sh index c42434e..ecfa291 100755 --- a/crtSignedContainer.sh +++ b/crtSignedContainer.sh @@ -68,8 +68,11 @@ is_public_key () { } is_raw_key () { - test "$(stat -c%s "$1")" -eq 133 -a \ - "$(dd if="$1" bs=1 count=1 2>/dev/null | xxd -p)" == "04" + # A RAW p521 pubkey will be 133 bytes with a leading byte of 0x04, + # indicating an uncompressed key. + test "$1" && \ + test "$(stat -c%s "$1")" -eq 133 && \ + [[ $(dd if="$1" bs=1 count=1 2>/dev/null) == $'\004' ]] } to_lower () { |