From 382a4fad985041c7b4f929da693ee01701a4b49f Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Mon, 29 Sep 2014 15:49:49 +0200 Subject: [PATCH] better error message --- tool/yubico-piv-signer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tool/yubico-piv-signer.c b/tool/yubico-piv-signer.c index 1a25dc2..3aca575 100644 --- a/tool/yubico-piv-signer.c +++ b/tool/yubico-piv-signer.c @@ -167,8 +167,9 @@ static bool sign_file(ykpiv_state *state, const char *input, const char *output, { unsigned char buf[1024]; size_t len = sizeof(buf); - if(ykpiv_sign_data(state, hashed, hash_len, buf, &len, algo, key) != YKPIV_OK) { - fprintf(stderr, "failed signing file\n"); + ykpiv_rc rc = ykpiv_sign_data(state, hashed, hash_len, buf, &len, algo, key); + if(rc != YKPIV_OK) { + fprintf(stderr, "failed signing file: %s\n", ykpiv_strerror(rc)); goto out; }