Skip to content

Commit

Permalink
Trace FindObjectsInit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Rand committed Aug 9, 2022
1 parent 7dc4b42 commit 5dc5898
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkcs11mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,13 +708,27 @@ func Go_SetAttributeValue(sessionHandle C.CK_SESSION_HANDLE, hObject C.CK_OBJECT

//export Go_FindObjectsInit
func Go_FindObjectsInit(sessionHandle C.CK_SESSION_HANDLE, pTemplate C.CK_ATTRIBUTE_PTR, ulCount C.CK_ULONG) C.CK_RV {
if trace {
log.Println("pkcs11mod FindObjectsInit")
}

if pTemplate == nil && ulCount > 0 {
if trace {
log.Println("pkcs11mod FindObjectsInit: CKR_ARGUMENTS_BAD")
}

return C.CKR_ARGUMENTS_BAD
}

goSessionHandle := pkcs11.SessionHandle(sessionHandle)
goTemplate := toTemplate(pTemplate, ulCount)

if trace {
for _, attr := range goTemplate {
log.Printf("pkcs11mod FindObjectsInit: template %s", AttrTrace(attr))
}
}

err := backend.FindObjectsInit(goSessionHandle, goTemplate)
return fromError(err)
}
Expand Down

0 comments on commit 5dc5898

Please sign in to comment.