From 7df19c3f287940fca3bc8df0f2418e5c7199261e Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Mon, 12 Dec 2016 00:55:10 +0900 Subject: 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. --- ext/openssl/ossl_asn1.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/openssl/ossl_asn1.c') diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index 305290f2..c0dab131 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -1109,6 +1109,8 @@ ossl_asn1_initialize(int argc, VALUE *argv, VALUE self) ossl_asn1_set_tagging(self, tagging); ossl_asn1_set_tag_class(self, tag_class); ossl_asn1_set_indefinite_length(self, Qfalse); + if (default_tag == V_ASN1_BIT_STRING) + rb_ivar_set(self, sivUNUSED_BITS, INT2FIX(0)); return self; } -- cgit v1.2.3