<div dir="ltr">Hi Wim,<div><br></div><div>I'll give this a shot, thank you for the suggestion!</div><div><br></div><div>-Peter </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 11, 2015 at 5:05 PM, Wim Lewis <span dir="ltr"><<a href="mailto:wiml@omnigroup.com" target="_blank">wiml@omnigroup.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On Nov 9, 2015, at 3:46 PM, Peter P. <<a href="mailto:p.pan48711@gmail.com">p.pan48711@gmail.com</a>> wrote:<br>
> I'm writing an application using Openssl 1.0.2d where I am trying to take a DER encoded unsigned CSR and read it into an X509_REQ data structure via the d2i_X509_REQ_bio() function. This function errors out during when I attempt to read in my unsigned CSR and I would like to know if there is any other way to read in an unsigned CSR into an X509_REQ data structure.<br>
<br>
</span>A CSR (from PKCS#10 / RFC2986) has the structure:<br>
<br>
   SEQUENCE { CertificationRequestInfo, AlgorithmIdentifier, BIT STRING }<br>
<br>
where the actual request is the CertificationRequestInfo, and the signature is composed of the AlgorithmIdentifier + BIT STRING.<br>
<br>
Are you trying to just read in a bare CertificationRequestInfo structure? I suspect you can do that with a call like<br>
<br>
    ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_REQ_INFO), bp, req)<br>
<br>
which is the same as the body of d2i_X509_REQ_bio(), but with X509_REQ replaced by X509_REQ_INFO. I haven't tried it, though.<br>
<br>
(Whether it's a *good idea* to pass bare CSR info structs around is another question but I'll leave that up to you.)<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Wim.<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</div></div></blockquote></div><br></div>