diff --git a/p11/session.go b/p11/session.go index 76344d7..353d43c 100644 --- a/p11/session.go +++ b/p11/session.go @@ -113,7 +113,7 @@ func (s *sessionImpl) FindObjects(template []*pkcs11.Attribute) ([]Object, error var results []Object for { - objectHandles, _, err := s.ctx.FindObjects(s.handle, 100) + objectHandles, err := s.ctx.FindObjects(s.handle, 100) if err != nil { _ = s.ctx.FindObjectsFinal(s.handle) return nil, err diff --git a/parallel_test.go b/parallel_test.go index aee49bc..ea080db 100644 --- a/parallel_test.go +++ b/parallel_test.go @@ -89,7 +89,7 @@ func getPrivateKey(context *Ctx, session SessionHandle, label string) (ObjectHan if err := context.FindObjectsInit(session, template); err != nil { return noKey, err } - objs, _, err := context.FindObjects(session, 2) + objs, err := context.FindObjects(session, 2) if err != nil { return noKey, err } diff --git a/params_test.go b/params_test.go index 98d5185..b760b86 100644 --- a/params_test.go +++ b/params_test.go @@ -35,7 +35,7 @@ func findObject(t *testing.T, p *Ctx, sh SessionHandle, class uint, label string if err := p.FindObjectsInit(sh, template); err != nil { t.Fatal("FindObjectsInit:", err) } - obj, _, err := p.FindObjects(sh, 1) + obj, err := p.FindObjects(sh, 1) if err != nil { t.Fatal("FindObjects:", err) } diff --git a/pkcs11.go b/pkcs11.go index f575b7f..f6a23af 100644 --- a/pkcs11.go +++ b/pkcs11.go @@ -1121,16 +1121,14 @@ func (c *Ctx) FindObjectsInit(sh SessionHandle, temp []*Attribute) error { // objects that match a template, obtaining additional object // handles. Calling the function repeatedly may yield additional results until // an empty slice is returned. -// -// The returned boolean value is deprecated and should be ignored. -func (c *Ctx) FindObjects(sh SessionHandle, max int) ([]ObjectHandle, bool, error) { +func (c *Ctx) FindObjects(sh SessionHandle, max int) ([]ObjectHandle, error) { var ( objectList C.CK_OBJECT_HANDLE_PTR ulCount C.CK_ULONG ) e := C.FindObjects(c.ctx, C.CK_SESSION_HANDLE(sh), &objectList, C.CK_ULONG(max), &ulCount) if toError(e) != nil { - return nil, false, toError(e) + return nil, toError(e) } l := toList(C.CK_ULONG_PTR(unsafe.Pointer(objectList)), ulCount) // Make again a new list of the correct type. @@ -1139,7 +1137,7 @@ func (c *Ctx) FindObjects(sh SessionHandle, max int) ([]ObjectHandle, bool, erro for i, v := range l { o[i] = ObjectHandle(v) } - return o, ulCount > C.CK_ULONG(max), nil + return o, nil } // FindObjectsFinal finishes a search for token and session objects. diff --git a/pkcs11_test.go b/pkcs11_test.go index 194edf5..92f3149 100644 --- a/pkcs11_test.go +++ b/pkcs11_test.go @@ -124,7 +124,7 @@ func TestFindObject(t *testing.T) { if e := p.FindObjectsInit(session, template); e != nil { t.Fatalf("failed to init: %s\n", e) } - obj, _, e := p.FindObjects(session, 2) + obj, e := p.FindObjects(session, 2) if e != nil { t.Fatalf("failed to find: %s\n", e) } @@ -323,7 +323,7 @@ func destroyObject(t *testing.T, p *Ctx, session SessionHandle, searchToken stri if e := p.FindObjectsInit(session, template); e != nil { t.Fatalf("failed to init: %s\n", e) } - obj, _, e := p.FindObjects(session, 1) + obj, e := p.FindObjects(session, 1) if e != nil || len(obj) == 0 { t.Fatalf("failed to find objects") }