mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
hwcrypto: Fix bug with concurrent SHA access
If two different types of SHA hashes were active in the hardware concurrently, a race condition meant the SHA unit could be incorrectly reset leading to all-zero results.
This commit is contained in:
parent
0ea4cd67dd
commit
703d143619
@ -172,10 +172,10 @@ static void esp_sha_lock_engine_inner(sha_engine_state *engine)
|
||||
DPORT_STALL_OTHER_CPU_END();
|
||||
}
|
||||
|
||||
_lock_release(&state_change_lock);
|
||||
|
||||
assert( !engine->in_use && "in_use flag should be cleared" );
|
||||
engine->in_use = true;
|
||||
|
||||
_lock_release(&state_change_lock);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user