[ruby/openssl] pkey/ec: fix exception class in OpenSSL::PKey::EC.new
Fix a copy-and-paste error introduced in commit https://github.com/ruby/openssl/commit/74f6c6175688 (pkey: allocate EVP_PKEY on #initialize, 2021-04-12). It should raise OpenSSL::PKey::ECError instead of OpenSSL::PKey::DSAError. https://github.com/ruby/openssl/commit/b1f6a04abf
This commit is contained in:
parent
5444885726
commit
b207b956c1
@ -174,7 +174,7 @@ static VALUE ossl_ec_key_initialize(int argc, VALUE *argv, VALUE self)
|
|||||||
type = EVP_PKEY_base_id(pkey);
|
type = EVP_PKEY_base_id(pkey);
|
||||||
if (type != EVP_PKEY_EC) {
|
if (type != EVP_PKEY_EC) {
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
rb_raise(eDSAError, "incorrect pkey type: %s", OBJ_nid2sn(type));
|
rb_raise(eECError, "incorrect pkey type: %s", OBJ_nid2sn(type));
|
||||||
}
|
}
|
||||||
RTYPEDDATA_DATA(self) = pkey;
|
RTYPEDDATA_DATA(self) = pkey;
|
||||||
return self;
|
return self;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user