X509_NAME_add_entry_by_txt: can not handle Email entry in Openssl 0.9.7d

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

X509_NAME_add_entry_by_txt: can not handle Email entry in Openssl 0.9.7d

Lincoln-9
Hi,
   Does anyone know why X509_NAME_add_entry_by_txt can
not add Email entry?
It works fine with openssl 0.9.6x, but when I link it
with 0.9.7d, it failed.

  I understand official PKI does not recommend Email
in subject, but I thought Openssl can handle that.


I'd appreciate it if you can shed light on this issue.


Thanks,
Dr. Lincoln

-- test code ---
/*
 * output is
 * Subject contains invalid field/value:
 *                  Email/[hidden email]
 */

#include <string.h>
#include <openssl/ssl.h>
#include <stdio.h>          
#include <stdlib.h>        

int main(){
       
        X509_NAME *name = X509_NAME_new();
        char *field = "Email";
        char *value = "[hidden email]";

        if (!X509_NAME_add_entry_by_txt(name, field,
V_ASN1_PRINTABLESTRING, (unsigned char *)value, -1,
-1, 0)){
               
                printf("Subject contains invalid field/value:
%s/%s\n", field, value);
                return 0;
        }
        return 0;
}


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: X509_NAME_add_entry_by_txt: can not handle Email entry in Openssl 0.9.7d

Goetz Babin-Ebell
Lincoln wrote:
> Hi,
Hello Kincoln,

>    Does anyone know why X509_NAME_add_entry_by_txt can
> not add Email entry?
> It works fine with openssl 0.9.6x, but when I link it
> with 0.9.7d, it failed.
[...]
> -- test code ---
[...]

>
> X509_NAME *name = X509_NAME_new();
> char *field = "Email";
                       ^^^^^
Since Email is not an official name, it was dropped
(I think in 0.9.7)

Try the official name "emailAddress".


Bye

Goetz

--
DMCA: The greed of the few outweighs the freedom of the many

smime.p7s (4K) Download Attachment