29 |
29 |
30 from .SafeBrowsingAPIClient import SafeBrowsingAPIClient |
30 from .SafeBrowsingAPIClient import SafeBrowsingAPIClient |
31 from .SafeBrowsingCache import SafeBrowsingCache |
31 from .SafeBrowsingCache import SafeBrowsingCache |
32 from .SafeBrowsingThreatList import ThreatList, HashPrefixList |
32 from .SafeBrowsingThreatList import ThreatList, HashPrefixList |
33 from .SafeBrowsingUrl import SafeBrowsingUrl |
33 from .SafeBrowsingUrl import SafeBrowsingUrl |
34 from .SafeBrowsingUtilities import toHex |
|
35 |
34 |
36 |
35 |
37 class SafeBrowsingManager(QObject): |
36 class SafeBrowsingManager(QObject): |
38 """ |
37 """ |
39 Class implementing the interface for Google Safe Browsing. |
38 Class implementing the interface for Google Safe Browsing. |
425 @type list of bytes |
424 @type list of bytes |
426 @return names of threat lists hashes were found in |
425 @return names of threat lists hashes were found in |
427 @rtype list of ThreatList |
426 @rtype list of ThreatList |
428 """ |
427 """ |
429 fullHashes = list(fullHashes) |
428 fullHashes = list(fullHashes) |
430 cues = [toHex(fh[:4]) for fh in fullHashes] |
429 cues = [fh[:4].hex() for fh in fullHashes] |
431 result = [] |
430 result = [] |
432 |
431 |
433 matchingPrefixes = {} |
432 matchingPrefixes = {} |
434 matchingFullHashes = set() |
433 matchingFullHashes = set() |
435 isPotentialThreat = False |
434 isPotentialThreat = False |