This commit is contained in:
zbarryte 2018-09-07 18:25:46 +00:00 committed by GitHub
commit d722548fa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
from __future__ import print_function from __future__ import print_function
import argparse import argparse
import os
import sys import sys
BLACKLIST = [ BLACKLIST = [
@ -22,6 +23,7 @@ def detect_private_key(argv=None):
private_key_files = [] private_key_files = []
for filename in args.filenames: for filename in args.filenames:
if os.path.isfile(filename):
with open(filename, 'rb') as f: with open(filename, 'rb') as f:
content = f.read() content = f.read()
if any(line in content for line in BLACKLIST): if any(line in content for line in BLACKLIST):