Bugzilla – Attachment 2781 Details for
Bug 2522
Key parser should reflect errors from OpenSSL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
openssh_pem_parse.patch (text/plain), 790 bytes, created by
Jakub Jelen
on 2016-01-09 03:15:29 AEDT
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Jakub Jelen
Created:
2016-01-09 03:15:29 AEDT
Size:
790 bytes
patch
obsolete
>diff --git a/sshkey.c b/sshkey.c >index 1710457..0479f13 100644 >--- a/sshkey.c >+++ b/sshkey.c >@@ -3777,6 +3777,7 @@ sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, > struct sshkey *prv = NULL; > BIO *bio = NULL; > int r; >+ unsigned long e; > > *keyp = NULL; > >@@ -3790,7 +3791,14 @@ sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, > > if ((pk = PEM_read_bio_PrivateKey(bio, NULL, NULL, > (char *)passphrase)) == NULL) { >- r = SSH_ERR_KEY_WRONG_PASSPHRASE; >+ e = ERR_peek_error(); >+ ERR_print_errors_fp(stderr); >+ if (ERR_GET_REASON(e) == PEM_R_NO_START_LINE || >+ ERR_GET_REASON(e) == PEM_R_BAD_END_LINE) { >+ r = SSH_ERR_INVALID_FORMAT; >+ } else { >+ r = SSH_ERR_KEY_WRONG_PASSPHRASE; >+ } > goto out; > } > if (pk->type == EVP_PKEY_RSA &&
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2522
:
2781
|
2806
|
2844