<p dir="ltr"><br>
On 1 Mar 2016 21:03, "Dr. Stephen Henson" <<a href="mailto:steve@openssl.org">steve@openssl.org</a>> wrote:<br>
><br>
> On Tue, Mar 01, 2016, Jakub Zelenka wrote:<br>
><br>
> > Hello,<br>
> ><br>
> > I'm just slowly porting PHP core openssl ext to work with OpenSSL 1.1 and<br>
> > just came across one thing that I can't find a function for.<br>
> ><br>
> > We have got a part in openssl_x509_parse where we display cert->name (cert<br>
> > is X509 struct) if it is not NULL:<br>
> ><br>
> > <a href="https://github.com/php/php-src/blob/715a198e1f4f6f79f596963727b1a1c92e7fed1b/ext/openssl/openssl.c#L1998">https://github.com/php/php-src/blob/715a198e1f4f6f79f596963727b1a1c92e7fed1b/ext/openssl/openssl.c#L1998</a><br>
> ><br>
> > The X509 is now opaque and I can't find any function for that which I might<br>
> > be missing because it's quite late... :)<br>
> ><br>
> > I tried to find it using<br>
> ><br>
> > grep -rn '>name' crypto/x509<br>
> ><br>
> > but it doesn't show any function that would return a cert name<br>
> ><br>
> > Not sure if it's actually useful to show that but I see that the name is<br>
> > set in x509_cb when operation is ASN1_OP_D2I_POST<br>
> > as X509_NAME_oneline(ret->cert_info.subject, NULL, 0) .<br>
> ><br>
> > Please could you let me know if there is a function for that or what I<br>
> > should use instead?<br>
> ><br>
><br>
> It isn't really useful. It uses the ancient and quirky X509_NAME_oneline()<br>
> function to convert the certificate subject name to an old oneline format<br>
> (which mishandles things like multi byte characters).<br>
><br>
> If you really want it you can create it using X509_get_subect_name() and<br>
> X509_NAME_oneline() directly but you have to free it once you've finished with<br>
> it.<br>
></p>
<p dir="ltr">Ok great. I will probably do that for now just to keep it as it was and then possibly take a look if we could replace it with something more useful or if we should just remove it. That function needs closer look anyway.</p>
<p dir="ltr">Thanks a lot for letting me know!<br>
</p>