aboutsummaryrefslogtreecommitdiffstats
path: root/security/integrity/evm/evm_crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/integrity/evm/evm_crypto.c')
-rw-r--r--security/integrity/evm/evm_crypto.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
index e11564eb645b..82a38e801ee4 100644
--- a/security/integrity/evm/evm_crypto.c
+++ b/security/integrity/evm/evm_crypto.c
@@ -89,6 +89,9 @@ static struct shash_desc *init_desc(char type, uint8_t hash_algo)
89 tfm = &hmac_tfm; 89 tfm = &hmac_tfm;
90 algo = evm_hmac; 90 algo = evm_hmac;
91 } else { 91 } else {
92 if (hash_algo >= HASH_ALGO__LAST)
93 return ERR_PTR(-EINVAL);
94
92 tfm = &evm_tfm[hash_algo]; 95 tfm = &evm_tfm[hash_algo];
93 algo = hash_algo_name[hash_algo]; 96 algo = hash_algo_name[hash_algo];
94 } 97 }