On Tue, Oct 4, 2016 at 5:29 PM, Graham Leggett <minf...@sharp.fm> wrote:
> On 4 Oct 2016, at 15:47, Paul Spangler <paul.spang...@ni.com> wrote:
>
>> From my understanding, apr_crypto_key_t is an opaque struct defined 
>> separately by each crypto provider, so mod_session_crypto will not be able 
>> to do the sizeof.
>
> That's a sizeof a pointer to apr_crypto_key_t, not the sizeof 
> apr_crypto_key_t itself.

I think Paul is correct, apr_crypto_passphrase() requires its given
*(apr_crypto_key_t**)key to be not NULL, otherwise it will allocate
one from its (providers's) array, which is not thread safe.

How are we supposed to have a *key not NULL given apr_crypto_key_t is opaque?


>
> Keys are read at server start and reused. Trying to regenerate the key on 
> every request has performance implications.

This is not what mod_session_crypto seems to be doing, passphrases are
read at load time but the keys are not created there.

Is mod_session_crypto supposed to make a fake call to
apr_crypto_passphrase() in post_config and reuse that key (with a
different salt) for runtime calls?
It seems that apr_crypto_passphrase()'s **key is updated for each
call, though...


Regards,
Yann.

Reply via email to