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