ext/openssl/ossl_x509req.c in openssl-2.1.0.beta1 vs ext/openssl/ossl_x509req.c in openssl-2.1.0.beta2

- old
+ new

@@ -291,15 +291,14 @@ { X509_REQ *req; EVP_PKEY *pkey; GetX509Req(self, req); - pkey = GetPKeyPtr(key); /* NO NEED TO DUP */ - if (!X509_REQ_set_pubkey(req, pkey)) { - ossl_raise(eX509ReqError, NULL); - } - + pkey = GetPKeyPtr(key); + ossl_pkey_check_public_key(pkey); + if (!X509_REQ_set_pubkey(req, pkey)) + ossl_raise(eX509ReqError, "X509_REQ_set_pubkey"); return key; } static VALUE ossl_x509req_sign(VALUE self, VALUE key, VALUE digest) @@ -326,10 +325,11 @@ { X509_REQ *req; EVP_PKEY *pkey; GetX509Req(self, req); - pkey = GetPKeyPtr(key); /* NO NEED TO DUP */ + pkey = GetPKeyPtr(key); + ossl_pkey_check_public_key(pkey); switch (X509_REQ_verify(req, pkey)) { case 1: return Qtrue; case 0: ossl_clear_error();