fix: oom exceptions for OPDS, KOSync, and OTA via wolfssl (#2475)
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user