Re: [PATCH v4 1/5] IMA: remove the dependency on CRYPTO_MD5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Simon,

On Tue, 2021-07-27 at 16:33 +0000, THOBY Simon wrote:
<snip>

> diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
> index 287b90509006..d171764230b7 100644
> --- a/security/integrity/ima/ima_main.c
> +++ b/security/integrity/ima/ima_main.c
> @@ -53,8 +53,10 @@ static int __init hash_setup(char *str)
>  	if (strcmp(template_desc->name, IMA_TEMPLATE_IMA_NAME) == 0) {
>  		if (strncmp(str, "sha1", 4) == 0) {
>  			ima_hash_algo = HASH_ALGO_SHA1;
> +#ifdef CONFIG_CRYPTO_MD5

As much as possible ifdef's should be avoided in C code.   If
necessary, using the IS_ENABLED macro is preferred.

>  		} else if (strncmp(str, "md5", 3) == 0) {
>  			ima_hash_algo = HASH_ALGO_MD5;
> +#endif
>  		} else {
>  			pr_err("invalid hash algorithm \"%s\" for template \"%s\"",
>  				str, IMA_TEMPLATE_IMA_NAME);

thanks,

Mimi




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux