Implement minimum PIN length setting

Added functionality to set a minimum PIN length for the device.
This commit is contained in:
Token2
2026-01-08 19:53:58 +01:00
committed by GitHub
parent ffb284ca99
commit d84fdcb900

View File

@@ -17,6 +17,7 @@ setPIN=false
reset=false reset=false
uvs=false uvs=false
uvd=false uvd=false
setMinimumPIN=""
fingerprint=false fingerprint=false
help=false help=false
@@ -107,7 +108,7 @@ if $help; then
fi fi
# Check if no arguments are specified, then show help # Check if no arguments are specified, then show help
if ! $list && ! $info && [[ -z $device ]] && ! $fingerprint && ! $storage && ! $residentKeys && [[ -z $domain ]] && ! $delete && [[ -z $credential ]] && ! $changePIN && ! $setPIN && ! $reset && ! $uvs && ! $uvd && ! $help; then if ! $list && ! $info && [[ -z $device ]] && ! $fingerprint && ! $storage && ! $residentKeys && [[ -z $domain ]] && ! $delete && [[ -z $credential ]] && ! $changePIN && ! $setMinimumPIN && ! $setPIN && ! $reset && ! $uvs && ! $uvd && ! $help; then
show_help show_help
exit 1 exit 1
fi fi
@@ -186,6 +187,12 @@ if [[ -n $device ]]; then
exit 0 exit 0
fi fi
if [[ -n $setMinimumPIN ]]; then
show_message "Setting minimum PIN length to $setMinimumPIN on device $device"
"$FIDO2_TOKEN_CMD" -S -l "$setMinimumPIN" "$device_string"
exit 0
fi
if $delete && [[ -n $credential ]]; then if $delete && [[ -n $credential ]]; then
show_message "WARNING: Deleting a credential is irreversible. Are you sure you want to proceed? (Y/N)" show_message "WARNING: Deleting a credential is irreversible. Are you sure you want to proceed? (Y/N)"
read -r confirmation read -r confirmation