Dr. Stephen Henson wrote:

On Mon, Dec 05, 2005, Matthew Rodriguez DSD staff wrote:

I'll have to step through these 2 cases more carefully. I see that X509_EXTENSION_free and PROXY_CERT_INFO_EXTENSION_free both go through the ASN1_item free, and ASN1_item_combine_free
but somewhere after that they go through different codepaths.


Well this:

        PROXY_CERT_INFO_EXTENSION_free((PROXY_CERT_INFO_EXTENSION *)ext); */

will crash because 'ext' isn't a pointer to a PROXY_CERT_INFO_EXTENSION
structure.

I notice you are doing:

lhash = lh_new(NULL, NULL);

have you tried lh_free()? In fact you don't need an LHASH for this type of
extension in the way you use it so you should be able to pass it as NULL. In
fact you can avoid X509V3_CTX as well and pass that as NULL.
I tried that first, but I also get a segmention fault when I pass the ctx in
as NULL.
Here is the backtrace of that.
0x400fa6a6 in do_ext_nconf (conf=0xbfffea20, ctx=0x0, ext_nid=663, crit=1,
   value=0x80489d2 "language:Inherit all") at v3_conf.c:154
154                     if(!ctx->db || !ctx->db_meth)
(gdb) bt
#0 0x400fa6a6 in do_ext_nconf (conf=0xbfffea20, ctx=0x0, ext_nid=663, crit=1,
   value=0x80489d2 "language:Inherit all") at v3_conf.c:154
#1  0x400fa3fb in X509V3_EXT_nconf (conf=0xbfffea20, ctx=0x0,
   name=0x80489e7 "proxyCertInfo", value=0x80489d2 "language:Inherit all")
   at v3_conf.c:90
#2  0x400fb152 in X509V3_EXT_conf (conf=0x0, ctx=0x0,
   name=0x80489e7 "proxyCertInfo",
   value=0x80489c8 "critical, language:Inherit all") at v3_conf.c:462
#3  0x08048849 in main (argc=1, argv=0xbfffeb04) at x509_ext.c:17

The extension method that is retrived in the do_ext_nconf function only has
i2r and r2i methods. The context is checked for a db or a db_meth, since it is
NULL we get a segfault.

Matt

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to