trussed-dev / trussed

Modern Cryptographic Firmware
https://trussed.dev
Apache License 2.0
405 stars 26 forks source link

RequestUserConsent does not properly restore the ui status when interrupted or timed out. #129

Open sosthene-nitrokey opened 1 year ago

sosthene-nitrokey commented 1 year ago

In the RequestUserConsent syscall, the ui status is saved, then set to WaitingForUserPresence and finally restored at the end of the call.

However, there are early returns in the loop that cause the restoration to not happen. This is not a very large issue as the call to process restores the status to Idle. I think the restoration of the status should be removed as it isn't very useful since it is overridden to Idle just after.