mirror of
https://github.com/esphome/esphome.git
synced 2026-09-29 16:00:23 +00:00
The slot only exists when the api server refills it, so an OTA-only encrypted build carries no dead storage; a refused spare no longer fails the handshake, the handshake generates its own key instead; the key sizes are named constants; the host gtest suite covers the slot's single use, the key pair's consistency, and a full handshake whose message carries the supplied public key.
17 lines
577 B
Python
17 lines
577 B
Python
import esphome.codegen as cg
|
|
from tests.testing_helpers import ComponentManifestOverride
|
|
|
|
|
|
def override_manifest(manifest: ComponentManifestOverride) -> None:
|
|
# to_code must run: it defines USE_NOISE and adds the noise-c library
|
|
# the component sources under test need.
|
|
manifest.enable_codegen()
|
|
real_to_code = manifest.to_code
|
|
|
|
async def to_code_testing(config):
|
|
await real_to_code(config)
|
|
# The spare ephemeral slot only exists in builds with an encrypted api
|
|
cg.add_define("USE_API_NOISE")
|
|
|
|
manifest.to_code = to_code_testing
|