mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
certs: Add wrapper function to check blacklisted binary hash
[ Upstream commit 2434f7d2d488c3301ae81f1031e1c66c6f076fb7 ] The -EKEYREJECTED error returned by existing is_hash_blacklisted() is misleading when called for checking against blacklisted hash of a binary. This patch adds a wrapper function is_binary_blacklisted() to return -EPERM error if binary is blacklisted. Signed-off-by: Nayna Jain <[email protected]> Reviewed-by: Mimi Zohar <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
61168eafe0
commit
ac7d3f5544
2 changed files with 15 additions and 0 deletions
|
|
@ -135,6 +135,15 @@ int is_hash_blacklisted(const u8 *hash, size_t hash_len, const char *type)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(is_hash_blacklisted);
|
||||
|
||||
int is_binary_blacklisted(const u8 *hash, size_t hash_len)
|
||||
{
|
||||
if (is_hash_blacklisted(hash, hash_len, "bin") == -EKEYREJECTED)
|
||||
return -EPERM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(is_binary_blacklisted);
|
||||
|
||||
/*
|
||||
* Initialise the blacklist
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue