From 146fa881f24069386188859d4ef87fd4c65c6686 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Tue, 28 Oct 2014 08:37:53 +0100 Subject: [PATCH] add an error message for wrong key length --- tool/yubico-piv-tool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tool/yubico-piv-tool.c b/tool/yubico-piv-tool.c index cbe971d..6c9b62e 100644 --- a/tool/yubico-piv-tool.c +++ b/tool/yubico-piv-tool.c @@ -1180,8 +1180,9 @@ int main(int argc, char *argv[]) { printf("Successfully set new management key.\n"); } } else { + fprintf(stderr, "The new management key has to be exactly %d character.\n", KEY_LEN * 2); ret = EXIT_FAILURE; - } + } } else { fprintf(stderr, "The set-mgm-key action needs the new-key (-n) argument.\n"); ret = EXIT_FAILURE;