Bugzilla – Attachment 3192 Details for
Bug 2913
Reading PEM keys might fail if they decrypt to garbage with zero-length passprahse with new OpenSSL 1.1.0i
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
correct diff
bz2913.diff (text/plain), 965 bytes, created by
Damien Miller
on 2018-10-10 12:35:14 AEDT
(
hide
)
Description:
correct diff
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2018-10-10 12:35:14 AEDT
Size:
965 bytes
patch
obsolete
>diff --git a/sshkey.c b/sshkey.c >index e1e882b7..4a656f84 100644 >--- a/sshkey.c >+++ b/sshkey.c >@@ -3913,6 +3913,20 @@ convert_libcrypto_error(void) > return translate_libcrypto_error(ERR_peek_last_error()); > } > >+static int >+pem_passphrase_cb(char *buf, int size, int rwflag, void *u) >+{ >+ char *p = (char *)u; >+ size_t len; >+ >+ if (p == NULL || (len = strlen(p)) == 0) >+ return -1; >+ if (size < 0 || len > (size_t)size) >+ return -1; >+ memcpy(buf, p, len); >+ return (int)len; >+} >+ > static int > sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, > const char *passphrase, struct sshkey **keyp) >@@ -3934,7 +3948,7 @@ sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, > } > > clear_libcrypto_errors(); >- if ((pk = PEM_read_bio_PrivateKey(bio, NULL, NULL, >+ if ((pk = PEM_read_bio_PrivateKey(bio, NULL, pem_passphrase_cb, > (char *)passphrase)) == NULL) { > /* > * libcrypto may return various ASN.1 errors when attempting
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
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2913
:
3183
|
3184
|
3190
| 3192