PK derivation has to be supported by the card
This commit is contained in:
parent
2625057fe3
commit
bcf3c52ac9
|
@ -321,10 +321,8 @@ func (w *Wallet) Status() (string, error) {
|
||||||
return fmt.Sprintf("Locked, waiting for PIN (%d attempts left)", status.PinRetryCount), nil
|
return fmt.Sprintf("Locked, waiting for PIN (%d attempts left)", status.PinRetryCount), nil
|
||||||
case !status.Initialized:
|
case !status.Initialized:
|
||||||
return fmt.Sprintf("Empty, waiting for initialization"), nil
|
return fmt.Sprintf("Empty, waiting for initialization"), nil
|
||||||
case status.SupportsPKDerivation:
|
|
||||||
return fmt.Sprintf("Online, can derive public keys"), nil
|
|
||||||
default:
|
default:
|
||||||
return fmt.Sprintf("Online, cannot derive public keys"), nil
|
return fmt.Sprintf("Online"), nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -847,7 +845,6 @@ type walletStatus struct {
|
||||||
PinRetryCount int // Number of remaining PIN retries
|
PinRetryCount int // Number of remaining PIN retries
|
||||||
PukRetryCount int // Number of remaining PUK retries
|
PukRetryCount int // Number of remaining PUK retries
|
||||||
Initialized bool // Whether the card has been initialized with a private key
|
Initialized bool // Whether the card has been initialized with a private key
|
||||||
SupportsPKDerivation bool // Whether the card supports doing public key derivation itself
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// walletStatus fetches the wallet's status from the card.
|
// walletStatus fetches the wallet's status from the card.
|
||||||
|
@ -872,7 +869,6 @@ func (s *Session) walletStatus() (*walletStatus, error) {
|
||||||
PinRetryCount: int(response.Data[4]),
|
PinRetryCount: int(response.Data[4]),
|
||||||
PukRetryCount: int(response.Data[7]),
|
PukRetryCount: int(response.Data[7]),
|
||||||
Initialized: (response.Data[10] == 0xff),
|
Initialized: (response.Data[10] == 0xff),
|
||||||
SupportsPKDerivation: true, /* Cards that don't aren't supported */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue