From bed43d4049c054a4f3c1a5030bab28c308e7a021 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Sat, 15 Oct 2016 19:28:57 +0900 Subject: [PATCH] Add tests/ accessing DO 6E --- tests/test_empty_card.py | 7 +++++++ tests/test_personalize_card.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tests/test_empty_card.py b/tests/test_empty_card.py index 72a63ad..e0c7c3a 100644 --- a/tests/test_empty_card.py +++ b/tests/test_empty_card.py @@ -59,6 +59,13 @@ def test_name_lang_sex(card): name_lang_sex = get_data_object(card, 0x65) assert name_lang_sex == b'' or name_lang_sex == expected +def test_app_data(card): + app_data = get_data_object(card, 0x6e) + hist_len = app_data[20] + # FIXME: parse and check DO of C0, C1, C2, C3, C4, and C6 + assert app_data[0:8] == b"\x4f\x10\xd2\x76\x00\x01\x24\x01" and \ + app_data[18:18+2] == b"\x5f\x52" + def test_url(card): url = get_data_object(card, 0x5f50) assert check_null(url) diff --git a/tests/test_personalize_card.py b/tests/test_personalize_card.py index 0f1a251..c22af93 100644 --- a/tests/test_personalize_card.py +++ b/tests/test_personalize_card.py @@ -144,6 +144,13 @@ def test_pw1_status(card): s = get_data_object(card, 0xc4) assert match(b'\x01...\x03[\x00\x03]\x03', s, DOTALL) +def test_app_data(card): + app_data = get_data_object(card, 0x6e) + hist_len = app_data[20] + # FIXME: parse and check DO of C0, C1, C2, C3, C4, and C6 + assert app_data[0:8] == b"\x4f\x10\xd2\x76\x00\x01\x24\x01" and \ + app_data[18:18+2] == b"\x5f\x52" + def test_public_key_1(card): pk = card.cmd_get_public_key(1) assert rsa_keys.key[0][0] == pk[9:9+256]