Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use auth-saved cert name during renewals to avoid a panic. #2755

Merged
merged 2 commits into from
May 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull requests works fine, after changing the typo var string certName to var certName string. Thank!

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