Re: Getting cert serial from an OCSP single response
On 2022-10-31 01:11, Alexei Khlebnikov wrote: Hello Geoff, 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. int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd, ASN1_OCTET_STRING **pikeyHash, ASN1_INTEGER **pserial, OCSP_CERTID *cid); Med vennlig hilsen / Best regards, Alexei. This function prototype really needs basic constification to mark which arguments are inputs and which are outputs. The pserial in particular needs different const modifiers for each level of indirection to indicate that this is output of a pointer to a read-only number. Quite surprised this hasn't been done during all the pointless API changes after the new management took over the project. Enjoy Jakob -- Jakob Bohm, CIO, Partner, WiseMo A/S. https://www.wisemo.com Transformervej 29, 2860 Søborg, Denmark. Direct +45 31 13 16 10 This public discussion message is non-binding and may contain errors. WiseMo - Remote Service Management for PCs, Phones and Embedded
Re: Getting cert serial from an OCSP single response
Hello Geoff, 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. int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd, ASN1_OCTET_STRING **pikeyHash, ASN1_INTEGER **pserial, OCSP_CERTID *cid); Med vennlig hilsen / Best regards, Alexei. søn. 30. okt. 2022 kl. 23:50 skrev Geoff Swan : > Thanks Alexei, > > I've got the OCSP_CERTID now, are there methods for getting the serial > number as a string from this? > > Something like this, which does not appear to work any more: > > i2s_ASN1_INTEGER(NULL, cid->serialNumber) > > - Geoff > > > On 2022-10-31 9:00 am, Alexei Khlebnikov wrote: > > fre. 28. okt. 2022 kl. 05:25 skrev Geoff Swan : > >> I'm trying to get the cert serial number (or the ocsp_certid structure) >> from an OCSP single response > > > The following function gets you OCSP_CERTID from OCSP_SINGLERESP: > > const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x); > > Med vennlig hilsen / Best regards, > Alexei. > >
Re: Getting cert serial from an OCSP single response
Thanks Alexei, I've got the OCSP_CERTID now, are there methods for getting the serial number as a string from this? Something like this, which does not appear to work any more: i2s_ASN1_INTEGER(NULL, cid->serialNumber) - Geoff On 2022-10-31 9:00 am, Alexei Khlebnikov wrote: fre. 28. okt. 2022 kl. 05:25 skrev Geoff Swan : I'm trying to get the cert serial number (or the ocsp_certid structure) from an OCSP single response The following function gets you OCSP_CERTID from OCSP_SINGLERESP: const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x); Med vennlig hilsen / Best regards, Alexei.
Re: Getting cert serial from an OCSP single response
fre. 28. okt. 2022 kl. 05:25 skrev Geoff Swan : > I'm trying to get the cert serial number (or the ocsp_certid structure) > from an OCSP single response The following function gets you OCSP_CERTID from OCSP_SINGLERESP: const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x); Med vennlig hilsen / Best regards, Alexei.