mirror of
https://github.com/status-im/status-keycard-go.git
synced 2025-01-18 18:31:56 +00:00
implement unpair flow
This commit is contained in:
parent
2b84b6560a
commit
27bf041c5e
11
flow.go
11
flow.go
@ -237,5 +237,14 @@ func (f *KeycardFlow) unpairThisFlow(kc *keycardContext) (FlowStatus, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, errors.New("not yet implemented")
|
||||
err = kc.unpairCurrent()
|
||||
|
||||
if isSCardError(err) {
|
||||
return nil, restartErr()
|
||||
} else if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
f.cardInfo.freeSlots++
|
||||
return FlowStatus{InstanceUID: f.cardInfo.instanceUID, FreeSlots: f.cardInfo.freeSlots}, err
|
||||
}
|
||||
|
@ -360,6 +360,10 @@ func (kc *keycardContext) unpair(index uint8) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (kc *keycardContext) unpairCurrent() error {
|
||||
return kc.unpair(uint8(kc.cmdSet.PairingInfo.Index))
|
||||
}
|
||||
|
||||
func (kc *keycardContext) getStatusApplication() (*types.ApplicationStatus, error) {
|
||||
<-kc.connected
|
||||
if kc.runErr != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user