forked from TrueCloudLab/certificates
Store the certificate passed.
This commit is contained in:
parent
aa80bf9f07
commit
886b9a1d8d
2 changed files with 2 additions and 2 deletions
|
@ -209,7 +209,7 @@ func (k *PKCS11) StoreCertificate(req *apiv1.StoreCertificateRequest) error {
|
||||||
if req.Extractable {
|
if req.Extractable {
|
||||||
template.Set(crypto11.CkaExtractable, true)
|
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")
|
return errors.Wrap(err, "storeCertificate failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ func setup(t TBTesting, k *PKCS11) {
|
||||||
}); err != nil && !errors.Is(errors.Cause(err), apiv1.ErrAlreadyExists{
|
}); err != nil && !errors.Is(errors.Cause(err), apiv1.ErrAlreadyExists{
|
||||||
Message: c.Name + " already exists",
|
Message: c.Name + " already exists",
|
||||||
}) {
|
}) {
|
||||||
t.Errorf("PKCS1.StoreCertificate() error = %+v", err)
|
t.Errorf("PKCS1.StoreCertificate() error = %v", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
testCerts[i].Certificates = append(testCerts[i].Certificates, cert)
|
testCerts[i].Certificates = append(testCerts[i].Certificates, cert)
|
||||||
|
|
Loading…
Add table
Reference in a new issue