Skip to content

Commit

Permalink
Use auth-saved cert name during renewals to avoid a panic.
Browse files Browse the repository at this point in the history
Fixes #2749
  • Loading branch information
jefferai committed May 23, 2017
1 parent c416c8a commit 35f632c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builtin/credential/cert/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,12 @@ func (b *backend) verifyCredentials(req *logical.Request, d *framework.FieldData
clientCert := connState.PeerCertificates[0]

// Allow constraining the login request to a single CertEntry
certName := d.Get("name").(string)
var string certName
if req.Auth != nil { // It's a renewal, use the saved certName
certName = req.Auth.Metadata["cert_name"]
} else {
certName = d.Get("name").(string)
}

// Load the trusted certificates
roots, trusted, trustedNonCAs := b.loadTrustedCerts(req.Storage, certName)
Expand Down

0 comments on commit 35f632c

Please sign in to comment.