Arne Ansper wrote:
>
> hi!
>
> following program:
>
> #include <openssl/x509.h>
> #include <openssl/asn1.h>
> #include <openssl/err.h>
>
> int main()
> {
> X509_NAME* xxx;
> X509_NAME* yyy;
>
> ERR_load_crypto_strings();
> xxx= X509_NAME_new();
> #if 0
> X509_NAME_add_entry_by_NID(xxx,
> NID_countryName,V_ASN1_PRINTABLESTRING,
> "EE", 2, -1, 0);
> #endif
> yyy= X509_NAME_dup(xxx);
> ERR_print_errors_fp(stderr);
> printf("%d\n", yyy);
> }
>
> gives following error:
>
> 3298:error:0D084069:asn1 encoding routines:d2i_ASN1_SET:bad tag:a_set.c:177:
> 3298:error:0D0A7004:asn1 encoding routines:d2i_X509_NAME:nested asn1
>error:x_name.c:197:address=134889712 offset=2
> 0
>
> when i add the add_entry call everything is ok. seems like a bug in
> encoding or decoding empty distinguished name.
>
Yes its a bug in the encoder. Its fixed in the development branch using
the new ASN1 code. I suppose it should be fixed in the old ASN1 stable
branch too.
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]