audit: only look for empty checksums once

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-02-15 22:10:03 -06:00
parent 555b16962f
commit 98dcfcfe2e

View File

@ -75,18 +75,10 @@ def audit_formula_text name, text
end
# Empty checksums
if text =~ /md5\s+(''|"")/
if text =~ /(md5|sha1|sha256)\s+(''|"")/
problems << " * md5 is empty"
end
if text =~ /sha1\s+(''|"")/
problems << " * sha1 is empty"
end
if text =~ /sha256\s+(''|"")/
problems << " * sha256 is empty"
end
# Checksum sanity check
if text =~ /md5\s+['"](.+)['"]/ and $1 != '#{md5}' and $1 !~ /[a-f0-9]{32}/
problems << " * md5 contains invalid or incorrect number of characters"