Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
roddhjav committed Feb 24, 2018
1 parent 7d4fe1c commit a78d7a6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import sys
import glob
import hashlib
import requests
import argparse
from subprocess import Popen, PIPE
import requests


BASEAPIURL = "https://api.pwnedpasswords.com/"
Expand Down Expand Up @@ -124,7 +124,7 @@ def _pass(self, arg=None, data=None):
return stdout

def list(self, path=''):
""" Return a list of paths in a store """
"""Return a list of paths in a store."""
paths = []
prefix = os.path.join(self.prefix, path)
for file in glob.glob(prefix + '*/**/*.gpg', recursive=True):
Expand Down Expand Up @@ -172,9 +172,9 @@ def password(self):
data = []
prefixes = []
for path, password in self.data.items():
hash = hashlib.sha1(password.encode("utf8")).hexdigest().upper()
prefix = hash[0:5]
data.append((path, password, hash, prefix))
phash = hashlib.sha1(password.encode("utf8")).hexdigest().upper()
prefix = phash[0:5]
data.append((path, password, phash, prefix))
if prefix not in prefixes:
prefixes.append(prefix)

Expand All @@ -185,9 +185,9 @@ def password(self):

# Compare the data and return the breached passwords.
breached = []
for path, password, hash, prefix in data:
if hash in buckets[prefix][0]:
index = buckets[prefix][0].index(hash)
for path, password, phash, prefix in data:
if phash in buckets[prefix][0]:
index = buckets[prefix][0].index(phash)
count = buckets[prefix][1][index]
breached.append((path, password, count))
return breached
Expand Down

0 comments on commit a78d7a6

Please sign in to comment.