From 3ca5bde325218f914c982b1aa0eb51c7622c5d47 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Fri, 20 Feb 2026 11:21:27 +0100 Subject: [PATCH] build_library: pcr: Surface error from pesign --- build_library/precompute_pcr.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build_library/precompute_pcr.py b/build_library/precompute_pcr.py index 6659ae861f..4b5ad9c91e 100755 --- a/build_library/precompute_pcr.py +++ b/build_library/precompute_pcr.py @@ -73,7 +73,10 @@ def pe_authenticode_hash(filepath, hash_algo='sha256'): """ result = subprocess.run( ['pesign', '-h', '-i', filepath, '-d', hash_algo], - capture_output=True, text=True, check=True) + capture_output=True, text=True) + if result.returncode != 0: + msg = result.stderr.strip() or f'pesign failed with exit code {result.returncode}' + raise RuntimeError(f'{filepath}: {msg}') # Output format: "hash: \n" return result.stdout.strip().split(': ', 1)[1]