enforce minimum 6 digits of pin when changing in the tool

This commit is contained in:
Klas Lindfors
2016-04-19 14:19:19 +02:00
parent d1c454ca02
commit b512077c21
+5
View File
@@ -1000,6 +1000,11 @@ static bool change_pin(ykpiv_state *state, enum enum_action action, const char *
return false; return false;
} }
if(new_len < 6) {
fprintf(stderr, "Minimum 6 digits of PIN supported.\n");
return false;
}
if(action == action_arg_unblockMINUS_pin) { if(action == action_arg_unblockMINUS_pin) {
op = ykpiv_unblock_pin; op = ykpiv_unblock_pin;
} }