fix tests
This commit is contained in:
parent
526d2eaade
commit
2e910d9bb4
|
@ -10,7 +10,7 @@ import (
|
||||||
|
|
||||||
func TestNewSession(t *testing.T) {
|
func TestNewSession(t *testing.T) {
|
||||||
key := hexutils.HexToBytes("404142434445464748494a4b4c4d4e4f")
|
key := hexutils.HexToBytes("404142434445464748494a4b4c4d4e4f")
|
||||||
keys := NewKeyProvider(key, key)
|
keys := NewSCP02Keys(key, key)
|
||||||
|
|
||||||
raw := hexutils.HexToBytes("000002650183039536622002000de9c62ba1c4c8e55fcb91b6654ce49000")
|
raw := hexutils.HexToBytes("000002650183039536622002000de9c62ba1c4c8e55fcb91b6654ce49000")
|
||||||
resp, err := apdu.ParseResponse(raw)
|
resp, err := apdu.ParseResponse(raw)
|
||||||
|
@ -25,19 +25,19 @@ func TestNewSession_BadResponse(t *testing.T) {
|
||||||
raw := hexutils.HexToBytes("01026982")
|
raw := hexutils.HexToBytes("01026982")
|
||||||
resp, err := apdu.ParseResponse(raw)
|
resp, err := apdu.ParseResponse(raw)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
_, err = NewSession(&KeyProvider{}, resp, []byte{})
|
_, err = NewSession(&SCP02Keys{}, resp, []byte{})
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
|
|
||||||
raw = hexutils.HexToBytes("01026983")
|
raw = hexutils.HexToBytes("01026983")
|
||||||
resp, err = apdu.ParseResponse(raw)
|
resp, err = apdu.ParseResponse(raw)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
_, err = NewSession(&KeyProvider{}, resp, []byte{})
|
_, err = NewSession(&SCP02Keys{}, resp, []byte{})
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
|
|
||||||
// bad data length
|
// bad data length
|
||||||
raw = hexutils.HexToBytes("01029000")
|
raw = hexutils.HexToBytes("01029000")
|
||||||
resp, err = apdu.ParseResponse(raw)
|
resp, err = apdu.ParseResponse(raw)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
_, err = NewSession(&KeyProvider{}, resp, []byte{})
|
_, err = NewSession(&SCP02Keys{}, resp, []byte{})
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ func TestSecureChannel_Send(t *testing.T) {
|
||||||
encKey: hexutils.HexToBytes("FDBCB1637597CF3F8F5E8263007D4E45F64C12D44066D4576EB1443D60AEF441"),
|
encKey: hexutils.HexToBytes("FDBCB1637597CF3F8F5E8263007D4E45F64C12D44066D4576EB1443D60AEF441"),
|
||||||
macKey: hexutils.HexToBytes("2FB70219E6635EE0958AB3F7A428BA87E8CD6E6F873A5725A55F25B102D0F1F7"),
|
macKey: hexutils.HexToBytes("2FB70219E6635EE0958AB3F7A428BA87E8CD6E6F873A5725A55F25B102D0F1F7"),
|
||||||
iv: hexutils.HexToBytes("627E64358FA9BDCDAD4442BD8006E0A5"),
|
iv: hexutils.HexToBytes("627E64358FA9BDCDAD4442BD8006E0A5"),
|
||||||
|
open: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
data := hexutils.HexToBytes("D545A5E95963B6BCED86A6AE826D34C5E06AC64A1217EFFA1415A96674A82500")
|
data := hexutils.HexToBytes("D545A5E95963B6BCED86A6AE826D34C5E06AC64A1217EFFA1415A96674A82500")
|
||||||
|
|
Loading…
Reference in New Issue