better error message

This commit is contained in:
Klas Lindfors
2014-09-29 15:49:49 +02:00
parent 7e5ffd254f
commit 382a4fad98
+3 -2
View File
@@ -167,8 +167,9 @@ static bool sign_file(ykpiv_state *state, const char *input, const char *output,
{ {
unsigned char buf[1024]; unsigned char buf[1024];
size_t len = sizeof(buf); size_t len = sizeof(buf);
if(ykpiv_sign_data(state, hashed, hash_len, buf, &len, algo, key) != YKPIV_OK) { ykpiv_rc rc = ykpiv_sign_data(state, hashed, hash_len, buf, &len, algo, key);
fprintf(stderr, "failed signing file\n"); if(rc != YKPIV_OK) {
fprintf(stderr, "failed signing file: %s\n", ykpiv_strerror(rc));
goto out; goto out;
} }