From 886b9a1d8db24970c5b0ca0a386229579785d4af Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Thu, 28 Oct 2021 18:16:16 -0700 Subject: [PATCH] Store the certificate passed. --- kms/pkcs11/pkcs11.go | 2 +- kms/pkcs11/setup_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kms/pkcs11/pkcs11.go b/kms/pkcs11/pkcs11.go index a0c8cea6..cec05d33 100644 --- a/kms/pkcs11/pkcs11.go +++ b/kms/pkcs11/pkcs11.go @@ -209,7 +209,7 @@ func (k *PKCS11) StoreCertificate(req *apiv1.StoreCertificateRequest) error { if req.Extractable { template.Set(crypto11.CkaExtractable, true) } - if err := k.p11.ImportCertificateWithAttributes(template, cert); err != nil { + if err := k.p11.ImportCertificateWithAttributes(template, req.Certificate); err != nil { return errors.Wrap(err, "storeCertificate failed") } diff --git a/kms/pkcs11/setup_test.go b/kms/pkcs11/setup_test.go index 52dc5207..8aba2aaa 100644 --- a/kms/pkcs11/setup_test.go +++ b/kms/pkcs11/setup_test.go @@ -105,7 +105,7 @@ func setup(t TBTesting, k *PKCS11) { }); err != nil && !errors.Is(errors.Cause(err), apiv1.ErrAlreadyExists{ Message: c.Name + " already exists", }) { - t.Errorf("PKCS1.StoreCertificate() error = %+v", err) + t.Errorf("PKCS1.StoreCertificate() error = %v", err) continue } testCerts[i].Certificates = append(testCerts[i].Certificates, cert)