summaryrefslogtreecommitdiffstats
path: root/userspace
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-24 22:06:04 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-24 22:09:04 +0200
commitcae368dde8571a165dfba201e6ec0b5c182e66a4 (patch)
treea3672514a118be6716835b2b6bbaed25d7ad152a /userspace
parent99887dbcfffe481d19991a50811046ead8d12572 (diff)
downloadcryptodev-linux-cae368dde8571a165dfba201e6ec0b5c182e66a4.tar.gz
cryptodev-linux-cae368dde8571a165dfba201e6ec0b5c182e66a4.tar.xz
cryptodev-linux-cae368dde8571a165dfba201e6ec0b5c182e66a4.zip
Port key wrapping tests to *_lib.c
Diffstat (limited to 'userspace')
-rw-r--r--userspace/ncrypto.h2
-rw-r--r--userspace/ncrypto_key.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/userspace/ncrypto.h b/userspace/ncrypto.h
index 5bcb4a7..c000761 100644
--- a/userspace/ncrypto.h
+++ b/userspace/ncrypto.h
@@ -66,7 +66,7 @@ int ncr_key_get_id(ncr_key_t key, void *id, size_t *id_size);
int ncr_key_export(ncr_key_t key, void *idata, size_t idata_size);
int ncr_key_import(ncr_key_t key, void *idata, size_t idata_size, void *id, size_t id_size, ncr_algorithm_t algorithm, unsigned int type, unsigned int flags);
int ncr_key_wrap(ncr_key_t key, ncr_wrap_algorithm_t algorithm, ncr_key_params_t params, ncr_key_t keytowrap, void *idata, size_t idata_size);
-int ncr_key_unwrap(ncr_key_t key, ncr_wrap_algorithm_t algorithm, ncr_key_params_t params, ncr_key_t keytowrap, void *idata, size_t idata_size);
+int ncr_key_unwrap(ncr_key_t key, ncr_wrap_algorithm_t algorithm, ncr_key_params_t params, ncr_key_t keytowrap, void *idata, size_t idata_size, ncr_algorithm_t wrapped_algorithm, unsigned int wrapped_type, unsigned int wrapped_flags);
int ncr_key_storage_wrap(ncr_key_t keytowrap, void *idata, size_t idata_size);
int ncr_key_storage_unwrap(ncr_key_t keytowrap, void *idata, size_t idata_size);
int ncr_key_deinit(ncr_key_t key);
diff --git a/userspace/ncrypto_key.c b/userspace/ncrypto_key.c
index 66bbc96..ee3c4e4 100644
--- a/userspace/ncrypto_key.c
+++ b/userspace/ncrypto_key.c
@@ -288,7 +288,7 @@ ncr_key_wrap(ncr_key_t key, ncr_wrap_algorithm_t algorithm, ncr_key_params_t par
}
int
-ncr_key_unwrap(ncr_key_t key, ncr_wrap_algorithm_t algorithm, ncr_key_params_t params, ncr_key_t keytowrap, void *idata, size_t idata_size)
+ncr_key_unwrap(ncr_key_t key, ncr_wrap_algorithm_t algorithm, ncr_key_params_t params, ncr_key_t keytowrap, void *idata, size_t idata_size, ncr_algorithm_t wrapped_algorithm, unsigned int wrapped_type, unsigned int wrapped_flags)
{
struct ncr_key_wrap_st io;
memset(&io, 0, sizeof(io));
@@ -305,6 +305,9 @@ ncr_key_unwrap(ncr_key_t key, ncr_wrap_algorithm_t algorithm, ncr_key_params_t p
io.keytowrap = keytowrap;
io.io = idata;
io.io_size = idata_size;
+ io.wrapped_key_algorithm = wrapped_algorithm;
+ io.wrapped_key_type = wrapped_type;
+ io.wrapped_key_flags = wrapped_flags;
if (__ncr_file_descriptor < 0) {
errno = EBADF;