Skip to content

Commit 39612af

Browse files
author
“sahmad154”
committed
Fix: Use --free instead of --slot 0 for token initialization
SoftHSM assigns slot numbers dynamically regardless of --slot parameter. Using --free is the correct approach - import script already handles dynamic slot lookup via token label.
1 parent affa587 commit 39612af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

native-platform/scripts/init-pkcs11-tokens.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ if softhsm2-util --show-slots 2>/dev/null | grep -q "$TOKEN_LABEL"; then
2424
exit 0
2525
fi
2626

27-
# Initialize token at slot 0 (fixed slot for consistent PKCS#11 URIs)
28-
echo "[init-pkcs11-tokens] Creating token '$TOKEN_LABEL' at slot 0..."
27+
# Initialize token at free slot (SoftHSM assigns slots dynamically)
28+
echo "[init-pkcs11-tokens] Creating token '$TOKEN_LABEL'..."
2929
softhsm2-util --init-token \
30-
--slot 0 \
30+
--free \
3131
--label "$TOKEN_LABEL" \
3232
--so-pin "$SO_PIN" \
3333
--pin "$USER_PIN"

0 commit comments

Comments
 (0)