fix commands to work with both T=0 and T=1

This commit is contained in:
Andrea Franz 2018-10-04 09:46:45 +02:00
parent e80f686c96
commit ec500a3ab6
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D

View File

@ -45,19 +45,27 @@ func NewCommandSelect(aid []byte) *apdu.Command {
aid,
)
c.SetLe(0x00)
// 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
}
func NewCommandInitializeUpdate(challenge []byte) *apdu.Command {
return apdu.NewCommand(
c := apdu.NewCommand(
ClaGp,
InsInitializeUpdate,
uint8(0x00),
uint8(0x00),
challenge,
)
// with T=0 we can both set or not the Le value
// with T=1 it works only if Le is set
c.SetLe(0x00)
return c
}
func NewCommandExternalAuthenticate(encKey, cardChallenge, hostChallenge []byte) (*apdu.Command, error) {