mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 06:16:08 +00:00
agent/consul: check nil on getCAProvider result
This commit is contained in:
parent
9b3495dddb
commit
c8b65217c3
@ -157,6 +157,9 @@ func (s *ConnectCA) ConfigurationSet(
|
|||||||
|
|
||||||
// Have the old provider cross-sign the new intermediate
|
// Have the old provider cross-sign the new intermediate
|
||||||
oldProvider := s.srv.getCAProvider()
|
oldProvider := s.srv.getCAProvider()
|
||||||
|
if oldProvider == nil {
|
||||||
|
return fmt.Errorf("internal error: CA provider is nil")
|
||||||
|
}
|
||||||
xcCert, err := oldProvider.CrossSignCA(intermediateCA)
|
xcCert, err := oldProvider.CrossSignCA(intermediateCA)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -283,6 +286,9 @@ func (s *ConnectCA) Sign(
|
|||||||
}
|
}
|
||||||
|
|
||||||
provider := s.srv.getCAProvider()
|
provider := s.srv.getCAProvider()
|
||||||
|
if provider == nil {
|
||||||
|
return fmt.Errorf("internal error: CA provider is nil")
|
||||||
|
}
|
||||||
|
|
||||||
// todo(kyhavlov): more validation on the CSR before signing
|
// todo(kyhavlov): more validation on the CSR before signing
|
||||||
pem, err := provider.Sign(csr)
|
pem, err := provider.Sign(csr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user