aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Ballet <gballet@gmail.com>2019-03-23 02:52:23 +0800
committerGuillaume Ballet <gballet@gmail.com>2019-04-08 19:21:22 +0800
commitbcf3c52ac98ad37ec2ce2c22ce1580f6c36e18fe (patch)
tree65f81137230320100723f7c0ab1d99ceebf4c261
parent2625057fe35cd3c72aa749e36a7f6d33d6dc072c (diff)
downloadgo-tangerine-bcf3c52ac98ad37ec2ce2c22ce1580f6c36e18fe.tar
go-tangerine-bcf3c52ac98ad37ec2ce2c22ce1580f6c36e18fe.tar.gz
go-tangerine-bcf3c52ac98ad37ec2ce2c22ce1580f6c36e18fe.tar.bz2
go-tangerine-bcf3c52ac98ad37ec2ce2c22ce1580f6c36e18fe.tar.lz
go-tangerine-bcf3c52ac98ad37ec2ce2c22ce1580f6c36e18fe.tar.xz
go-tangerine-bcf3c52ac98ad37ec2ce2c22ce1580f6c36e18fe.tar.zst
go-tangerine-bcf3c52ac98ad37ec2ce2c22ce1580f6c36e18fe.zip
PK derivation has to be supported by the card
-rw-r--r--accounts/scwallet/wallet.go18
1 files changed, 7 insertions, 11 deletions
diff --git a/accounts/scwallet/wallet.go b/accounts/scwallet/wallet.go
index b09700120..c0bbe20bb 100644
--- a/accounts/scwallet/wallet.go
+++ b/accounts/scwallet/wallet.go
@@ -321,10 +321,8 @@ func (w *Wallet) Status() (string, error) {
return fmt.Sprintf("Locked, waiting for PIN (%d attempts left)", status.PinRetryCount), nil
case !status.Initialized:
return fmt.Sprintf("Empty, waiting for initialization"), nil
- case status.SupportsPKDerivation:
- return fmt.Sprintf("Online, can derive public keys"), nil
default:
- return fmt.Sprintf("Online, cannot derive public keys"), nil
+ return fmt.Sprintf("Online"), nil
}
}
@@ -844,10 +842,9 @@ func (s *Session) authenticate(pairing smartcardPairing) error {
// walletStatus describes a smartcard wallet's status information.
type walletStatus struct {
- PinRetryCount int // Number of remaining PIN retries
- PukRetryCount int // Number of remaining PUK retries
- Initialized bool // Whether the card has been initialized with a private key
- SupportsPKDerivation bool // Whether the card supports doing public key derivation itself
+ PinRetryCount int // Number of remaining PIN retries
+ PukRetryCount int // Number of remaining PUK retries
+ Initialized bool // Whether the card has been initialized with a private key
}
// walletStatus fetches the wallet's status from the card.
@@ -869,10 +866,9 @@ func (s *Session) walletStatus() (*walletStatus, error) {
return nil, fmt.Errorf("invalid response tag format")
}
status := &walletStatus{
- PinRetryCount: int(response.Data[4]),
- PukRetryCount: int(response.Data[7]),
- Initialized: (response.Data[10] == 0xff),
- SupportsPKDerivation: true, /* Cards that don't aren't supported */
+ PinRetryCount: int(response.Data[4]),
+ PukRetryCount: int(response.Data[7]),
+ Initialized: (response.Data[10] == 0xff),
}
/*