storage: use fixed hw_entropy in unprivileged mode

pull/25/head
Pavol Rusnak 5 years ago
parent 9a9c537afd
commit 67c0f8b8a1
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -89,12 +89,6 @@ void check_lock_screen(void)
int main(void)
{
#if EMULATOR
memzero(HW_ENTROPY_DATA, HW_ENTROPY_LEN);
#else
desig_get_unique_id((uint32_t*)HW_ENTROPY_DATA);
#endif
#ifndef APPVER
setup();
__stack_chk_guard = random32(); // this supports compiler provided unpredictable stack protection checks
@ -106,12 +100,19 @@ int main(void)
#endif
if (!is_mode_unprivileged()) {
desig_get_unique_id((uint32_t*)HW_ENTROPY_DATA);
timer_init();
#ifdef APPVER
// enable MPU (Memory Protection Unit)
mpu_config();
#endif
} else {
#if EMULATOR
memzero(HW_ENTROPY_DATA, HW_ENTROPY_LEN);
#else
// we are running in unprivileged mode
// use fixed HW_ENTROPY
memset(HW_ENTROPY_DATA, 0x3C, HW_ENTROPY_LEN);
#endif
}

@ -29,7 +29,7 @@
/*
* The length of the sector header in bytes. The header is preserved between sector erasures.
*/
#define NORCOW_HEADER_LEN (0x000)
#define NORCOW_HEADER_LEN (0x100)
/*
* Current storage version.

Loading…
Cancel
Save