Skip to content

Commit

Permalink
feat: Added warning when secure boot enabled
Browse files Browse the repository at this point in the history
Warning message that the flash settings parameters won't be changed because of enabled secure boot
  • Loading branch information
jakub-kocka authored and radimkarnis committed Mar 5, 2024
1 parent 3b0939c commit 8d26375
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion esptool/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,13 @@ def write_flash(esp, args):
if len(image) == 0:
print("WARNING: File %s is empty" % argfile.name)
continue
image = _update_image_flash_params(esp, address, args, image)

if not esp.get_secure_boot_enabled():
image = _update_image_flash_params(esp, address, args, image)
else:
print(
"WARNING: Secure boot is enabled, so not changing any flash settings."
)
calcmd5 = hashlib.md5(image).hexdigest()
uncsize = len(image)
if compress:
Expand Down
3 changes: 3 additions & 0 deletions esptool/targets/esp8266.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ def override_vddsdio(self, new_voltage):
def check_spi_connection(self, spi_connection):
raise NotSupportedError(self, "Setting --spi-connection")

def get_secure_boot_enabled(self):
return False # ESP8266 doesn't have security features


class ESP8266StubLoader(ESP8266ROM):
"""Access class for ESP8266 stub loader, runs on top of ROM."""
Expand Down

0 comments on commit 8d26375

Please sign in to comment.