sprucing up the joint

This commit is contained in:
zricethezav committed 2018-02-22 19:06:04 -06:00
1 parent 6f5079c193
commit 1e250f1a14
6 files changed
+54 -55

No files matched your search

+6 -13
View File
@@ -107,10 +107,9 @@ func getLeaks(repoName string, opts *Options) []LeakElem {
currCommit := string(currCommitB)
go func(currCommit string, repoName string, commitWG *sync.WaitGroup,
gitLeakReceiverWG *sync.WaitGroup, opts *Options) {
gitLeakReceiverWG *sync.WaitGroup) {
defer commitWG.Done()
var leakPrs bool
if currCommit == "" {
return
@@ -131,22 +130,16 @@ func getLeaks(repoName string, opts *Options) []LeakElem {
return
}
lines := checkRegex(string(out))
lines := doChecks(string(out))
if len(lines) == 0 {
return
}
for _, line := range lines {
leakPrs = checkShannonEntropy(line, opts.B64EntropyCutoff, opts.HexEntropyCutoff)
if leakPrs {
if opts.Strict && containsStopWords(line) {
continue
}
gitLeakReceiverWG.Add(1)
gitLeaks <- LeakElem{line, currCommit}
}
gitLeakReceiverWG.Add(1)
gitLeaks <- LeakElem{line, currCommit}
}
}(currCommit, repoName, &commitWG, &gitLeakReceiverWG, opts)
}(currCommit, repoName, &commitWG, &gitLeakReceiverWG)
}
commitWG.Wait()