Skip to content
Permalink
errors
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
@tpgxyz
Latest commit 93351c4 Feb 5, 2021 History
1 contributor

Users who have contributed to this file

diff -Naur a/ssh-add.c b/ssh-add.c
--- a/ssh-add.c 2020-09-27 07:25:01.000000000 +0000
+++ b/ssh-add.c 2021-02-05 11:33:18.751000000 +0000
@@ -41,6 +41,7 @@
#include <sys/stat.h>
#ifdef WITH_OPENSSL
+# include <openssl/err.h>
# include <openssl/evp.h>
# include "openbsd-compat/openssl-compat.h"
#endif
@@ -261,9 +262,10 @@
return -1;
}
}
+ ERR_load_crypto_strings();
if ((r = sshbuf_load_fd(fd, &keyblob)) != 0) {
- fprintf(stderr, "Error loading key \"%s\": %s\n",
- filename, ssh_err(r));
+ fprintf(stderr, "%d: Error loading key \"%s\": %s\n",
+ __LINE__, filename, ssh_err(r));
sshbuf_free(keyblob);
close(fd);
return -1;
@@ -273,16 +275,16 @@
/* At first, try empty passphrase */
if ((r = sshkey_parse_private_fileblob(keyblob, "", &private,
&comment)) != 0 && r != SSH_ERR_KEY_WRONG_PASSPHRASE) {
- fprintf(stderr, "Error loading key \"%s\": %s\n",
- filename, ssh_err(r));
+ fprintf(stderr, "%d: Error loading key \"%s\": %s\n",
+ __LINE__, filename, ssh_err(r));
goto fail_load;
}
/* try last */
if (private == NULL && pass != NULL) {
if ((r = sshkey_parse_private_fileblob(keyblob, pass, &private,
&comment)) != 0 && r != SSH_ERR_KEY_WRONG_PASSPHRASE) {
- fprintf(stderr, "Error loading key \"%s\": %s\n",
- filename, ssh_err(r));
+ fprintf(stderr, "%d: Error loading key \"%s\": %s\n",
+ __LINE__, filename, ssh_err(r));
goto fail_load;
}
}
@@ -300,9 +302,11 @@
break;
else if (r != SSH_ERR_KEY_WRONG_PASSPHRASE) {
fprintf(stderr,
- "Error loading key \"%s\": %s\n",
- filename, ssh_err(r));
+ "%d: Error loading key \"%s\": %s\n",
+ __LINE__, filename, ssh_err(r));
fail_load:
+ if (r == SSH_ERR_LIBCRYPTO_ERROR)
+ ERR_print_errors_fp(stderr);
clear_pass();
sshbuf_free(keyblob);
return -1;