[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:
Kazuki Yamaguchi 2024-10-30 03:18:21 +09:00 committed by git
parent 5444885726
commit b207b956c1

View File

@ -174,7 +174,7 @@ static VALUE ossl_ec_key_initialize(int argc, VALUE *argv, VALUE self)
type = EVP_PKEY_base_id(pkey);
if (type != EVP_PKEY_EC) {
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;
return self;