fix: oom exceptions for OPDS, KOSync, and OTA via wolfssl (#2475)

This commit is contained in:
Justin Mitchell
2026-07-12 01:53:26 +03:00
committed by GitHub
parent 1f5669a08a
commit 3e627112f6
13 changed files with 413 additions and 233 deletions
+29
View File
@@ -0,0 +1,29 @@
from pathlib import Path
Import("env")
PROJECT_DIR = Path(env.subst("$PROJECT_DIR"))
MARKER = "/* CrossPoint wolfSSL compatibility overrides */"
OVERRIDES = f"""
{MARKER}
#undef NO_DH
#ifndef HAVE_FFDHE_2048
#define HAVE_FFDHE_2048
#endif
#undef FP_MAX_BITS
#define FP_MAX_BITS 16384
"""
def patch_user_settings(path: Path) -> None:
text = path.read_text()
if MARKER in text:
text = text.split(MARKER, 1)[0].rstrip()
path.write_text(text + OVERRIDES + "\n")
print(f"Patched wolfSSL settings: {path.relative_to(PROJECT_DIR)}")
for settings in PROJECT_DIR.glob(".pio/libdeps/*/Arduino-wolfSSL/src/user_settings.h"):
patch_user_settings(settings)