Compare commits

...

4 Commits

Author SHA1 Message Date
Richard Holland
95e4ce89c7 revert change 2025-05-01 15:13:52 +10:00
Richard Holland
b9ac76f11f skip import test file 2025-05-01 14:58:14 +10:00
Richard Holland
120ecc19c2 specific false positive 2025-05-01 11:11:23 +10:00
Richard Holland
0ac4ba939a remove false positives from sus pat finder 2025-05-01 09:47:18 +10:00

View File

@@ -8,13 +8,18 @@ files_changed=$(git diff --name-only --relative HEAD~1 HEAD)
# Loop through each file and search for the patterns
for file in $files_changed; do
# Skip if the file is Import_test.cpp (exact filename match regardless of path)
if [[ "$(basename "$file")" == "Import_test.cpp" ]]; then
continue
fi
# Construct the absolute path
absolute_path="$repo_root/$file"
# Check if the file exists (it might have been deleted)
if [ -f "$absolute_path" ]; then
# Search the file for the given patterns
grep_output=$(grep -n -E '(([^rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]|^)(s|p)[rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]{25,60}([^(]|$)))|([^A-Fa-f0-9](02|03|ED)[A-Fa-f0-9]{64})' "$absolute_path")
# Search the file for the given patterns, but exclude lines containing 'public_key'
grep_output=$(grep -n -E '(([^rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]|^)(s|p)[rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]{25,60}([^(]|$)))|([^A-Fa-f0-9](02|03|ED)[A-Fa-f0-9]{64})' "$absolute_path" | grep -v "public_key")
# Check if grep found any matches
if [ ! -z "$grep_output" ]; then
@@ -25,7 +30,3 @@ for file in $files_changed; do
fi
fi
done
# If the loop completes without finding any suspicious patterns
echo "Success: No suspicious patterns found in the diff."
exit 0