From bd8dd9da41fc953c62135c36582ff7ad001bdf0d Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Thu, 10 Sep 2020 19:13:17 -0700 Subject: [PATCH] Do not read issuer and signer twice. --- authority/authority.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/authority/authority.go b/authority/authority.go index 0fc7a71a..a51e986f 100644 --- a/authority/authority.go +++ b/authority/authority.go @@ -218,21 +218,8 @@ func (a *Authority) init() error { // Set issuer and signer for default CAS. if options.HasType(casapi.SoftCAS) { - crt, err := pemutil.ReadCertificate(a.config.IntermediateCert) - if err != nil { - return err - } - - signer, err := a.keyManager.CreateSigner(&kmsapi.CreateSignerRequest{ - SigningKey: a.config.IntermediateKey, - Password: []byte(a.config.Password), - }) - if err != nil { - return err - } - - options.Issuer = crt - options.Signer = signer + options.Issuer = a.x509Issuer + options.Signer = a.x509Signer } a.x509CAService, err = cas.New(context.Background(), options)