Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264554
b: refs/heads/master
c: 2b3ff63
h: refs/heads/master
v: v3
  • Loading branch information
Mimi Zohar committed Sep 21, 2011
1 parent f18b9b0 commit aac63f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: 2684bf7f29cfb13ef2c60f3b3a53ee47d0db7022
refs/heads/master: 2b3ff6319e2312656fbefe0209bef02d58b6836a
14 changes: 11 additions & 3 deletions trunk/security/keys/encrypted-keys/encrypted.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,11 +667,19 @@ static int encrypted_key_decrypt(struct encrypted_key_payload *epayload,
return -EINVAL;

hex_encoded_data = hex_encoded_iv + (2 * ivsize) + 2;
hex2bin(epayload->iv, hex_encoded_iv, ivsize);
hex2bin(epayload->encrypted_data, hex_encoded_data, encrypted_datalen);
ret = hex2bin(epayload->iv, hex_encoded_iv, ivsize);
if (ret < 0)
return -EINVAL;
ret = hex2bin(epayload->encrypted_data, hex_encoded_data,
encrypted_datalen);
if (ret < 0)
return -EINVAL;

hmac = epayload->format + epayload->datablob_len;
hex2bin(hmac, hex_encoded_data + (encrypted_datalen * 2), HASH_SIZE);
ret = hex2bin(hmac, hex_encoded_data + (encrypted_datalen * 2),
HASH_SIZE);
if (ret < 0)
return -EINVAL;

mkey = request_master_key(epayload, &master_key, &master_keylen);
if (IS_ERR(mkey))
Expand Down

0 comments on commit aac63f9

Please sign in to comment.