mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
When storing a new unique secret key in the secure enclave, it is temporarily stored in a stack buffer accessible by CPU1. Since it is a secret key, it should not be kept in memory as it could be leaked. This commit calls the explicit_bzero() function from the libc to ensure that the buffer containing the key is cleared. Unlike with bzero() and memset(), the compiler won't optimize away calls to explicit_bzero().