aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2024-02-04 15:38:12 +0100
committerHarald Welte <laforge@osmocom.org>2024-02-04 21:27:00 +0100
commitcd8e16fdfec03b4124e5087930b4dc7cdb668826 (patch)
tree370ca9f6316379f69d7df00df31de9c89c4be361 /tests
parente55fcf66bf9d5f92dd74858555090767a433e8f8 (diff)
global_platform: KCV support for PUT KEY
GlobalPlatform requires the use of the KCV for DES + AES keys. Let's implement that. (11.8.2.3.3: "For all key types described in section B.6, the Key Check Value shall be present.") Change-Id: Ief168a66dee58b56f4126db12829b3a98906c8db
Diffstat (limited to 'tests')
-rw-r--r--tests/test_globalplatform.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_globalplatform.py b/tests/test_globalplatform.py
index 8496018..ba4ad76 100644
--- a/tests/test_globalplatform.py
+++ b/tests/test_globalplatform.py
@@ -214,6 +214,12 @@ class SCP03_Test_AES256_33(SCP03_Test, unittest.TestCase):
# FIXME: test auth with random (0x60) vs pseudo-random (0x70) challenge
+class SCP03_KCV_Test(unittest.TestCase):
+ def test_kcv(self):
+ self.assertEqual(compute_kcv('aes', KEYSET_AES128.enc), h2b('C35280'))
+ self.assertEqual(compute_kcv('aes', KEYSET_AES128.mac), h2b('013808'))
+ self.assertEqual(compute_kcv('aes', KEYSET_AES128.dek), h2b('840DE5'))
+
if __name__ == "__main__":
unittest.main()