2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Replace "sha1sum" with "openssl sha1 -r"

"sha1sum" is part of GNU Coreutils, neither BIND 9 dependency nor POSIX.
Replace it with "openssl sha1 -r" as OpenSSL is BIND 9 dependency.
This commit is contained in:
Michal Nowak
2022-09-08 19:31:58 +02:00
parent ae33a8ddea
commit d34c7ae227
3 changed files with 4 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ keygen() {
id="$4"
label="${id}-${zone}"
p11id=$(echo "${label}" | sha1sum - | awk '{print $1}')
p11id=$(echo "${label}" | openssl sha1 -r | awk '{print $1}')
pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-engine_pkcs11" -l -k --key-type $type:$bits --label "${label}" --id "${p11id}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id 2> pkcs11-tool.err.$zone.$id || return 1
}

View File

@@ -23,7 +23,7 @@ keygen() {
id="$4"
label="${id}-${zone}"
p11id=$(echo "${label}" | sha1sum - | awk '{print $1}')
p11id=$(echo "${label}" | openssl sha1 -r | awk '{print $1}')
pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-keyfromlabel" -l -k --key-type $type:$bits --label "${label}" --id "${p11id}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id || return 1
}

View File

@@ -206,8 +206,8 @@ this is when creating ECDSA keys, you should specify a unique ID:
::
ksk=$(echo "example.net-ksk" | sha1sum - | awk '{print $1}')
zsk=$(echo "example.net-zsk" | sha1sum - | awk '{print $1}')
ksk=$(echo "example.net-ksk" | openssl sha1 -r | awk '{print $1}')
zsk=$(echo "example.net-zsk" | openssl sha1 -r | awk '{print $1}')
pkcs11-tool --module <FULL_PATH_TO_HSM_MODULE> -l -k --key-type EC:prime256v1 --id $ksk --label example.net-ksk --pin <PIN>
pkcs11-tool --module <FULL_PATH_TO_HSM_MODULE> -l -k --key-type EC:prime256v1 --id $zsk --label example.net-zsk --pin <PIN>