From caaba4a80d7f2e70e3060027b90df73645227a04 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Thu, 26 Sep 2019 15:23:32 -0700 Subject: [PATCH] Update pki with changes in smallstep/cli --- pki/pki.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pki/pki.go b/pki/pki.go index 1fab714d..56f3dbbd 100644 --- a/pki/pki.go +++ b/pki/pki.go @@ -403,6 +403,13 @@ func (p *PKI) GenerateConfig(opt ...Option) (*authority.Config, error) { return nil, errors.Wrap(err, "error serializing private key") } + prov := &provisioner.JWK{ + Name: p.provisioner, + Type: "JWK", + Key: p.ottPublicKey, + EncryptedKey: key, + } + config := &authority.Config{ Root: []string{p.root}, FederatedRoots: []string{}, @@ -417,9 +424,7 @@ func (p *PKI) GenerateConfig(opt ...Option) (*authority.Config, error) { }, AuthorityConfig: &authority.AuthConfig{ DisableIssuedAtCheck: false, - Provisioners: provisioner.List{ - &provisioner.JWK{Name: p.provisioner, Type: "jwk", Key: p.ottPublicKey, EncryptedKey: key}, - }, + Provisioners: provisioner.List{prov}, }, TLS: &tlsutil.TLSOptions{ MinVersion: x509util.DefaultTLSMinVersion, @@ -429,10 +434,14 @@ func (p *PKI) GenerateConfig(opt ...Option) (*authority.Config, error) { }, } if p.enableSSH { + enableSSHCA := true config.SSH = &authority.SSHConfig{ HostKey: p.sshHostKey, UserKey: p.sshUserKey, } + prov.Claims = &provisioner.Claims{ + EnableSSHCA: &enableSSHCA, + } } // Apply configuration modifiers