From b207b956c1d936e92351136ea3ad7f2f54df8128 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Wed, 30 Oct 2024 03:18:21 +0900 Subject: [PATCH] [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 --- ext/openssl/ossl_pkey_ec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c index 4b3a1fd0fe..10f44edf1f 100644 --- a/ext/openssl/ossl_pkey_ec.c +++ b/ext/openssl/ossl_pkey_ec.c @@ -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;