aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_asn1.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-12-12 00:55:10 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-07-23 13:32:35 +0900
commit7df19c3f287940fca3bc8df0f2418e5c7199261e (patch)
tree2dcfc9c3767491e0f63caab0ee451988d101e51c /test/test_asn1.rb
parente69649001f39cb866b8e77c906e52ec891952d38 (diff)
downloadruby-openssl-7df19c3f287940fca3bc8df0f2418e5c7199261e.tar.gz
asn1: initialize 'unused_bits' attribute of BitString with 0
Fix the initial value of 'unused_bits' attribute of OpenSSL::ASN1::BitString. The attribute must always contain an Integer in the range 0 to 7.
Diffstat (limited to 'test/test_asn1.rb')
-rw-r--r--test/test_asn1.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/test/test_asn1.rb b/test/test_asn1.rb
index d77e5719..a18e8dd8 100644
--- a/test/test_asn1.rb
+++ b/test/test_asn1.rb
@@ -255,12 +255,8 @@ class OpenSSL::TestASN1 < OpenSSL::TestCase
end
def test_bitstring
- obj = OpenSSL::ASN1::BitString.new(B(%w{}))
- obj.unused_bits = 0
- encode_decode_test B(%w{ 03 01 00 }), obj
- obj = OpenSSL::ASN1::BitString.new(B(%w{ 01 }))
- obj.unused_bits = 0
- encode_decode_test B(%w{ 03 02 00 01 }), obj
+ encode_decode_test B(%w{ 03 01 00 }), OpenSSL::ASN1::BitString.new(B(%w{}))
+ encode_decode_test B(%w{ 03 02 00 01 }), OpenSSL::ASN1::BitString.new(B(%w{ 01 }))
obj = OpenSSL::ASN1::BitString.new(B(%w{ F0 }))
obj.unused_bits = 4
encode_decode_test B(%w{ 03 02 04 F0 }), obj