diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2014-05-20 21:21:00 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2014-05-23 10:55:30 +0200 |
commit | cda1c5fd705ddd7689a924523415545ac35bd1db (patch) | |
tree | 83620207b3fb39b6b30143caff5f7dd89e48068b /tests/test_rfc6030.doctest | |
parent | e96c7466d8b82bc37c99aa6b4639433e90eb9fff (diff) |
Improve test
This tests that, before the PSKC ecnryption is key available, the secret
from the key cannot be extracted.
Diffstat (limited to 'tests/test_rfc6030.doctest')
-rw-r--r-- | tests/test_rfc6030.doctest | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_rfc6030.doctest b/tests/test_rfc6030.doctest index 4530ae1..7572814 100644 --- a/tests/test_rfc6030.doctest +++ b/tests/test_rfc6030.doctest @@ -141,15 +141,20 @@ False This tests key encryption based on pre-shared keys as illustrated in -Figure 6 from RFC6030. +Figure 6 from RFC6030. The first attempt at extracting the key will fail +due to the encryption. >>> pskc = PSKC('tests/rfc6030-figure6.pskc') +>>> key = pskc.keys[0] +>>> key.id +'12345678' +>>> key.secret is None +True >>> pskc.encryption.key_name 'Pre-shared-key' >>> pskc.encryption.key = '12345678901234567890123456789012'.decode('hex') >>> pskc.mac.key.encode('hex') '1122334455667788990011223344556677889900' ->>> key = pskc.keys[0] >>> key.secret.encode('hex') '3132333435363738393031323334353637383930' >>> key.check() |