<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>I'm trying to decode an OCSP basic response:</div><div><br></div><div><div>BasicOCSPResponse ::= SEQUENCE {</div><div> tbsResponseData      ResponseData,</div><div> signatureAlgorithm    AlgorithmIdentifier,</div><div> signature         BIT STRING,</div><div> certs         [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }</div></div><div><br></div><div>I would like the 'certs' element to be returned as-is, basically as a list of DER certificates which I may or may not decode later. I was hoping I could use 'exclusive_decode', with the following asn1config:</div><div><br></div><div><div>{exclusive_decode,{ocsp,[</div><div> {decode_basic_ocsp_response,['BasicOCSPResponse',[{certs,parts}]]}</div><div>]}}.</div></div><div><br></div><div>But this fails with the following exception:</div><div><br></div><div><div>** exception error: no function clause matching </div><div>           ocsp:decode_tag_and_length({asn1,"tag failure",16,</div><div>                             {1,131072,</div><div>                             <<48,130,4,232,48,130,4,228,48,130,3,204,160,3,2,1,2,2,9,</div><div>                              0,227,...>>,</div><div>                             <<>>}}) (ocsp.erl, line 2051)</div><div>   in function  ocsp:decode_primitive_incomplete/2 (ocsp.erl, line 2026)</div><div>   in call from ocsp:decode_constructed_incomplete/2 (ocsp.erl, line 1828)</div><div>   in call from ocsp:decode_constructed_incomplete/2 (ocsp.erl, line 1830)</div><div>   in call from ocsp:decode_constructed_incomplete/2 (ocsp.erl, line 1808)</div><div>   in call from ocsp:decode_incomplete2/5 (ocsp.erl, line 21848)</div><div>   in call from ocsp:decode_partial_incomplete/3 (ocsp.erl, line 1190)</div></div><div><br></div><div>A full BasicOCSPResponse decode of the same binary works fine, returning a list of Certificate records in the certs element, so the source data is valid.</div><div><br></div><div>Is there any reason why the exclusive_decode 'parts' action might not work for this particular SEQUENCE, perhaps because it is explicit + optional?</div><div><br></div><div>Thanks,</div><div><br></div><div>Bram</div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>