use NewCommandSelect

This commit is contained in:
Andrea Franz 2019-04-17 12:24:02 +02:00
parent 8adf2b6627
commit 744a584d51
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
3 changed files with 2 additions and 20 deletions

View File

@ -41,14 +41,7 @@ func (cs *CommandSet) Select() error {
return err
}
cmd := apdu.NewCommand(
0x00,
globalplatform.InsSelect,
uint8(0x04),
uint8(0x00),
instanceAID,
)
cmd := globalplatform.NewCommandSelect(instanceAID)
cmd.SetLe(0)
resp, err := cs.c.Send(cmd)
if err = cs.checkOK(resp, err); err != nil {

View File

@ -31,14 +31,7 @@ func (cs *CommandSet) Select() error {
}
func (cs *CommandSet) SelectAID(aid []byte) error {
cmd := apdu.NewCommand(
0x00,
InsSelect,
uint8(0x04),
uint8(0x00),
aid,
)
cmd := NewCommandSelect(aid)
cmd.SetLe(0)
resp, err := cs.c.Send(cmd)

View File

@ -56,10 +56,6 @@ func NewCommandSelect(aid []byte) *apdu.Command {
aid,
)
// with T=0 we can both set or not the Le value
// with T=1 it works only without Le
// c.SetLe(0x00)
return c
}