diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-06-04 07:28:19 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-06-17 20:47:39 +0200 |
commit | c8f69207e6d5fb654814833676f5f786084a8576 (patch) | |
tree | 229f8e227af42111adc988015112707330f530d8 /ncr-storage.c | |
parent | f3146e2631f23c80e9ce43cbff33b294cab9f535 (diff) | |
download | cryptodev-linux-c8f69207e6d5fb654814833676f5f786084a8576.tar.gz cryptodev-linux-c8f69207e6d5fb654814833676f5f786084a8576.tar.xz cryptodev-linux-c8f69207e6d5fb654814833676f5f786084a8576.zip |
Some updates in the server approach (not working yet).
Diffstat (limited to 'ncr-storage.c')
-rw-r--r-- | ncr-storage.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ncr-storage.c b/ncr-storage.c index 15df0de..d19a44f 100644 --- a/ncr-storage.c +++ b/ncr-storage.c @@ -25,6 +25,8 @@ #include <asm/uaccess.h> #include <asm/ioctl.h> #include <linux/scatterlist.h> +#include <linux/file.h> +#include <linux/cred.h> #include <linux/version.h> #include "ncr.h" #include "ncr_int.h" @@ -39,12 +41,13 @@ int _ncr_key_to_store(const struct key_item_st *key, const char* label, uid_t uid = key->filp->f_uid; gid_t gid = key->filp->f_gid; #else - gid_t gid = key->filp->f_cred->fsgid; + uid_t uid = key->filp->f_cred->fsuid; gid_t gid = key->filp->f_cred->fsgid; #endif /* copy metadata first */ memcpy(output->key_id, key->key_id, sizeof(output->key_id)); output->key_id_size = key->key_id_size; + output->flags = key->flags; output->algorithm = key->algorithm; output->type = key->type; @@ -79,6 +82,7 @@ int _ncr_store_to_key(const struct storage_item_st* raw, struct key_item_st *key key->algorithm = raw->algorithm; key->type = raw->type; + key->flags = raw->flags; switch(key->type) { case NCR_KEY_TYPE_SECRET: @@ -120,6 +124,7 @@ int ncr_storage_store(struct list_sem_st* key_lst, void __user* arg) ret = _ncr_store(&tostore); if (ret < 0) { + printk("cryptodev: Cannot store. Is ncr-server running?\n"); err(); goto fail; } @@ -154,7 +159,7 @@ int ncr_storage_load(struct list_sem_st* key_lst, void __user* arg) uid = key->filp->f_uid; gid = key->filp->f_gid; #else - gid = key->filp->f_cred->fsgid; + uid = key->filp->f_cred->fsuid; gid = key->filp->f_cred->fsgid; #endif |