From a1cf39bd366f843bc9fd1534aa8e7d301fc77252 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Mon, 17 Jun 2024 16:26:58 +0900 Subject: [ruby/openssl] x509attr: avoid using OpenSSL::ASN1 internals in #value= OpenSSL::ASN1 is being rewritten in Ruby. To make it easier, let's remove dependency to the instance variables and the internal-use function ossl_asn1_get_asn1type() outside OpenSSL::ASN1. This also fixes the insufficient validation of the passed value with its tagging. https://github.com/ruby/openssl/commit/35a157462e --- test/openssl/test_x509attr.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/openssl/test_x509attr.rb b/test/openssl/test_x509attr.rb index 2919d23d2d..bec03a1871 100644 --- a/test/openssl/test_x509attr.rb +++ b/test/openssl/test_x509attr.rb @@ -48,6 +48,10 @@ class OpenSSL::TestX509Attribute < OpenSSL::TestCase assert_raise(TypeError) { attr.value = "1234" } + assert_raise(OpenSSL::X509::AttributeError) { + v = OpenSSL::ASN1::Set([OpenSSL::ASN1::UTF8String("1234")], 17, :EXPLICIT) + attr.value = v + } assert_equal(test_der, attr.to_der) assert_raise(OpenSSL::X509::AttributeError) { attr.oid = "abc123" -- cgit v1.2.3