Skip to content

Commit e624643

Browse files
committed
build_ffi.py: Fix header parsing of feature detection logic
`defines` was a string instead of a list of strings. This made it impossible to build a wrapper with a configuration in which AES-CBC is disabled, because `'#define NO_AES' in defines` matched also when the header contains `#define NO_AES_CBC`. With `defines` being a list the code actually does what you think it does.
1 parent e9ebda0 commit e624643

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/build_ffi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,10 @@ def get_features(local_wolfssl, features):
346346
e = "No options.h or user_settings.h found for feature detection."
347347
raise RuntimeError(e)
348348

349-
defines = ""
349+
defines = []
350350
for file in defines_files:
351351
with open(file, 'r') as f:
352-
defines += f.read()
352+
defines += f.read().splitlines()
353353

354354
features["MPAPI"] = 1 if '#define WOLFSSL_PUBLIC_MP' in defines else 0
355355
features["SHA"] = 0 if '#define NO_SHA' in defines else 1

0 commit comments

Comments
 (0)