diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-08-27 07:46:15 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-08-27 07:46:15 +0200 |
commit | 9f0a6ce7f41043dad38b272cd6ad165f98827b8b (patch) | |
tree | 909f5dcc886a1ad32ab0a00bc0455c566e1037c2 /ncr-key.c | |
parent | c07dc584248074d16c371d2a478bc23520bef69f (diff) | |
parent | 1f30d575e5b413e522d6b3e95d3e348df9e9c69e (diff) | |
download | cryptodev-linux-9f0a6ce7f41043dad38b272cd6ad165f98827b8b.tar.gz cryptodev-linux-9f0a6ce7f41043dad38b272cd6ad165f98827b8b.tar.xz cryptodev-linux-9f0a6ce7f41043dad38b272cd6ad165f98827b8b.zip |
Merge remote branch 'origin/newapi'
Conflicts:
examples/ncr.c
examples/pk.c
ncr-key-wrap.c
ncr-key.c
ncr.h
Diffstat (limited to 'ncr-key.c')
-rw-r--r-- | ncr-key.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -294,7 +294,8 @@ int ncr_key_update_flags(struct key_item_st* item, const struct nlattr *nla) if (nla == NULL) return 0; flags = nla_get_u32(nla); - if (!capable(CAP_SYS_ADMIN) && (flags & NCR_KEY_FLAG_WRAPPING) != 0) + if (!capable(CAP_SYS_ADMIN) + && (flags & (NCR_KEY_FLAG_WRAPPING | NCR_KEY_FLAG_UNWRAPPING)) != 0) return -EPERM; item->flags = flags; return 0; @@ -743,7 +744,7 @@ struct key_item_st* newkey = NULL; /* wrapping keys cannot be used for anything except wrapping. */ - if (key->flags & NCR_KEY_FLAG_WRAPPING) { + if (key->flags & NCR_KEY_FLAG_WRAPPING || key->flags & NCR_KEY_FLAG_UNWRAPPING) { err(); ret = -EINVAL; goto fail; |