diff options
Diffstat (limited to 'ext/openssl/ossl_pkey_dh.c')
-rw-r--r-- | ext/openssl/ossl_pkey_dh.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c index 2f79bfb2f6..3668acb165 100644 --- a/ext/openssl/ossl_pkey_dh.c +++ b/ext/openssl/ossl_pkey_dh.c @@ -506,6 +506,8 @@ ossl_dh_compute_key(VALUE self, VALUE pub) GetPKeyDH(self, pkey); dh = pkey->pkey.dh; + if (!dh->p) + ossl_raise(eDHError, "incomplete DH"); pub_key = GetBNPtr(pub); len = DH_size(dh); str = rb_str_new(0, len); |