mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-05-08 00:44:58 -04:00
fw: Protect zeroisation against compiler optimisation.
The memset() responsible for the zeroisation of the secure_ctx under the compute_cdi() function in FW's main.c, was optimised away by the compiler. Instead of using memset(), secure_wipe() is introduced which uses a volatile keyword to prevent the compiler to try to optimise it. Secure_wipe() is now used on all locations handling removal of sensitive data.
This commit is contained in:
parent
c85b5311cd
commit
3a6a60ff26
3 changed files with 10 additions and 3 deletions
|
@ -28,5 +28,5 @@ void *memset(void *dest, int c, unsigned n);
|
|||
void memcpy_s(void *dest, size_t destsize, const void *src, size_t n);
|
||||
void wordcpy_s(void *dest, size_t destsize, const void *src, size_t n);
|
||||
int memeq(void *dest, const void *src, size_t n);
|
||||
|
||||
void secure_wipe(void *v, size_t n);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue