summaryrefslogtreecommitdiffstats
path: root/ncr-key-wrap.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-25 00:53:56 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-25 00:53:56 +0200
commit6db12e213dfd6793203c9875e6765c7d27f3dd1f (patch)
treefcef75a8eae888bdbb19c5fad90f4fb42c5e000b /ncr-key-wrap.c
parent5ec167e240a8002bba3cc37e22553c888c7d4133 (diff)
downloadcryptodev-linux-6db12e213dfd6793203c9875e6765c7d27f3dd1f.tar.gz
cryptodev-linux-6db12e213dfd6793203c9875e6765c7d27f3dd1f.tar.xz
cryptodev-linux-6db12e213dfd6793203c9875e6765c7d27f3dd1f.zip
Simplify key flag updates
Diffstat (limited to 'ncr-key-wrap.c')
-rw-r--r--ncr-key-wrap.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/ncr-key-wrap.c b/ncr-key-wrap.c
index c409bb9..8ca23b8 100644
--- a/ncr-key-wrap.c
+++ b/ncr-key-wrap.c
@@ -471,13 +471,10 @@ const uint8_t *iv;
goto cleanup;
}
- nla = tb[NCR_ATTR_KEY_FLAGS];
- if (nla != NULL) {
- ret = ncr_key_assign_flags(output, nla_get_u32(nla));
- if (ret != 0) {
- err();
- goto cleanup;
- }
+ ret = ncr_key_update_flags(output, tb[NCR_ATTR_KEY_FLAGS]);
+ if (ret != 0) {
+ err();
+ goto cleanup;
}
memset(&output->key, 0, sizeof(output->key));
@@ -889,13 +886,10 @@ static int key_from_packed_data(struct nlattr *tb[], struct key_item_st *key,
}
key->type = nla_get_u32(nla);
- nla = tb[NCR_ATTR_KEY_FLAGS];
- if (nla != NULL) {
- ret = ncr_key_assign_flags(key, nla_get_u32(nla));
- if (ret != 0) {
- err();
- return ret;
- }
+ ret = ncr_key_update_flags(key, tb[NCR_ATTR_KEY_FLAGS]);
+ if (ret != 0) {
+ err();
+ return ret;
}
if (key->type == NCR_KEY_TYPE_SECRET) {