From 3a00b6b39656fb8bba385cdada98b35f56a8f0ed Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Mon, 26 Jul 2021 14:31:42 -0700 Subject: [PATCH] Properly marshal a certificate when we send it to linkedca. --- authority/linkedca.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/authority/linkedca.go b/authority/linkedca.go index 79427c5c..75bc6e1a 100644 --- a/authority/linkedca.go +++ b/authority/linkedca.go @@ -6,7 +6,6 @@ import ( "crypto/sha256" "crypto/tls" "crypto/x509" - "encoding/base64" "encoding/hex" "encoding/pem" "fmt" @@ -264,7 +263,7 @@ func (c *linkedCaClient) StoreSSHCertificate(crt *ssh.Certificate) error { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() _, err := c.client.PostSSHCertificate(ctx, &linkedca.SSHCertificateRequest{ - Certificate: base64.StdEncoding.EncodeToString(crt.Marshal()), + Certificate: string(ssh.MarshalAuthorizedKey(crt)), }) return errors.Wrap(err, "error posting ssh certificate") }