summaryrefslogtreecommitdiffstats
path: root/ncr-key-wrap.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-16 17:18:10 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-24 23:46:27 +0200
commite536df1a394cf653ecc5964ece0551b0259abeb4 (patch)
tree3cad0c282d08b0616f34eb01199b3d3277d06621 /ncr-key-wrap.c
parent2039b544b32e37bb4aea4ed06ac9ef905f656326 (diff)
downloadkernel-crypto-e536df1a394cf653ecc5964ece0551b0259abeb4.tar.gz
kernel-crypto-e536df1a394cf653ecc5964ece0551b0259abeb4.tar.xz
kernel-crypto-e536df1a394cf653ecc5964ece0551b0259abeb4.zip
Convert *_KEY_STORAGE_UNWRAP
Diffstat (limited to 'ncr-key-wrap.c')
-rw-r--r--ncr-key-wrap.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/ncr-key-wrap.c b/ncr-key-wrap.c
index 1da90f5cbda..de4bcdd5ff4 100644
--- a/ncr-key-wrap.c
+++ b/ncr-key-wrap.c
@@ -763,12 +763,10 @@ fail:
return ret;
}
-/* Unwraps keys. All keys unwrapped are not accessible by
- * userspace.
- */
-int ncr_key_storage_unwrap(struct ncr_lists *lst, void __user* arg)
+int ncr_key_storage_unwrap(struct ncr_lists *lst,
+ const struct ncr_key_storage_unwrap *wrap,
+ struct nlattr *tb[])
{
-struct ncr_key_storage_wrap_st wrap;
struct key_item_st* wkey = NULL;
void* data = NULL;
uint8_t * sdata = NULL;
@@ -780,18 +778,13 @@ int ret;
return -ENOKEY;
}
- if (unlikely(copy_from_user(&wrap, arg, sizeof(wrap)))) {
- err();
- return -EFAULT;
- }
-
- ret = ncr_key_item_get_write( &wkey, lst, wrap.keytowrap);
+ ret = ncr_key_item_get_write(&wkey, lst, wrap->key);
if (ret < 0) {
err();
return ret;
}
- data_size = wrap.io_size;
+ data_size = wrap->data_size;
data = kmalloc(data_size, GFP_KERNEL);
if (data == NULL) {
err();
@@ -799,7 +792,7 @@ int ret;
goto fail;
}
- if (unlikely(copy_from_user(data, wrap.io, data_size))) {
+ if (unlikely(copy_from_user(data, wrap->data, data_size))) {
err();
ret = -EFAULT;
goto fail;