diff options
author | Kazuki Yamaguchi <[email protected]> | 2017-03-18 17:26:33 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <[email protected]> | 2021-03-16 19:16:10 +0900 |
commit | efad0166c660d565d5e80e862cd9ff9457f8ed03 (patch) | |
tree | 915de0348bf6ac929e15f3decd408f24b6928c9d /ext/openssl/ossl_pkey.c | |
parent | c157f6e787221bcdbf8b6bb28db1b43578b89d66 (diff) |
[ruby/openssl] pkey: have PKey.read parse PEM-encoded DHParameter
Try PEM_read_bio_Parameters(). Only PEM format is supported at the
moment since corresponding d2i_* functions are not provided by OpenSSL.
https://github.com/ruby/openssl/commit/867e5c021b
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4275
Diffstat (limited to 'ext/openssl/ossl_pkey.c')
-rw-r--r-- | ext/openssl/ossl_pkey.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c index c6dbf57272..a00d66aada 100644 --- a/ext/openssl/ossl_pkey.c +++ b/ext/openssl/ossl_pkey.c @@ -178,6 +178,9 @@ ossl_pkey_new_from_data(int argc, VALUE *argv, VALUE self) OSSL_BIO_reset(bio); if ((pkey = PEM_read_bio_PUBKEY(bio, NULL, NULL, NULL))) goto ok; + OSSL_BIO_reset(bio); + if ((pkey = PEM_read_bio_Parameters(bio, NULL))) + goto ok; BIO_free(bio); ossl_raise(ePKeyError, "Could not parse PKey"); |