MCPcopy Create free account
hub / github.com/comaps/comaps / verify_file

Function verify_file

tools/python/maps_generator/utils/file.py:227–240  ·  view source on GitHub ↗
(file_path, signature_path, pub_key_path)

Source from the content-addressed store, hash-verified

225
226
227def verify_file(file_path, signature_path, pub_key_path):
228 cmd = [
229 "openssl", "pkeyutl", "-verify",
230 "-pubin", "-inkey", pub_key_path,
231 "-rawin", "-in", file_path,
232 "-sigfile", signature_path,
233 ]
234 proc = subprocess.run(cmd, capture_output=True, text=True)
235 if proc.returncode != 0:
236 stderr = proc.stderr.strip()
237 stdout = proc.stdout.strip()
238 logger.warning(f"Signature verification failed for {signature_path} (exitcode: {proc.returncode} stdout: {stdout!s} stderr: {stderr!s}")
239 return False
240 return True

Callers 2

applyMethod · 0.90

Calls 1

runMethod · 0.45

Tested by

no test coverage detected