From 2bde0885ef0412ba61839520c3c6bed1e1c354cf Mon Sep 17 00:00:00 2001 From: Karel Srot Date: Mon, 21 Oct 2024 17:03:39 +0200 Subject: [PATCH] Fix opencryptoki.conf parsing in pkcsGetTokenSlot --- Library/token-manipulation/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/token-manipulation/lib.sh b/Library/token-manipulation/lib.sh index b9647a1..04a4a28 100644 --- a/Library/token-manipulation/lib.sh +++ b/Library/token-manipulation/lib.sh @@ -118,7 +118,7 @@ pkcsGetTokenSlot() { local SLOT [ -z "$TYPE" ] && echo "Error: pkcsGetTokenSlot: no token type specified" && return 1 if grep -q "^stdll = libpkcs11_$TYPE.so" $CONF; then - SLOT=$( egrep "^(slot|stdll = libpkcs11_$TYPE.so)" $CONF | grep -B 1 "libpkcs11" | sed -n -e '1,1 s/slot //' -e '1,1 p' ) + SLOT=$( egrep "(^slot|stdll = libpkcs11_$TYPE.so)" $CONF | grep -B 1 "libpkcs11" | sed -n -e '1,1 s/slot //' -e '1,1 p' ) echo $SLOT else echo "Error: pkcsGetTokenSlot: could not find type $TYPE in $CONF"