mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 04:06:33 +02:00
build_library: pcr: Surface error from pesign
This commit is contained in:
parent
1df9526241
commit
3ca5bde325
@ -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: <hex>\n"
|
||||
return result.stdout.strip().split(': ', 1)[1]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user