diff --git a/tool/yubico-piv-tool.c b/tool/yubico-piv-tool.c index f33ced6..dd803c2 100644 --- a/tool/yubico-piv-tool.c +++ b/tool/yubico-piv-tool.c @@ -83,7 +83,7 @@ static void print_version(ykpiv_state *state) { if(ykpiv_get_version(state, version, sizeof(version)) == YKPIV_OK) { printf("Applet version %s found.\n", version); } else { - printf("Failed to retreive apple version.\n"); + fprintf(stderr, "Failed to retreive apple version.\n"); } } @@ -983,7 +983,7 @@ static bool delete_certificate(ykpiv_state *state, enum enum_slot slot) { fprintf(stderr, "Failed deleting object.\n"); return false; } else { - fprintf(stdout, "Certificate deleted.\n"); + fprintf(stderr, "Certificate deleted.\n"); return true; } } @@ -1222,7 +1222,7 @@ int main(int argc, char *argv[]) { } else if(ykpiv_set_mgmkey(state, new_key) != YKPIV_OK) { ret = EXIT_FAILURE; } else { - printf("Successfully set new management key.\n"); + fprintf(stderr, "Successfully set new management key.\n"); } } else { fprintf(stderr, "The new management key has to be exactly %d character.\n", KEY_LEN * 2); @@ -1238,7 +1238,7 @@ int main(int argc, char *argv[]) { fprintf(stderr, "Reset failed, are pincodes blocked?\n"); ret = EXIT_FAILURE; } else { - printf("Successfully reset the applet.\n"); + fprintf(stderr, "Successfully reset the applet.\n"); } break; case action_arg_pinMINUS_retries: @@ -1246,7 +1246,7 @@ int main(int argc, char *argv[]) { if(set_pin_retries(state, args_info.pin_retries_arg, args_info.puk_retries_arg, verbosity) == false) { ret = EXIT_FAILURE; } else { - printf("Successfully changed pin retries to %d and puk retries to %d, both codes have been reset to default now.\n", + fprintf(stderr, "Successfully changed pin retries to %d and puk retries to %d, both codes have been reset to default now.\n", args_info.pin_retries_arg, args_info.puk_retries_arg); } } else { @@ -1259,7 +1259,7 @@ int main(int argc, char *argv[]) { if(import_key(state, args_info.key_format_arg, args_info.input_arg, args_info.slot_orig, args_info.password_arg) == false) { ret = EXIT_FAILURE; } else { - printf("Successfully imported a new private key.\n"); + fprintf(stderr, "Successfully imported a new private key.\n"); } } else { fprintf(stderr, "The import action needs a slot (-s) to operate on.\n"); @@ -1271,7 +1271,7 @@ int main(int argc, char *argv[]) { if(import_cert(state, args_info.key_format_arg, args_info.input_arg, args_info.slot_arg, args_info.password_arg) == false) { ret = EXIT_FAILURE; } else { - printf("Successfully imported a new certificate.\n"); + fprintf(stderr, "Successfully imported a new certificate.\n"); } } else { fprintf(stderr, "The import action needs a slot (-s) to operate on.\n"); @@ -1282,7 +1282,7 @@ int main(int argc, char *argv[]) { if(set_chuid(state, verbosity) == false) { ret = EXIT_FAILURE; } else { - printf("Successfully set new CHUID.\n"); + fprintf(stderr, "Successfully set new CHUID.\n"); } break; case action_arg_requestMINUS_certificate: @@ -1303,7 +1303,7 @@ int main(int argc, char *argv[]) { case action_arg_verifyMINUS_pin: if(args_info.pin_arg) { if(verify_pin(state, args_info.pin_arg)) { - printf("Successfully verified PIN.\n"); + fprintf(stderr, "Successfully verified PIN.\n"); } else { ret = EXIT_FAILURE; } @@ -1318,9 +1318,9 @@ int main(int argc, char *argv[]) { if(args_info.pin_arg && args_info.new_pin_arg) { if(change_pin(state, action, args_info.pin_arg, args_info.new_pin_arg)) { if(action == action_arg_unblockMINUS_pin) { - printf("Successfully unblocked the pin code.\n"); + fprintf(stderr, "Successfully unblocked the pin code.\n"); } else { - printf("Successfully changed the %s code.\n", + fprintf(stderr, "Successfully changed the %s code.\n", action == action_arg_changeMINUS_pin ? "pin" : "puk"); } } else {