mirror of
https://github.com/token2/fido2-manage.git
synced 2026-04-09 02:35:39 +00:00
Implement minimum PIN length setting
Added functionality to set a minimum PIN length for the device.
This commit is contained in:
@@ -17,6 +17,7 @@ setPIN=false
|
||||
reset=false
|
||||
uvs=false
|
||||
uvd=false
|
||||
setMinimumPIN=""
|
||||
fingerprint=false
|
||||
help=false
|
||||
|
||||
@@ -107,7 +108,7 @@ if $help; then
|
||||
fi
|
||||
|
||||
# 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
|
||||
exit 1
|
||||
fi
|
||||
@@ -186,6 +187,12 @@ if [[ -n $device ]]; then
|
||||
exit 0
|
||||
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
|
||||
show_message "WARNING: Deleting a credential is irreversible. Are you sure you want to proceed? (Y/N)"
|
||||
read -r confirmation
|
||||
|
||||
Reference in New Issue
Block a user