mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-28 06:33:36 +02:00
ima-evm-utils: Rework openssl init
Remove deprecated call to OpenSSL_add_all_algorithms(). Allow to disable openssl config loading by evmctl via configure `--disable-openssl-conf' option. Show status of that in configure. Move config loading from libimaevm to evmctl. Finish engine initialization properly by calling ENGINE_set_default(), as suggested by James Bottomley. Signed-off-by: Vitaly Chikunov <vt@altlinux.org> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
ebbfc41ad6
commit
782224f33c
10
configure.ac
10
configure.ac
@ -39,6 +39,12 @@ AC_ARG_WITH(kernel_headers, [AS_HELP_STRING([--with-kernel-headers=PATH],
|
|||||||
[KERNEL_HEADERS="$withval"],
|
[KERNEL_HEADERS="$withval"],
|
||||||
[KERNEL_HEADERS=/lib/modules/$(uname -r)/source])
|
[KERNEL_HEADERS=/lib/modules/$(uname -r)/source])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([openssl_conf],
|
||||||
|
[AS_HELP_STRING([--disable-openssl-conf], [disable loading of openssl config by evmctl])],
|
||||||
|
[if test "$enable_openssl_conf" = "no"; then
|
||||||
|
AC_DEFINE(DISABLE_OPENSSL_CONF, 1, [Define to disable loading of openssl config by evmctl.])
|
||||||
|
fi], [enable_openssl_conf=yes])
|
||||||
|
|
||||||
#debug support - yes for a while
|
#debug support - yes for a while
|
||||||
PKG_ARG_ENABLE(debug, "yes", DEBUG, [Enable Debug support])
|
PKG_ARG_ENABLE(debug, "yes", DEBUG, [Enable Debug support])
|
||||||
if test $pkg_cv_enable_debug = yes; then
|
if test $pkg_cv_enable_debug = yes; then
|
||||||
@ -65,6 +71,6 @@ AC_OUTPUT
|
|||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo "Configuration:"
|
echo "Configuration:"
|
||||||
echo " debug: $pkg_cv_enable_debug"
|
echo " debug: $pkg_cv_enable_debug"
|
||||||
|
echo " openssl-conf: $enable_openssl_conf"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
@ -1779,6 +1779,11 @@ int main(int argc, char *argv[])
|
|||||||
int err = 0, c, lind;
|
int err = 0, c, lind;
|
||||||
ENGINE *eng = NULL;
|
ENGINE *eng = NULL;
|
||||||
|
|
||||||
|
OPENSSL_init_crypto(
|
||||||
|
#ifndef DISABLE_OPENSSL_CONF
|
||||||
|
OPENSSL_INIT_LOAD_CONFIG |
|
||||||
|
#endif
|
||||||
|
OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
|
||||||
g_argv = argv;
|
g_argv = argv;
|
||||||
g_argc = argc;
|
g_argc = argc;
|
||||||
|
|
||||||
@ -1899,6 +1904,7 @@ int main(int argc, char *argv[])
|
|||||||
ENGINE_free(eng);
|
ENGINE_free(eng);
|
||||||
eng = NULL;
|
eng = NULL;
|
||||||
}
|
}
|
||||||
|
ENGINE_set_default(eng, ENGINE_METHOD_ALL);
|
||||||
break;
|
break;
|
||||||
case 140: /* --xattr-user */
|
case 140: /* --xattr-user */
|
||||||
xattr_ima = "user.ima";
|
xattr_ima = "user.ima";
|
||||||
|
@ -937,7 +937,7 @@ int sign_hash(const char *hashalgo, const unsigned char *hash, int size, const c
|
|||||||
|
|
||||||
static void libinit()
|
static void libinit()
|
||||||
{
|
{
|
||||||
OpenSSL_add_all_algorithms();
|
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS |
|
||||||
OPENSSL_add_all_algorithms_conf();
|
OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user