Skip to content

Commit

Permalink
pkcs11mod: Trace GetAttributeValue
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Mar 9, 2022
1 parent 67141f8 commit 9905eaa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkcs11mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,10 @@ func Go_GetObjectSize(sessionHandle C.CK_SESSION_HANDLE, objectHandle C.CK_OBJEC
//export Go_GetAttributeValue
func Go_GetAttributeValue(sessionHandle C.CK_SESSION_HANDLE, objectHandle C.CK_OBJECT_HANDLE, pTemplate C.CK_ATTRIBUTE_PTR, ulCount C.CK_ULONG) C.CK_RV {
if pTemplate == nil && ulCount > 0 {
if trace {
log.Println("pkcs11mod GetAttributeValue: CKR_ARGUMENTS_BAD")
}

return C.CKR_ARGUMENTS_BAD
}

Expand All @@ -608,10 +612,19 @@ func Go_GetAttributeValue(sessionHandle C.CK_SESSION_HANDLE, objectHandle C.CK_O

goResults, err := backend.GetAttributeValue(goSessionHandle, goObjectHandle, goTemplate)
if err != nil {
if trace {
log.Printf("pkcs11mod GetAttributeValue: %v", err)
}

return fromError(err)
}

err = fromTemplate(goResults, pTemplate)

if trace {
log.Printf("pkcs11mod GetAttributeValue: %v", err)
}

return fromError(err)
}

Expand Down

0 comments on commit 9905eaa

Please sign in to comment.