mirror of https://github.com/docker/docs.git
Add FindObjectsFinalize to getNextEmptySlot.
Signed-off-by: Ying Li <ying.li@docker.com> Signed-off-by: David Lawrence <david.lawrence@docker.com> Signed-off-by: Ying Li <ying.li@docker.com> (github: endophage)
This commit is contained in:
parent
10057562d8
commit
38a5b5a342
|
@ -545,6 +545,10 @@ func getNextEmptySlot(ctx IPKCS11Ctx, session pkcs11.SessionHandle) ([]byte, err
|
|||
logrus.Debugf("Failed to find: %s %v", err.Error(), b)
|
||||
return nil, err
|
||||
}
|
||||
if err = ctx.FindObjectsFinal(session); err != nil {
|
||||
logrus.Debugf("Failed to finalize: %s\n", err.Error())
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
// Retrieve the slot ID
|
||||
attr, err := ctx.GetAttributeValue(session, obj, attrTemplate)
|
||||
|
|
|
@ -532,6 +532,7 @@ func TestYubiAddKeyCleansUpOnError(t *testing.T) {
|
|||
setupErrors,
|
||||
"FindObjectsInit",
|
||||
"FindObjects",
|
||||
"FindObjectsFinal",
|
||||
"CreateObject",
|
||||
), true)
|
||||
|
||||
|
@ -629,6 +630,7 @@ func TestYubiImportKeyCleansUpOnError(t *testing.T) {
|
|||
setupErrors,
|
||||
"FindObjectsInit",
|
||||
"FindObjects",
|
||||
"FindObjectsFinal",
|
||||
"CreateObject",
|
||||
), true)
|
||||
|
||||
|
|
Loading…
Reference in New Issue