Browse code

Fix some missed safebrowsing URLs (bb #2514).

Some hostkey prefixes are missing from the DB, so just drop the hostkey prefix
filtering, and always lookup the full hashes.

Török Edvin authored on 2011/02/04 23:55:34
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Fri Feb  4 16:55:07 EET 2011 (edwin)
2
+------------------------------------
3
+ * libclamav/phishcheck.c: fix some missed safebrowsing URLs (bb #2514)
4
+
1 5
 Fri Feb  4 14:35:32 CET 2011 (tk)
2 6
 ---------------------------------
3 7
  * libclamav/matcher-bm.c: fix error message (bb#2513)
... ...
@@ -1205,6 +1205,7 @@ static int hash_match(const struct regex_matcher *rlist, const char *host, size_
1205 1205
 	    }
1206 1206
 	    h[64]='\0';
1207 1207
 	    cli_dbgmsg("Looking up hash %s for %s(%u)%s(%u)\n", h, host, (unsigned)hlen, path, (unsigned)plen);
1208
+#if 0
1208 1209
 	    if (prefix_matched) {
1209 1210
 		if (cli_bm_scanbuff(sha256_dig, 4, &virname, NULL, &rlist->hostkey_prefix,0,NULL,NULL) == CL_VIRUS) {
1210 1211
 		    cli_dbgmsg("prefix matched\n");
... ...
@@ -1212,6 +1213,7 @@ static int hash_match(const struct regex_matcher *rlist, const char *host, size_
1212 1212
 		} else
1213 1213
 		    return CL_SUCCESS;
1214 1214
 	    }
1215
+#endif
1215 1216
 	    if (cli_bm_scanbuff(sha256_dig, 32, &virname, NULL, &rlist->sha256_hashes,0,NULL,NULL) == CL_VIRUS) {
1216 1217
 		cli_dbgmsg("This hash matched: %s\n", h);
1217 1218
 		switch(*virname) {
... ...
@@ -1408,6 +1410,7 @@ static int url_hash_match(const struct regex_matcher *rlist, const char *inurl,
1408 1408
 		    return rc;
1409 1409
 		}
1410 1410
 		count++;
1411
+#if 0
1411 1412
 		if (count == 2 && !prefix_matched && rlist->hostkey_prefix.bm_patterns) {
1412 1413
 		    /* if hostkey is not matched, don't bother calculating
1413 1414
 		     * hashes for other parts of the URL, they are not in the DB
... ...
@@ -1415,6 +1418,7 @@ static int url_hash_match(const struct regex_matcher *rlist, const char *inurl,
1415 1415
 		    cli_dbgmsg("hostkey prefix not matched, short-circuiting lookups\n");
1416 1416
 		    return CL_SUCCESS;
1417 1417
 		}
1418
+#endif
1418 1419
 	    }
1419 1420
 	}
1420 1421
 	return CL_SUCCESS;