mirror of
https://github.com/status-im/status-keycard-go.git
synced 2025-02-24 20:18:06 +00:00
add unblockPIN implementation
This commit is contained in:
parent
736adcccad
commit
a7c15e6c91
@ -2,7 +2,6 @@ package statuskeycardgo
|
||||
|
||||
import (
|
||||
"crypto/sha512"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ebfe/scard"
|
||||
@ -224,8 +223,19 @@ func (kc *keycardContext) verifyPin(pin string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (kc *keycardContext) unblockPIN(puk string, newPin string) error {
|
||||
return errors.New("not implemented yet")
|
||||
func (kc *keycardContext) unblockPIN(puk string, newPIN string) error {
|
||||
<-kc.connected
|
||||
if kc.runErr != nil {
|
||||
return kc.runErr
|
||||
}
|
||||
|
||||
err := kc.cmdSet.UnblockPIN(puk, newPIN)
|
||||
if err != nil {
|
||||
l("unblockPIN failed %+v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (kc *keycardContext) generateKey() ([]byte, error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user