summaryrefslogtreecommitdiffstats
path: root/crtSignedContainer.sh
diff options
context:
space:
mode:
Diffstat (limited to 'crtSignedContainer.sh')
-rwxr-xr-xcrtSignedContainer.sh7
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 () {
OpenPOWER on IntegriCloud