Merge pull request #5249 from hashicorp/ca-fixes-oss

Minor CA fixes
This commit is contained in:
Kyle Havlovitz 2019-01-22 11:25:09 -08:00 committed by GitHub
commit a731173661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -328,6 +328,9 @@ func (c *ConsulProvider) Sign(csr *x509.CertificateRequest) (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
if providerState.PrivateKey == "" {
return "", ErrNotInitialized
}
// Create the keyId for the cert from the signing private key. // Create the keyId for the cert from the signing private key.
signer, err := connect.ParseSigner(providerState.PrivateKey) signer, err := connect.ParseSigner(providerState.PrivateKey)
@ -623,9 +626,9 @@ func (c *ConsulProvider) generateCA(privateKey string, sn uint64) (string, error
serialNum := &big.Int{} serialNum := &big.Int{}
serialNum.SetUint64(sn) serialNum.SetUint64(sn)
template := x509.Certificate{ template := x509.Certificate{
SerialNumber: serialNum, SerialNumber: serialNum,
Subject: pkix.Name{CommonName: name}, Subject: pkix.Name{CommonName: name},
URIs: []*url.URL{id.URI()}, URIs: []*url.URL{id.URI()},
BasicConstraintsValid: true, BasicConstraintsValid: true,
KeyUsage: x509.KeyUsageCertSign | KeyUsage: x509.KeyUsageCertSign |
x509.KeyUsageCRLSign | x509.KeyUsageCRLSign |

View File

@ -30,3 +30,7 @@ func (s *Server) handleEnterpriseRPCConn(rtype pool.RPCType, conn net.Conn, isTL
func (s *Server) enterpriseStats() map[string]map[string]string { func (s *Server) enterpriseStats() map[string]map[string]string {
return nil return nil
} }
func (s *Server) intentionReplicationEnabled() bool {
return false
}