Hi Allan, well I did not compile the libcrypto, but now I have and here it is the results from gdb:
Program received signal SIGSEGV, Segmentation fault.
do_ext_nconf (conf=0xbf8cfc48, ctx=0x0, ext_nid=89, crit=0,
value=0x8055800 "policyIdentifier;OID:1.3.444.21.222.1.1.1")
at v3_conf.c:154
154 if(!ctx->db || !ctx->db_meth)
(gdb) backtrace
#0 do_ext_nconf (conf=0xbf8cfc48, ctx=0x0, ext_nid=89, crit=0,
value=0x8055800 "policyIdentifier;OID:1.3.444.21.222.1.1.1")
at v3_conf.c:154
#1 0xb7f14eba in X509V3_EXT_nconf (conf=0xbf8cfc48, ctx=0x0,
name=0x8069758 "certificatePolicies",
value=0x8055800 "policyIdentifier;OID:1.3.444.21.222.1.1.1")
at v3_conf.c:90
#2 0xb7f14faa in X509V3_EXT_conf (conf=0x0, ctx=0x0,
name=0x8069758 "certificatePolicies",
value=0x8055800 "policyIdentifier;OID:1.3.444.21.222.1.1.1")
at v3_conf.c:462
I figured it out, actually. If the method->r2i is != NULL, then
the `do_ext_nconf` do not check (line 154) if the ctx is different
from NULL when looking for ctx->db or ctx->db_meth.
Shall it be checked as well ? An easy patch would be:
if( (ctx) && ( !ctx->db || !ctx-db_meth ) )
this would fix the segfault, actually...
Later,
Max
Allan Clark wrote:
> I assume you compiled your libcrypto. You should probably build it -g
> to enable debug symbols which will let gdb tell you what file, line,
> and function it segv at
>
> Allan
>
>
>
> On 7/12/07, Massimiliano Pala <[EMAIL PROTECTED]> wrote:
>> Hi all,
>>
>> I have been trying to encode some extensions and sometimes I get a
>> segfault
>> that I can not explain.
>>
>> The following code is the one causing the error:
>>
>> ret = X509V3_EXT_conf(NULL, NULL, name_s, valString);
>>
>> where:
>>
>> name_s = certificatePolicies
>> valString = OID:1.3.6.1.4.1.65.1.1.1.1
>>
>> by using gdb, I get the following:
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x4b530940 in X509V3_EXT_i2d () from /lib/libcrypto.so.6
>> (gdb) backtrace
>> #0 0x4b530940 in X509V3_EXT_i2d () from /lib/libcrypto.so.6
>> #1 0x4b530bd2 in X509V3_EXT_nconf () from /lib/libcrypto.so.6
>> #2 0x4b530c86 in X509V3_EXT_conf () from /lib/libcrypto.so.6
>>
>>
>> Do you have any idea of what's going on ?
>>
>> Later,
>> Max
>>
>>
>> --
>>
>> Best Regards,
>>
>> Massimiliano Pala
>>
>> --o------------------------------------------------------------------------
>>
>> Massimiliano Pala [OpenCA Project Manager]
>> [EMAIL PROTECTED]
>>
>> [EMAIL PROTECTED]
>>
>> Dartmouth Computer Science Dept Home Phone: +1 (603)
>> 397-3883
>> PKI/Trust - Office 063 Work Phone: +1 (603)
>> 646-9179
>> --o------------------------------------------------------------------------
>>
>>
>
>
--
Best Regards,
Massimiliano Pala
--o------------------------------------------------------------------------
Massimiliano Pala [OpenCA Project Manager] [EMAIL PROTECTED]
[EMAIL PROTECTED]
Dartmouth Computer Science Dept Home Phone: +1 (603) 397-3883
PKI/Trust - Office 063 Work Phone: +1 (603) 646-9179
--o------------------------------------------------------------------------
smime.p7s
Description: S/MIME Cryptographic Signature
