The signature for X509_STORE_add_cert is:

    int X509_STORE_add_cert(X509_STORE*, X509*)

I notice that the second argument is X509* rather than X509 const*; this
makes life a bit difficult for me in certain places because I have only
an X509 const* available.

It seems, from looking at the source, that the reason for this is that
OpenSSL is doing some sort of reference counting of the X509 objects. Is
there any documentation on how this works, and how memory management in
general of X509 objects works? Or should I just be using my copies for
my purposes, and doing an X509_dup whenever I need to give an OpenSSL
function (outside of trivial accessors) an X509*?

Also, is there any documentation on how memory management for this sort
of stuff is working in general in the OpenSSL library? The code is
heavily macro-driven and I'm finding it rather confusing.

cjs
-- 
Curt Sampson         <c...@cynic.net>         +81 90 7737 2974

It is easier to write an incorrect program than understand a correct one.
    --Alan Perlis, Epigrams on Programming (#7)
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to