From 3d8e113475976cdae755f344c71594b82e76f251 Mon Sep 17 00:00:00 2001 From: Florian Wernli Date: Tue, 23 Jan 2024 10:50:17 +0100 Subject: [PATCH] fixup! pk11_uri: pem encoder and decoder --- tests/tpem_encoder | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/tpem_encoder b/tests/tpem_encoder index 2dbba70a..bc8fb519 100755 --- a/tests/tpem_encoder +++ b/tests/tpem_encoder @@ -15,7 +15,8 @@ make-pkey-pem() { URI=$1 OUT=$2 - TMP_FILE=$(mktemp -p "${TMPPDIR}" -t pem-encoder-XXXXXX.cnf) + RANDOM_HEX=$(od -A n -N 15 -t x1 /dev/random) + TMP_FILE="${TMPPDIR}/pem-encoder-${RANDOM_HEX}.cnf" cat > "${TMP_FILE}" << EOF asn1=SEQUENCE:pk11-uri [pk11-uri] @@ -32,7 +33,9 @@ sign-verify() { PRIV_KEY=$1 PUB_KEY=$2 FILE=$3 - TMP_FILE=$(mktemp -p "${TMPPDIR}" -t sign-verify-pem-encoder-XXXXXX.bin) + + RANDOM_HEX=$(od -A n -N 15 -t x1 /dev/random) + TMP_FILE="${TMPPDIR}/sign-verify-pem-encoder-${RANDOM_HEX}.bin" $CHECKER openssl pkeyutl -sign -rawin -digest sha256 \ -inkey "${PRIV_KEY}" \ @@ -54,7 +57,7 @@ make-pkey-pem "${PRIURI}" "${TMPPDIR}/priuri-pkey.pem" sign-verify "${TMPPDIR}/priuri-pkey.pem" "${PUBURI}" "${TMPPDIR}/64krandom.bin" RANDOM_HEX=$(od -A n -N 15 -t x1 /dev/random) -export LABEL_SUFFIX_URI=${RANDOM_HEX// /%} +export LABEL_SUFFIX_URI=${RANDOM_HEX// /} export ALGORITHM=rsa export ALGORITHM_OPT=rsa_keygen_bits:2048