add Installed to CashApplicationInfo

This commit is contained in:
Andrea Franz 2019-11-19 12:38:41 +01:00
parent 8c2d13ba90
commit 66a0a082fe
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
2 changed files with 5 additions and 2 deletions

View File

@ -14,7 +14,8 @@ type CashCommandSet struct {
func NewCashCommandSet(c types.Channel) *CashCommandSet {
return &CashCommandSet{
c: c,
c: c,
CashApplicationInfo: &types.CashApplicationInfo{},
}
}
@ -23,7 +24,6 @@ func (cs *CashCommandSet) Select() error {
cmd.SetLe(0)
resp, err := cs.c.Send(cmd)
if err = cs.checkOK(resp, err); err != nil {
cs.CashApplicationInfo = &types.CashApplicationInfo{}
return err
}

View File

@ -3,6 +3,7 @@ package types
import "github.com/status-im/keycard-go/apdu"
type CashApplicationInfo struct {
Installed bool
PublicKey []byte
PublicKeyData []byte
Version []byte
@ -15,6 +16,8 @@ func ParseCashApplicationInfo(data []byte) (*CashApplicationInfo, error) {
return nil, ErrWrongApplicationInfoTemplate
}
info.Installed = true
pubKey, err := apdu.FindTag(data, apdu.Tag{TagApplicationInfoTemplate}, apdu.Tag{0x80})
if err != nil {
return nil, err