aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
Diffstat (limited to 'security')
-rw-r--r--security/keys/encrypted-keys/encrypted.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
index 3f577954b85a..f33804c1b4c8 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -667,11 +667,19 @@ static int encrypted_key_decrypt(struct encrypted_key_payload *epayload,
667 return -EINVAL; 667 return -EINVAL;
668 668
669 hex_encoded_data = hex_encoded_iv + (2 * ivsize) + 2; 669 hex_encoded_data = hex_encoded_iv + (2 * ivsize) + 2;
670 hex2bin(epayload->iv, hex_encoded_iv, ivsize); 670 ret = hex2bin(epayload->iv, hex_encoded_iv, ivsize);
671 hex2bin(epayload->encrypted_data, hex_encoded_data, encrypted_datalen); 671 if (ret < 0)
672 return -EINVAL;
673 ret = hex2bin(epayload->encrypted_data, hex_encoded_data,
674 encrypted_datalen);
675 if (ret < 0)
676 return -EINVAL;
672 677
673 hmac = epayload->format + epayload->datablob_len; 678 hmac = epayload->format + epayload->datablob_len;
674 hex2bin(hmac, hex_encoded_data + (encrypted_datalen * 2), HASH_SIZE); 679 ret = hex2bin(hmac, hex_encoded_data + (encrypted_datalen * 2),
680 HASH_SIZE);
681 if (ret < 0)
682 return -EINVAL;
675 683
676 mkey = request_master_key(epayload, &master_key, &master_keylen); 684 mkey = request_master_key(epayload, &master_key, &master_keylen);
677 if (IS_ERR(mkey)) 685 if (IS_ERR(mkey))