diff --git a/p11mod/p11mod.go b/p11mod/p11mod.go index 94ef65a..824f975 100644 --- a/p11mod/p11mod.go +++ b/p11mod/p11mod.go @@ -454,7 +454,7 @@ func (ll *llBackend) GetAttributeValue(sh pkcs11.SessionHandle, oh pkcs11.Object result := make([]*pkcs11.Attribute, len(a)) for i, t := range a { if trace { - log.Printf("p11mod GetAttributeValue: Type %d", t.Type) + log.Printf("p11mod GetAttributeValue: querying %s", pkcs11mod.AttrTrace(t)) } value, err := object.Attribute(t.Type) diff --git a/types.go b/types.go index deb5e7a..1167dad 100644 --- a/types.go +++ b/types.go @@ -132,7 +132,7 @@ func fromTemplate(template []*pkcs11.Attribute, clist C.CK_ATTRIBUTE_PTR) error bufferTooSmall := false for i, x := range template { if trace { - log.Printf("pkcs11mod fromTemplate: %s", attrTrace(x)) + log.Printf("pkcs11mod fromTemplate: %s", AttrTrace(x)) } c := l1[i] @@ -371,7 +371,7 @@ var strCKA = map[uint]string{ pkcs11.CKA_CERT_MD5_HASH:"CKA_CERT_MD5_HASH", } -func attrTrace(a *pkcs11.Attribute) string { +func AttrTrace(a *pkcs11.Attribute) string { t, ok := strCKA[a.Type] if !ok { t = fmt.Sprintf("%d", a.Type)