connect/ca: fix a potential panic in the Consul provider

This commit is contained in:
Kyle Havlovitz 2019-02-07 10:43:54 -08:00
parent 7b09d0aa6c
commit 51d5d6b1d4
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C
1 changed files with 2 additions and 4 deletions

View File

@ -323,8 +323,7 @@ func (c *ConsulProvider) Sign(csr *x509.CertificateRequest) (string, error) {
defer c.Unlock()
// Get the provider state
state := c.Delegate.State()
idx, providerState, err := state.CAProviderState(c.id)
idx, providerState, err := c.getState()
if err != nil {
return "", err
}
@ -509,8 +508,7 @@ func (c *ConsulProvider) CrossSignCA(cert *x509.Certificate) (string, error) {
defer c.Unlock()
// Get the provider state
state := c.Delegate.State()
idx, providerState, err := state.CAProviderState(c.id)
idx, providerState, err := c.getState()
if err != nil {
return "", err
}