Skip to content

Commit

Permalink
feature: exclude ServerAuth certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
buptczq committed May 30, 2020
1 parent ad1a011 commit fe5cc06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion sshagent/eku.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ func FilterCertificateEKU(cert *capi.Certificate) bool {
flagAny := false
flagBitLocker := false
flagAuth := false
flagServerAuth := false
for i := range cert.ExtKeyUsage {
if cert.ExtKeyUsage[i] == x509.ExtKeyUsageAny {
flagAny = true
} else if cert.ExtKeyUsage[i] == x509.ExtKeyUsageClientAuth {
flagAuth = true
} else if cert.ExtKeyUsage[i] == x509.ExtKeyUsageServerAuth {
flagServerAuth = true
}
}
for i := range cert.UnknownExtKeyUsage {
Expand All @@ -35,7 +38,7 @@ func FilterCertificateEKU(cert *capi.Certificate) bool {
if flagAny || flagAuth {
return true
}
if flagBitLocker {
if flagBitLocker || flagServerAuth {
return false
}
return true
Expand Down
6 changes: 3 additions & 3 deletions versioninfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"FileVersion": {
"Major": 1,
"Minor": 0,
"Patch": 4,
"Patch": 5,
"Build": 0
},
"ProductVersion": {
"Major": 1,
"Minor": 0,
"Patch": 4,
"Patch": 5,
"Build": 0
},
"FileFlagsMask": "3f",
Expand All @@ -29,7 +29,7 @@
"OriginalFilename": "WinCryptSSHAgent.exe",
"PrivateBuild": "",
"ProductName": "WinCrypt SSH Agent",
"ProductVersion": "v1.0.4",
"ProductVersion": "v1.0.5",
"SpecialBuild": ""
},
"VarFileInfo": {
Expand Down

0 comments on commit fe5cc06

Please sign in to comment.