From b512077c218f73e86a0296b0921ab04289f81048 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Tue, 19 Apr 2016 14:19:19 +0200 Subject: [PATCH] enforce minimum 6 digits of pin when changing in the tool --- tool/yubico-piv-tool.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tool/yubico-piv-tool.c b/tool/yubico-piv-tool.c index bcc2892..01be2f8 100644 --- a/tool/yubico-piv-tool.c +++ b/tool/yubico-piv-tool.c @@ -1000,6 +1000,11 @@ static bool change_pin(ykpiv_state *state, enum enum_action action, const char * return false; } + if(new_len < 6) { + fprintf(stderr, "Minimum 6 digits of PIN supported.\n"); + return false; + } + if(action == action_arg_unblockMINUS_pin) { op = ykpiv_unblock_pin; }