diff options
author | Guillaume Ballet <gballet@gmail.com> | 2019-03-20 06:14:31 +0800 |
---|---|---|
committer | Guillaume Ballet <gballet@gmail.com> | 2019-04-08 19:21:22 +0800 |
commit | 7ec6fa03d3530bc968eab2fc5aa2a80779d30a64 (patch) | |
tree | 446850062a0cf64b57a9f23b251b772a2b7f91f3 /accounts | |
parent | 42c76a2ba190c4ffecb2a3bfc33757c4228d85d6 (diff) | |
download | go-tangerine-7ec6fa03d3530bc968eab2fc5aa2a80779d30a64.tar go-tangerine-7ec6fa03d3530bc968eab2fc5aa2a80779d30a64.tar.gz go-tangerine-7ec6fa03d3530bc968eab2fc5aa2a80779d30a64.tar.bz2 go-tangerine-7ec6fa03d3530bc968eab2fc5aa2a80779d30a64.tar.lz go-tangerine-7ec6fa03d3530bc968eab2fc5aa2a80779d30a64.tar.xz go-tangerine-7ec6fa03d3530bc968eab2fc5aa2a80779d30a64.tar.zst go-tangerine-7ec6fa03d3530bc968eab2fc5aa2a80779d30a64.zip |
fix wallet status update
This is a temporary fix, better checks need to
be performed once the whole process has been
validated.
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/scwallet/wallet.go | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/accounts/scwallet/wallet.go b/accounts/scwallet/wallet.go index 0b2d12184..b51c281d8 100644 --- a/accounts/scwallet/wallet.go +++ b/accounts/scwallet/wallet.go @@ -81,23 +81,26 @@ const ( sw1GetResponse = 0x61 sw1Ok = 0x90 - insVerifyPin = 0x20 - insUnblockPin = 0x22 - insExportKey = 0xC2 - insSign = 0xC0 - insLoadKey = 0xD0 - insDeriveKey = 0xD1 - insStatus = 0xF2 - deriveP1Assisted = uint8(0x01) - deriveP1Append = uint8(0x80) - deriveP2KeyPath = uint8(0x00) - deriveP2PublicKey = uint8(0x01) - statusP1WalletStatus = uint8(0x00) - statusP1Path = uint8(0x01) - signP1PrecomputedHash = uint8(0x01) - signP2OnlyBlock = uint8(0x81) - exportP1Any = uint8(0x00) - exportP2Pubkey = uint8(0x01) + insVerifyPin = 0x20 + insUnblockPin = 0x22 + insExportKey = 0xC2 + insSign = 0xC0 + insLoadKey = 0xD0 + insDeriveKey = 0xD1 + insStatus = 0xF2 + P1DeriveKeyFromMaster = uint8(0x00) + P1DeriveKeyFromParent = uint8(0x01) + P1DeriveKeyFromCurrent = uint8(0x10) + deriveP1Assisted = uint8(0x01) + deriveP1Append = uint8(0x80) + deriveP2KeyPath = uint8(0x00) + deriveP2PublicKey = uint8(0x01) + statusP1WalletStatus = uint8(0x00) + statusP1Path = uint8(0x01) + signP1PrecomputedHash = uint8(0x01) + signP2OnlyBlock = uint8(0x81) + exportP1Any = uint8(0x00) + exportP2Pubkey = uint8(0x01) // Minimum time to wait between self derivation attempts, even it the user is // requesting accounts like crazy. @@ -859,11 +862,11 @@ func (s *Session) walletStatus() (*walletStatus, error) { if response.Data[2] != 2 || response.Data[3] != 1 || response.Data[5] != 2 || response.Data[6] != 1 || response.Data[8] != 1 || response.Data[9] != 1 { return nil, fmt.Errorf("invalid response tag format") } - fmt.Println("asn1 response", response) status := &walletStatus{ - PinRetryCount: int(response.Data[4]), - PukRetryCount: int(response.Data[7]), - Initialized: (response.Data[10] == 0xff), + PinRetryCount: int(response.Data[4]), + PukRetryCount: int(response.Data[7]), + Initialized: (response.Data[10] == 0xff), + SupportsPKDerivation: true, /* Cards that don't aren't supported */ } /* |