Permalink
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?
openssh/openssh-8.4p1-catch-openssl-errors.patch
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
59 lines (58 sloc)
1.83 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |