On Sat, 25 Nov 2000, Dr S N Henson wrote:
> An application could always use the ex_data callback new_func() to do
> the initialization.
Not really, because you'd need to wait until the CRYPTO_EX_DATA structure
had actually been initialised (which is after init() gets called) before
setting the callback. In other words, you can't override behaviour simply
by implementing an RSA_METHOD, you need to hack the calling application
itself. Kind of defeats the purpose.
> > Would fixing this break anything that anyone is aware of? (Ie. putting the
> > CRYPTO_new_ex_data() prior to the meth->init() call).
> >
>
> Not that I'm aware of no.
>
> However neither the meth->init() nor ex_data new_func() is particularly
> useful because at this point the parent RSA structure doesn't contain
> anything useful like keying material when it is called.
No, but the RSA_METHOD that the RSA structure will use *has* been
established at that point, so it's a good point to try and create and
store anything needed by the RSA_METHOD for operating on that RSA
structure. The reason I want to do this is to duplicate a "handle" (of
sorts) with reference counting - by adding such a reference to each key in
the init() handler and releasing it in the finish() handler it would work
cleanly. Basically, I want to avoid "run-time" operations having to
continually run those "initialise a context if it hasn't been done yet"
checks before trying to use a context. Otherwise init() has absolutely no
possible usefulness that I can see (even the flags don't need an init()
handler to set them, because the RSA_METHOD has a flags value).
Cheers,
Geoff
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]