summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authorKazuki Yamaguchi <[email protected]>2024-06-17 16:26:58 +0900
committergit <[email protected]>2024-07-24 16:50:01 +0000
commita1cf39bd366f843bc9fd1534aa8e7d301fc77252 (patch)
tree8a647bccdaac8867afd6dd4b16cf272e202be243 /test/openssl
parent575fe63e20dff83c684a93f5f76d0c27bbc250df (diff)
[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
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_x509attr.rb4
1 files changed, 4 insertions, 0 deletions
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"