In x509.new(), csr.new(), and crl.new() when it's initialized from a DER text and
format is * or unset, the same BIO struct is reused for two times. While the pointer is
already modified in PEM_read_bio_*, later d2i_*_bio call will always fail.
This patch resets the BIO after first use so that DER format can be correctly loaded.
local f = io.open("a_der_formated_crl.crl"):read("*a")
require("openssl.x509.crl").new(f)
-- ERROR: x509.crl.new: asn1_lib.c:101:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long
In
x509.new()
,csr.new()
, andcrl.new()
when it's initialized from a DER text and format is*
or unset, the same BIO struct is reused for two times. While the pointer is already modified inPEM_read_bio_*
, laterd2i_*_bio
call will always fail.This patch resets the BIO after first use so that DER format can be correctly loaded.