Skip to content

Commit

Permalink
Merge pull request #1 from KingAnointing/implement-setpin-development
Browse files Browse the repository at this point in the history
Implement SetPin function namecoin#128 development
  • Loading branch information
yorubad-dev authored Oct 15, 2022
2 parents 4b352c4 + 9345627 commit f947479
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions p11mod/p11mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,17 @@ func (ll *llBackend) InitPIN(sh pkcs11.SessionHandle, pin string) error {
}

func (ll *llBackend) SetPIN(sh pkcs11.SessionHandle, oldpin, newpin string) error {
// TODO
log.Println("p11mod SetPIN: not implemented")
return pkcs11.Error(pkcs11.CKR_FUNCTION_NOT_SUPPORTED)
session, err := ll.getSessionByHandle(sh)

if err != nil {
return err
}

if err := session.session.SetPIN(oldpin, newpin); err != nil {
return err
}

return nil
}

// Only call this when ll.sessionsMutex is locked for reading.
Expand Down

0 comments on commit f947479

Please sign in to comment.