Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283250
b: refs/heads/master
c: 88d7ed3
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Kasatkin authored and James Morris committed Dec 7, 2011
1 parent 575ee1d commit c042e09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe0e94c5a7e5335ba0d200e7d3e26e9f80cda4b1
refs/heads/master: 88d7ed35085184f15a2af3d9e88d775059b2f307
15 changes: 8 additions & 7 deletions trunk/security/integrity/evm/evm_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ static struct shash_desc *init_desc(const char type)
*tfm = NULL;
return ERR_PTR(rc);
}
if (type == EVM_XATTR_HMAC) {
rc = crypto_shash_setkey(*tfm, evmkey, evmkey_len);
if (rc) {
crypto_free_shash(*tfm);
*tfm = NULL;
return ERR_PTR(rc);
}
}
}

desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(*tfm),
Expand All @@ -62,14 +70,7 @@ static struct shash_desc *init_desc(const char type)
desc->tfm = *tfm;
desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;

if (type == EVM_XATTR_HMAC) {
rc = crypto_shash_setkey(*tfm, evmkey, evmkey_len);
if (rc)
goto out;
}

rc = crypto_shash_init(desc);
out:
if (rc) {
kfree(desc);
return ERR_PTR(rc);
Expand Down

0 comments on commit c042e09

Please sign in to comment.