aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-08-13 17:07:04 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-08-16 14:22:07 +0900
commit2cb131e1ccdb6536ef3516b49ab90775688db3f3 (patch)
tree4fde932e3bb04f56611fac3e54a194cecf1c4506 /test
parentfab8c3030e5dbcaf20bb50341f71213eab85a1ae (diff)
downloadruby-openssl-2cb131e1ccdb6536ef3516b49ab90775688db3f3.tar.gz
x509attr: fix memory leak in X509::Attribute#oid=
ASN1_OBJECT returned by OBJ_txt2obj() must be free'd.
Diffstat (limited to 'test')
-rw-r--r--test/test_x509attr.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_x509attr.rb b/test/test_x509attr.rb
index 69b8189b..d7473f1a 100644
--- a/test/test_x509attr.rb
+++ b/test/test_x509attr.rb
@@ -12,6 +12,9 @@ class OpenSSL::TestX509Attribute < OpenSSL::TestCase
attr = OpenSSL::X509::Attribute.new("extReq", val)
assert_equal("extReq", attr.oid)
assert_equal(val.to_der, attr.value.to_der)
+
+ attr = OpenSSL::X509::Attribute.new("1.2.840.113549.1.9.14", val)
+ assert_equal("extReq", attr.oid)
end
def test_from_der