JannePeltonen replied on github web page:
platform/linux-generic/odp_crypto.c
line 83
@@ -146,6 +171,8 @@ odp_crypto_generic_session_t *alloc_session(void)
}
odp_spinlock_unlock(&global->lock);
+ session->idx = (session - global->sessions) / sizeof(*session);
+
Comment:
The cipher_valid and hmac_valid bits are not cleared at session allocation, so
they can be left to what they were in an old and freed session that occupied
the same memory slot.
> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Then I'd follow "Maxim's rule" and do the renames as a separate follow-on PR.
>> muvarov wrote
>> I prefer the rule that new code goes in in clean way. Even if rest of the
>> code used old rules.
>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> That makes sense to me.
>>>> Dmitry Eremin-Solenikov(lumag) wrote:
>>>> Then I would prefer to use names w/o underscore for now and to change all
>>>> of them later.
>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>>>> I don't see the need to do that at this point as these are internal
>>>>> routines anyway. That type of restructure might be something to consider
>>>>> for Caterpillar.
>>>>>> Dmitry Eremin-Solenikov(lumag) wrote:
>>>>>> Hmm. The rest of init/term functions do not have such prefix. Should we
>>>>>> change them?
>>>>>>> Dmitry Eremin-Solenikov(lumag) wrote:
>>>>>>> No, `sizeof uint32_t`
>>>>>>>> muvarov wrote
>>>>>>>> `_odp_crypto_term_local`
>>>>>>>>> muvarov wrote
>>>>>>>>> `_odp_crypto_init_local`
>>>>>>>>>> muvarov wrote
>>>>>>>>>> is 32 everywhere MAX_SESSIONS?
https://github.com/Linaro/odp/pull/342#discussion_r157490470
updated_at 2017-12-18 13:59:11