Open
Description
#724 reminded me of this issue.
Due to an insufficient error check with sscanf()
in asn1time_to_time()
, OpenSSL::ASN1.decode
ignores any fractional seconds or time zone information in DER/BER.
$ ruby -ropenssl -e'p OpenSSL::ASN1.decode("\x18\x13" + "20161208193439.123Z").value'
2016-12-08 19:34:39 UTC # <- The fractional seconds is lost
$ ruby -ropenssl -e'p OpenSSL::ASN1.decode("\x18\x13" + "20161208193439+0900").value'
2016-12-08 19:34:39 UTC # <- Timezone is lost
openssl/ext/openssl/ossl_asn1.c
Lines 19 to 70 in 1e8e246
openssl/test/openssl/test_asn1.rb
Lines 435 to 452 in 1e8e246
Metadata
Metadata
Assignees
Labels
No labels