misc: replace sha256sum with shasum -a 256 (#1681)

This commit is contained in:
Malte Poll 2023-04-26 13:40:18 +02:00 committed by GitHub
parent 53d8a2d67e
commit ec1d5e9fb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 24 additions and 24 deletions

View file

@ -26,7 +26,7 @@ cmdline_measure() {
# convert to utf-16le and add a null terminator
iconv -f utf-8 -t utf-16le "${path}" -o "${tmp}"
truncate -s +2 "${tmp}"
sha256sum "${tmp}" | cut -d " " -f 1
shasum -a 256 "${tmp}" | cut -d " " -f 1
rm "${tmp}"
}
@ -62,11 +62,11 @@ cmdline_hash=$(cmdline_measure "${DIR}/cmdline")
cleanup "${DIR}"
expected_pcr_12=0000000000000000000000000000000000000000000000000000000000000000
expected_pcr_12=$(pcr_extend "${expected_pcr_12}" "${cmdline_hash}" "sha256sum")
expected_pcr_12=$(pcr_extend "${expected_pcr_12}" "${cmdline_hash}" "shasum -a 256")
if [[ ${CSP} == "azure" ]]; then
# Azure displays the boot menu
# triggering an extra measurement of the kernel command line.
expected_pcr_12=$(pcr_extend "${expected_pcr_12}" "${cmdline_hash}" "sha256sum")
expected_pcr_12=$(pcr_extend "${expected_pcr_12}" "${cmdline_hash}" "shasum -a 256")
fi
echo "Kernel commandline: ${cmdline}"

View file

@ -20,7 +20,7 @@ get_initrd_from_uki() {
initrd_measure() {
local path="$1"
sha256sum "${path}" | cut -d " " -f 1
shasum -a 256 "${path}" | cut -d " " -f 1
}
write_output() {