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:
Angus Gratton 2017-08-17 15:48:43 +10:00 committed by Angus Gratton
parent 0ea4cd67dd
commit 703d143619

View file

@ -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);
}