Skip to content

Commit

Permalink
*: only check CommonName if chain is populated
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Batschelet <[email protected]>
  • Loading branch information
hexfusion committed Jan 2, 2019
1 parent 993aeef commit c0ecbd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion auth/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1159,10 +1159,14 @@ func (as *authStore) AuthInfoFromTLS(ctx context.Context) (ai *AuthInfo) {

tlsInfo := peer.AuthInfo.(credentials.TLSInfo)
for _, chains := range tlsInfo.State.VerifiedChains {
if len(chains) < 1 {
continue
}
cn := chains[0].Subject.CommonName
if len(chains) < 1 || cn == "" {
if cn = "" {
continue
}

ai = &AuthInfo{
Username: cn,
Revision: as.Revision(),
Expand Down

0 comments on commit c0ecbd4

Please sign in to comment.