Linux Integrity Measurement development
 help / color / mirror / Atom feed
From: Vitaly Chikunov <vt@altlinux.org>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: linux-integrity@vger.kernel.org, Petr Vorel <pvorel@suse.cz>,
	Stefan Berger <stefanb@linux.ibm.com>
Subject: Re: [PATCH ima-evm-utils v3 07/15] Disable use of OpenSSL "engine" support
Date: Wed, 14 Sep 2022 19:38:03 +0300	[thread overview]
Message-ID: <20220914163803.e6zo5kbgtxfewhti@altlinux.org> (raw)
In-Reply-To: <20220914022956.1359218-8-zohar@linux.ibm.com>

On Tue, Sep 13, 2022 at 10:29:48PM -0400, Mimi Zohar wrote:
> OpenSSL v3 "engine" support is deprecated and replaced with "providers".
> Engine support will continue to work for a while, but results in
> deprecated declaration and other messages.  One option is simply to hide
> them ("-Wno-deprecated-declarations").  The other alternative is to
> conditionally build ima-evm-utils without OpenSSL engine support and
> without disabling deprecated declarations.
> 
> Based on "--disable-engine" or "--enable-engine=no" configuration
> option, disable OpenSSL "engine" support.
> 
> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
> ---
>  configure.ac           |  5 +++++
>  src/Makefile.am        |  8 ++++++++
>  src/evmctl.c           | 17 ++++++++++++++++-
>  src/imaevm.h           |  2 ++
>  src/libimaevm.c        |  7 ++++++-
>  tests/functions.sh     |  2 +-
>  tests/ima_hash.test    |  1 +
>  tests/sign_verify.test |  1 +
>  8 files changed, 40 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index dc666f2bb1fa..49e9350ace07 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -54,6 +54,10 @@ AC_ARG_ENABLE(sigv1,
>  	AM_CONDITIONAL([CONFIG_SIGV1], [test "x$enable_sigv1" = "xyes"])
>  	AS_IF([test "$enable_sigv1"  != "yes"], [enable_sigv1="no"])
>  
> +AC_ARG_ENABLE(engine,
> +	      [AS_HELP_STRING([--disable-engine], [build ima-evm-utils without OpenSSL engine support])],,[enable_engine=yes])

I would insert here:

  AC_CHECK_LIB([crypto], [ENGINE_init],, [enable_engine=no])

So that if -lcrypto does not have ENGINE_init symbol, engine will be
automatically disabled.


> @@ -2972,11 +2981,13 @@ int main(int argc, char *argv[])
>  		case 138:
>  			verify_list_sig = 1;
>  			break;
> +#if CONFIG_ENGINE
>  		case 139: /* --engine e */
>  			imaevm_params.eng = setup_engine(optarg);
>  			if (!imaevm_params.eng)
>  				goto error;

Still it's a bit strange that this error will not cause exit(1).

Thanks,

>  			break;
> +#endif
>  		case 140: /* --xattr-user */
>  			xattr_ima = "user.ima";
>  			xattr_evm = "user.evm";
> @@ -3035,7 +3046,9 @@ int main(int argc, char *argv[])
>  	if (imaevm_params.keyfile != NULL &&
>  	    imaevm_params.eng == NULL &&
>  	    !strncmp(imaevm_params.keyfile, "pkcs11:", 7)) {
> +#if CONFIG_ENGINE
>  		imaevm_params.eng = setup_engine("pkcs11");
> +#endif
>  		if (!imaevm_params.eng)
>  			goto error;
>  	}
> @@ -3061,6 +3074,7 @@ int main(int argc, char *argv[])
>  	}
>  
>  error:
> +#if CONFIG_ENGINE
>  	if (imaevm_params.eng) {
>  		ENGINE_finish(imaevm_params.eng);
>  		ENGINE_free(imaevm_params.eng);
> @@ -3068,6 +3082,7 @@ error:
>  		ENGINE_cleanup();
>  #endif
>  	}
> +#endif
>  	ERR_free_strings();
>  	EVP_cleanup();
>  	BIO_free(NULL);

  reply	other threads:[~2022-09-14 16:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14  2:29 [PATCH ima-evm-utils v3 00/15] address deprecated warnings Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 01/15] travis: update dist=focal Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 02/15] Update configure.ac to address a couple of obsolete warnings Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 03/15] Deprecate IMA signature version 1 Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 04/15] Replace the low level SHA1 calls when calculating the TPM 1.2 PCRs Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 05/15] Replace the low level HMAC calls when calculating the EVM HMAC Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 06/15] Add missing EVP_MD_CTX_free() call in calc_evm_hash() Mimi Zohar
2022-09-14 14:51   ` Vitaly Chikunov
2022-09-15 11:58     ` Mimi Zohar
2022-09-15 15:36       ` Vitaly Chikunov
2022-09-16 13:07         ` Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 07/15] Disable use of OpenSSL "engine" support Mimi Zohar
2022-09-14 16:38   ` Vitaly Chikunov [this message]
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 08/15] Fix potential use after free in read_tpm_banks() Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 09/15] Limit the file hash algorithm name length Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 10/15] Missing template data size lower bounds checking Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 11/15] Limit configuring OpenSSL engine support Mimi Zohar
2022-09-14 14:59   ` Vitaly Chikunov
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 12/15] Base sm2/sm3 test on openssl version installed Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 13/15] Compile a newer version of OpenSSL Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 14/15] Build OpenSSL without engine support Mimi Zohar
2022-09-14  2:29 ` [PATCH ima-evm-utils v3 15/15] Fix d2i_x509_fp failure Mimi Zohar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220914163803.e6zo5kbgtxfewhti@altlinux.org \
    --to=vt@altlinux.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=pvorel@suse.cz \
    --cc=stefanb@linux.ibm.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox