Hi,

I start a simple implementation of othername only for strings in the
subject alternative name. Actually I have a problem with the resolving
of the ASN1_TYPE.

OTHERNAME is defined like this in crypto/x509v3/x509v3.h:

typedef struct otherName_st {
ASN1_OBJECT *type_id;
ASN1_TYPE *value;
} OTHERNAME;

The problem is that I must do a typecast to store a special type in
*value but I must know the type in crypto/asn1/tasn_enc.c where
ASN1_item_ex_i2d must calculate the length of the sequence.

The code crashs in the loop after /* First work out sequence content
length */ at the second iteration in the line 

seqcontlen += ASN1_template_i2d(pseqval, NULL, seqtt);

Is there a trick to get the type from the structure or must I change
x509v3.h (ASN1_TYPE --> ASN1_CHOICE) and define the supported
ASN1-types?

Best Regards Michael

P.S. I do this to build certificates for Win2000 smartcardlogon
(Microsoft uses othername).
-- 
-------------------------------------------------------------------
Michael Bell                   Email (private): [EMAIL PROTECTED]
Rechenzentrum - Datacenter     Email:  [EMAIL PROTECTED]
Humboldt-University of Berlin  Tel.: +49 (0)30-2093 2482
Unter den Linden 6             Fax:  +49 (0)30-2093 2959
10099 Berlin
Germany                                       http://www.openca.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to