Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions taking Mechanism take wrong input #55

Closed
jsha opened this issue Oct 14, 2017 · 0 comments
Closed

Functions taking Mechanism take wrong input #55

jsha opened this issue Oct 14, 2017 · 0 comments

Comments

@jsha
Copy link
Contributor

jsha commented Oct 14, 2017

These methods are defined by PKCS#11 to take a CK_MECHANISM_PTR, but their Go method signatures take a []*Mechanism. For clarity, I think they should take a single *Mechanism or possibly Mechanism.

func (c *Ctx) DecryptInit(sh SessionHandle, m []*Mechanism, o ObjectHandle) error
func (c *Ctx) DeriveKey(sh SessionHandle, m []*Mechanism, basekey ObjectHandle, a []*Attribute) (ObjectHandle, error)
func (c *Ctx) DigestInit(sh SessionHandle, m []*Mechanism) error
func (c *Ctx) EncryptInit(sh SessionHandle, m []*Mechanism, o ObjectHandle) error
func (c *Ctx) GenerateKey(sh SessionHandle, m []*Mechanism, temp []*Attribute) (ObjectHandle, error)
func (c *Ctx) GenerateKeyPair(sh SessionHandle, m []*Mechanism, public, private []*Attribute) (ObjectHandle, ObjectHandle, error)
func (c *Ctx) GetMechanismInfo(slotID uint, m []*Mechanism) (MechanismInfo, error)
func (c *Ctx) SignInit(sh SessionHandle, m []*Mechanism, o ObjectHandle) error
func (c *Ctx) SignRecoverInit(sh SessionHandle, m []*Mechanism, key ObjectHandle) error
func (c *Ctx) UnwrapKey(sh SessionHandle, m []*Mechanism, unwrappingkey ObjectHandle, wrappedkey []byte, a []*Attribute) (ObjectHandle, error)
func (c *Ctx) VerifyInit(sh SessionHandle, m []*Mechanism, key ObjectHandle) error
func (c *Ctx) VerifyRecoverInit(sh SessionHandle, m []*Mechanism, key ObjectHandle) error
func (c *Ctx) WrapKey(sh SessionHandle, m []*Mechanism, wrappingkey, key ObjectHandle) ([]byte, error)

I realize this is would be a breaking change, so feel free to say WONTFIX, but I wanted to point it out as a bit of a confusing thing in this package.

@miekg miekg closed this as completed Jan 4, 2022
JeremyRand pushed a commit to JeremyRand/pkcs11 that referenced this issue Oct 13, 2022
JeremyRand pushed a commit to JeremyRand/pkcs11 that referenced this issue Oct 13, 2022
JeremyRand pushed a commit to namecoin/pkcs11 that referenced this issue Nov 3, 2022
JeremyRand pushed a commit to namecoin/pkcs11 that referenced this issue Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants