From 2e910d9bb4dd8289b9f6411c8f7b53b61f265c27 Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Wed, 13 Mar 2019 16:33:02 +0100 Subject: [PATCH] fix tests --- globalplatform/session_test.go | 8 ++++---- secure_channel_test.go | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/globalplatform/session_test.go b/globalplatform/session_test.go index 85f6b65..4cfa99c 100644 --- a/globalplatform/session_test.go +++ b/globalplatform/session_test.go @@ -10,7 +10,7 @@ import ( func TestNewSession(t *testing.T) { key := hexutils.HexToBytes("404142434445464748494a4b4c4d4e4f") - keys := NewKeyProvider(key, key) + keys := NewSCP02Keys(key, key) raw := hexutils.HexToBytes("000002650183039536622002000de9c62ba1c4c8e55fcb91b6654ce49000") resp, err := apdu.ParseResponse(raw) @@ -25,19 +25,19 @@ func TestNewSession_BadResponse(t *testing.T) { raw := hexutils.HexToBytes("01026982") resp, err := apdu.ParseResponse(raw) assert.NoError(t, err) - _, err = NewSession(&KeyProvider{}, resp, []byte{}) + _, err = NewSession(&SCP02Keys{}, resp, []byte{}) assert.Error(t, err) raw = hexutils.HexToBytes("01026983") resp, err = apdu.ParseResponse(raw) assert.NoError(t, err) - _, err = NewSession(&KeyProvider{}, resp, []byte{}) + _, err = NewSession(&SCP02Keys{}, resp, []byte{}) assert.Error(t, err) // bad data length raw = hexutils.HexToBytes("01029000") resp, err = apdu.ParseResponse(raw) assert.NoError(t, err) - _, err = NewSession(&KeyProvider{}, resp, []byte{}) + _, err = NewSession(&SCP02Keys{}, resp, []byte{}) assert.Error(t, err) } diff --git a/secure_channel_test.go b/secure_channel_test.go index 2408ec7..b4d040e 100644 --- a/secure_channel_test.go +++ b/secure_channel_test.go @@ -25,6 +25,7 @@ func TestSecureChannel_Send(t *testing.T) { encKey: hexutils.HexToBytes("FDBCB1637597CF3F8F5E8263007D4E45F64C12D44066D4576EB1443D60AEF441"), macKey: hexutils.HexToBytes("2FB70219E6635EE0958AB3F7A428BA87E8CD6E6F873A5725A55F25B102D0F1F7"), iv: hexutils.HexToBytes("627E64358FA9BDCDAD4442BD8006E0A5"), + open: true, } data := hexutils.HexToBytes("D545A5E95963B6BCED86A6AE826D34C5E06AC64A1217EFFA1415A96674A82500")