Massimiliano Pala wrote:

> I'll try to be more specific in my next report.

Here I am again. The problem is very strange... indeed I find it difficult
to fix because I can simply not understand why the problem exists... Let's
see it:

1. The sk_PKCS7_new_null() is called by pkcs12.c at line 547.
2. The macro SKM_sk_new_null(PKCS7) is invoked.

   --- from crypto/stack/safestack.h ---
   #define SKM_sk_new_null(type) \
        ((STACK_OF(type) * (*)(void))sk_new_null)()

3. The function sk_new_null() is invoked.

   --- from crypto/stack/stack.c
   STACK *sk_new_null(void)
        {
        return sk_new((int (*)(const char * const *, const char * const *))0);
        }

4. The function sk_new() is invoked. [ indeed I find it difficult to understand
   the function definition, someone can explain it to me -- forgive my ignorance
]

5. The function sk_new returns successfully. The ret is correctly allocated
   (STACK *) and initiated. The return(ret) is correctly reached.

6. Segmentation fault.

Why ??? The function succed when called before, like at line 469 (same macro
usage):

        bags = sk_PKCS12_SAFEBAG_new_null ();


Hey... I tried, just now while writing the e-mail, to comment the call (line
539):

        sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);

(just few lines up the 547) and found the coredump to happen at the line 556:

        p8 = EVP_PKEY2PKCS8 (key);

so the line 547 does not segfault.... (as it should be...).

What's happening here ?!?! Someone has any idea ???

-- 

C'you,

        Massimiliano Pala

--o-------------------------------------------------------------------------
Massimiliano Pala [OpenCA Project Manager]                  [EMAIL PROTECTED]
                                                          [EMAIL PROTECTED]
                                                     [EMAIL PROTECTED]
http://www.openca.org                            Tel.:   +39 (0)59  270  094
http://openca.sourceforge.net                    Mobile: +39 (0)347 7222 365

S/MIME Cryptographic Signature

Reply via email to