(file_path, signature_path, pub_key_path)
| 225 | |
| 226 | |
| 227 | def 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 |
no test coverage detected