diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-08-05 23:37:09 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-08-24 20:58:31 +0200 |
commit | b75983ac4d081721b82defb3445972c396570dd0 (patch) | |
tree | c45f8088d2c65e20594968e39aa6021e2fe61ed1 | |
parent | a39580dfe8f7026a964e3665fc770e36a73ed576 (diff) | |
download | cryptodev-linux-b75983ac4d081721b82defb3445972c396570dd0.tar.gz cryptodev-linux-b75983ac4d081721b82defb3445972c396570dd0.tar.xz cryptodev-linux-b75983ac4d081721b82defb3445972c396570dd0.zip |
Use the correct wrapping key
... as specified in the RFC3394 test vector in section 4.1.
-rw-r--r-- | examples/ncr_lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/ncr_lib.c b/examples/ncr_lib.c index 111f89b..26c94c6 100644 --- a/examples/ncr_lib.c +++ b/examples/ncr_lib.c @@ -140,7 +140,7 @@ test_ncr_wrap_key(void) fprintf(stdout, "\tKey Wrap test...\n"); DIAGNOSTIC_CALL(ncr_key_init, &key); /* import into a key */ - DIAGNOSTIC_CALL(ncr_key_import, key, DKEY, 16, "ab", 2, NCR_ALG_AES_CBC, NCR_KEY_TYPE_SECRET, NCR_KEY_FLAG_EXPORTABLE|NCR_KEY_FLAG_WRAPPABLE); + DIAGNOSTIC_CALL(ncr_key_import, key, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", 16, "ab", 2, NCR_ALG_AES_CBC, NCR_KEY_TYPE_SECRET, NCR_KEY_FLAG_EXPORTABLE|NCR_KEY_FLAG_WRAPPABLE); DIAGNOSTIC_CALL(ncr_key_init, &key2); /* import into a key2 */ DIAGNOSTIC_CALL(ncr_key_import, key2, DKEY, 16, "ba", 2, NCR_ALG_AES_CBC, NCR_KEY_TYPE_SECRET, NCR_KEY_FLAG_EXPORTABLE|NCR_KEY_FLAG_WRAPPABLE); @@ -149,7 +149,7 @@ test_ncr_wrap_key(void) if (output_size != 24 || memcmp(data, "\x1F\xA6\x8B\x0A\x81\x12\xB4\x47\xAE\xF3\x4B\xD8\xFB\x5A\x7B\x82\x9D\x3E\x86\x23\x71\xD2\xCF\xE5", 24) != 0) { DIAGNOSTIC_ERROR("Wrapped data do not match.\nData[%d]: ", (int) output_size); DIAGNOSTIC_DUMP(data, output_size); -// return 1; + return 1; } DIAGNOSTIC_CALL(ncr_key_deinit, key2); /* test unwrapping */ |