<div dir="ltr"><div>Hello Geoff,<br></div><div><br></div><div>Try the following function, receive the serial number via the "pserial" pointer. But avoid changing the number via the pserial pointer because it points inside the OCSP_CERTID structure.<br></div><div><br></div>int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,<br> ASN1_OCTET_STRING **pikeyHash,<br><div> ASN1_INTEGER **pserial, OCSP_CERTID *cid);</div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Med vennlig hilsen / Best regards,</div><div>Alexei.</div><div><br></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">søn. 30. okt. 2022 kl. 23:50 skrev Geoff Swan <<a href="mailto:gswan3@bigpond.net.au">gswan3@bigpond.net.au</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Thanks Alexei,</p>
<p>I've got the OCSP_CERTID now, are there methods for getting the
serial number as a string from this?</p>
<p>Something like this, which does not appear to work any more:</p>
<p>i2s_ASN1_INTEGER(NULL, cid->serialNumber)</p>
<p>- Geoff<br>
</p>
<p><br>
</p>
<div>On 2022-10-31 9:00 am, Alexei
Khlebnikov wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">fre. 28. okt. 2022 kl. 05:25
skrev Geoff Swan <<a href="mailto:gswan3@bigpond.net.au" target="_blank">gswan3@bigpond.net.au</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I'm trying to get the cert serial number (or the ocsp_certid
structure) <br>
from an OCSP single response</blockquote>
</div>
<div class="gmail_quote"><br>
</div>
<div class="gmail_quote">The following function gets you
OCSP_CERTID from OCSP_SINGLERESP:</div>
<div class="gmail_quote"><br>
</div>
<div class="gmail_quote">const OCSP_CERTID
*OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x);</div>
<div class="gmail_quote">
<div><br clear="all">
<div>
<div dir="ltr">
<div dir="ltr">
<div>Med vennlig hilsen / Best regards,</div>
<div>Alexei.</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote></div>