From 409d8e21ce7c4fa559e3042e46a1535322c56803 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 19 Dec 2024 17:53:58 -0800 Subject: [PATCH] Correct checks for StMm and Stmm_Supv conflicts. (#117) ## Description Added $() around parameters for new checks in Stmm and StmmSupv includes. Was resulting in always throwing an error because evaluation was two static values. - [ ] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested After changing, manually examined output ## Integration Instructions No integration required. --- CryptoBinPkg/Driver/Packaging/generate_cryptodriver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CryptoBinPkg/Driver/Packaging/generate_cryptodriver.py b/CryptoBinPkg/Driver/Packaging/generate_cryptodriver.py index 49ebdf78..d7545d53 100644 --- a/CryptoBinPkg/Driver/Packaging/generate_cryptodriver.py +++ b/CryptoBinPkg/Driver/Packaging/generate_cryptodriver.py @@ -902,15 +902,15 @@ class options(): fdf_bb_lines = [] fdf_bb_lines.append( f"# include this in the platform {upper_phase} FV") - fdf_bb_lines.append(f"!ifndef {upper_phase}_CRYPTO_SERVICES") + fdf_bb_lines.append(f"!ifndef $({upper_phase}_CRYPTO_SERVICES)") fdf_bb_lines.append(f"!error You need to define {upper_phase}_CRYPTO_SERVICES") fdf_bb_lines.append("!endif") if phase in {"StandaloneMm", "StandaloneMm_MmSupv"}: - fdf_bb_lines.append(f"!if {upper_phase}_CRYPTO_SERVICES == NONE") + fdf_bb_lines.append(f"!if $({upper_phase}_CRYPTO_SERVICES) == NONE") fdf_bb_lines.append(f"!error You included CryptoDriver.{upper_phase}.inc.fdf but {upper_phase}_CRYPTO_SERVICES is set to NONE.") fdf_bb_lines.append("!endif") other_mm_phase_upper = ({"StandaloneMm", "StandaloneMm_MmSupv"} - {phase}).pop().upper() - fdf_bb_lines.append(f"!if {other_mm_phase_upper}_CRYPTO_SERVICES != NONE") + fdf_bb_lines.append(f"!if $({other_mm_phase_upper}_CRYPTO_SERVICES) != NONE") fdf_bb_lines.append(f"!error You included CryptoDriver.{upper_phase}.inc.fdf but {other_mm_phase_upper}_CRYPTO_SERVICES is not set to NONE. These are mutually exclusive.") fdf_bb_lines.append("!endif") for flavor in flavors: