Rearrange order of checks; let gpg test for presence of signature for us
1 files changed, 4 insertions(+), 12 deletions(-)

M fetch-sanesecurity-sigs
M fetch-sanesecurity-sigs +4 -12
@@ 203,15 203,14 @@ do
 		continue
 	fi
 
-	# Check that there actually is a GnuPG signature
-	# (there should be, and its absence could be due to tampering)
-	if [ ! -e "$db.sig" ]
+	# Zero-length databases have no value and confuse the test below
+	if [ ! -s "$db" ]
 	then
-		echo "SECURITY ERROR: $db_name is missing a GnuPG signature; discarding" >&2
+		echo "$db_name is zero-length; discarding"
 		continue
 	fi
 
-	# Check that the GnuPG signature is correct
+	# Check that the GnuPG signature is present and correct
 	if ! gpg_out=$(gpg --homedir "$gpg_homedir" $gpg_extra_opts --verify "$db.sig" "$db" 2>&1)
 	then
 		echo "SECURITY ERROR: $db_name has a bad GnuPG signature; discarding:" >&2

          
@@ 219,13 218,6 @@ do
 		continue
 	fi
 
-	# Zero-length databases have no value and confuse the test below
-	if [ ! -s "$db" ]
-	then
-		echo "$db_name is zero-length; discarding"
-		continue
-	fi
-
 	# Test the database by asking ClamAV to check something with it
 	if ! clamscan --quiet --tempdir="${TMPDIR:-/tmp}" --database="$db" - < /dev/null
 	then