mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
last updates?
This commit is contained in:
1 parent
2e7325ce03
commit
7dfa3f2b48
6 files changed
+35
-38
No files matched your search
+10
-10
@@ -103,16 +103,7 @@ func (rule *Rule) check(line string, commit *commitInfo) (*Leak, error) {
|
||||
}
|
||||
|
||||
if rule.entropies != nil {
|
||||
if rule.entropyROI == "line" {
|
||||
_entropy := getShannonEntropy(line)
|
||||
for _, e := range rule.entropies {
|
||||
if _entropy > e.v1 && _entropy < e.v2 {
|
||||
entropy = _entropy
|
||||
entropyWord = line
|
||||
goto postEntropy
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if rule.entropyROI == "word" {
|
||||
words := strings.Fields(line)
|
||||
for _, word := range words {
|
||||
_entropy := getShannonEntropy(word)
|
||||
@@ -124,6 +115,15 @@ func (rule *Rule) check(line string, commit *commitInfo) (*Leak, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_entropy := getShannonEntropy(line)
|
||||
for _, e := range rule.entropies {
|
||||
if _entropy > e.v1 && _entropy < e.v2 {
|
||||
entropy = _entropy
|
||||
entropyWord = line
|
||||
goto postEntropy
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user