fix(HeavyButter): power down radios during sleep and fix broken deep sleep (AV-002/003)#2519
Open
r13xr13 wants to merge 1 commit into
Open
fix(HeavyButter): power down radios during sleep and fix broken deep sleep (AV-002/003)#2519r13xr13 wants to merge 1 commit into
r13xr13 wants to merge 1 commit into
Conversation
…sleep Two issues: 1. Deep Sleep: DEEPSLEEP_WAKEUP_PIN defaulted to -1, disabling deep sleep on most boards. Changed default to 0 (BOOT button). 2. Sleep mode was cosmetic only: display turned off, radios stayed active. Fixed by calling WiFi.mode(WIFI_OFF) and esp_bt_controller_deinit() before entering both sleep modes. Fixes AV-002 and AV-003 from the forensic audit (issue BruceDevices#2511)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HeavyButter Security Audit — Fix AV-002 / AV-003
Finding AV-002 (Fake Sleep): When the user presses "Sleep," only the display backlight turns off. All radios (WiFi, BLE, Sub-GHz, NRF24, IR, RFID) stay powered and active. The device remains on the network.
Finding AV-003 (Broken Deep Sleep):
DEEPSLEEP_WAKEUP_PINdefaulted to-1inprecompiler_flags.h:264, which disables deep sleep on any board that does not explicitly define it. Most boards do not.Fixes:
include/precompiler_flags.h: Changed defaultDEEPSLEEP_WAKEUP_PINfrom-1to0(BOOT button, available on all ESP32 dev boards)src/core/mykeyboard.cpp(goToDeepSleep()): AddedWiFi.mode(WIFI_OFF)+esp_bt_controller_deinit()before entering deep sleepsrc/core/settings.cpp(setSleepMode()): Same radio power-down before light sleepImpact: Sleep now actually powers down radios. Deep sleep works on boards without explicit pin config. Device is no longer a persistent network beacon when the user thinks it is off.
Reference: Forensic audit issue #2511 —
HeavyButter (r13xr13)