Skip to content

Commit

Permalink
implement initpin function in p11mod namecoin#128
Browse files Browse the repository at this point in the history
  • Loading branch information
yorubad-dev committed Oct 19, 2022
1 parent 7c1ad56 commit c127d36
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions p11mod/p11mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,20 @@ func (ll *llBackend) GetMechanismInfo(slotID uint, m []*pkcs11.Mechanism) (pkcs1
}

func (ll *llBackend) InitPIN(sh pkcs11.SessionHandle, pin string) error {
// TODO
log.Println("p11mod InitPIN: not implemented")
return pkcs11.Error(pkcs11.CKR_FUNCTION_NOT_SUPPORTED)
session, err := ll.getSessionByHandle(sh)
if err != nil {
return err
}

if trace {
log.Printf("p11mod initpin")
}

if err := session.session.InitPIN(pin); err != nil {
return err
}

return nil
}

func (ll *llBackend) SetPIN(sh pkcs11.SessionHandle, oldpin, newpin string) error {
Expand Down

0 comments on commit c127d36

Please sign in to comment.