From a07ddd050eed9f33c38629ed7f1f25ad41bd5839 Mon Sep 17 00:00:00 2001 From: Tamas Koczka Date: Thu, 14 Sep 2023 11:17:04 +0000 Subject: [PATCH] kernelCTF: PR GHA: explicitly confirm hash match --- kernelctf/check-submission.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernelctf/check-submission.py b/kernelctf/check-submission.py index 3842ccf4..3996d072 100755 --- a/kernelctf/check-submission.py +++ b/kernelctf/check-submission.py @@ -193,6 +193,8 @@ def parseCsv(csvContent): if exploitHash != calculated: error(f"Expected `{archiveFn}` with SHA256 hash of `{exploitHash}`, but the file's checksum is `{calculated}`.") + else: + print(f"[+] The hash of the file `{archiveFn}` matches the expected `{exploitHash}` value.") flags.extend(publicData["Flags"].strip().split('\n')) @@ -201,7 +203,7 @@ def parseCsv(csvContent): flagTargets = set([checkRegex(flag, r"kernelCTF\{v1:([^:]+):\d+\}", f"The flag (`{flag}`) is invalid").group(1) for flag in flags]) if "mitigation-6.1-v2" in flagTargets: - flagTargets = flagTargets - set(["mitigation-6.1-v2"]) | set(["mitigation-6.1"]) + flagTargets = flagTargets - {"mitigation-6.1-v2"} | {"mitigation-6.1"} print(f"[-] Got flags for the following targets: {', '.join(flagTargets)}") checkList(flagTargets, lambda t: t in exploitFolders, f"Missing exploit for target(s)") checkList(exploitFolders, lambda t: t in flagTargets, f"Found extra exploit(s) without flag submission", True)