1
0
mirror of https://git.code.sf.net/p/linux-ima/ima-evm-utils synced 2025-07-12 10:10:46 +02:00

ima-evm-utils: Extract digest algorithms from hash_info.h

If configured with "--with-kernel-headers=PATH" try to extract hash
algorithms from "hash_info.h" from the kernel source tree or
kernel-headers package located in the specified path. (Otherwise, it
will be tried to get from the installed kernel.)

This also introduces two algorithm lists, one is built-in and another is
from the kernel source. (They should never contain conflicting algorithm
IDs by their append-only nature.) If the digest is not found in the
built-in list it will be searched in the list from kernel's
"hash_info.h".

This patch will allow evmctl to be just recompiled to work with digest
algorithms introduced in the newer kernels.

Suggested-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
Vitaly Chikunov
2019-03-23 04:41:51 +03:00
committed by Mimi Zohar
parent 07d799cb6c
commit b628d8bfdb
4 changed files with 83 additions and 1 deletions

View File

@ -9,6 +9,11 @@ libimaevm_la_LIBADD = $(OPENSSL_LIBS)
include_HEADERS = imaevm.h
nodist_libimaevm_la_SOURCES = hash_info.h
BUILT_SOURCES = hash_info.h
hash_info.h: Makefile
./hash_info.gen $(KERNEL_HEADERS) >$@
bin_PROGRAMS = evmctl
evmctl_SOURCES = evmctl.c
@ -18,5 +23,6 @@ evmctl_LDADD = $(OPENSSL_LIBS) -lkeyutils libimaevm.la
INCLUDES = -I$(top_srcdir) -include config.h
CLEANFILES = hash_info.h
DISTCLEANFILES = @DISTCLEANFILES@