linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Stefan Berger <stefanb@linux.vnet.ibm.com>,
	linux-integrity@vger.kernel.org
Cc: Stefan Berger <stefanb@linux.ibm.com>
Subject: Re: [PATCH v2 2/8] evmctl: Handle engine initialization properly
Date: Fri, 03 Sep 2021 08:55:09 -0400	[thread overview]
Message-ID: <95f0afde0cd006b57e44721b12051d77de2dd0ee.camel@linux.ibm.com> (raw)
In-Reply-To: <20210810134557.2444863-3-stefanb@linux.vnet.ibm.com>

On Tue, 2021-08-10 at 09:45 -0400, Stefan Berger wrote:
> From: Stefan Berger <stefanb@linux.ibm.com>
> 
> Fix the following issue when passing a not available engine:

First describe the problem and then include details and/or an example. 
For example, "Handle failure to initialize the openssl engine.  For
example, "
> 
> $ ./src/evmctl --engine foo
> engine foo isn't available
> 140322992015168:error:25066067:DSO support routines:dlfcn_load:could not load the shared library:crypto/dso/dso_dlfcn.c:118:filename(/usr/lib64/engines-1.1/foo.so): /usr/lib64/engines-1.1/foo.so: cannot open shared object file: No such file or directory
> 140322992015168:error:25070067:DSO support routines:DSO_load:could not load the shared library:crypto/dso/dso_lib.c:162:
> 140322992015168:error:260B6084:engine routines:dynamic_load:dso not found:crypto/engine/eng_dyn.c:414:
> 140322992015168:error:2606A074:engine routines:ENGINE_by_id:no such engine:crypto/engine/eng_list.c:334:id=foo
> Segmentation fault (core dumped)
> 
> Also, jump to the exit when the setup of the engine failed.

Patch descriptions should not be explaining the details of the code,
but providing the motivation for the patch.  Please remove this line.

> 
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>

Thanks,

Mimi

> ---
>  src/evmctl.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/evmctl.c b/src/evmctl.c
> index 58f8e66..ed0ece3 100644
> --- a/src/evmctl.c
> +++ b/src/evmctl.c
> @@ -2765,7 +2765,10 @@ int main(int argc, char *argv[])
>  				ENGINE_free(eng);
>  				eng = NULL;
>  			}
> -			ENGINE_set_default(eng, ENGINE_METHOD_ALL);
> +			if (eng)
> +				ENGINE_set_default(eng, ENGINE_METHOD_ALL);
> +			else
> +				goto error;
>  			break;
>  		case 140: /* --xattr-user */
>  			xattr_ima = "user.ima";
> @@ -2839,6 +2842,7 @@ int main(int argc, char *argv[])
>  			err = 125;
>  	}
>  
> +error:
>  	if (eng) {
>  		ENGINE_finish(eng);
>  		ENGINE_free(eng);



  reply	other threads:[~2021-09-03 12:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 13:45 [PATCH v2 0/8] ima-evm-utils: Add support for signing with pkcs11 URIs Stefan Berger
2021-08-10 13:45 ` [PATCH v2 1/8] evmctl: Implement support for EVMCTL_KEY_PASSWORD environment variable Stefan Berger
2021-08-27 21:37   ` Mimi Zohar
2021-09-04 10:21     ` Vitaly Chikunov
2021-08-10 13:45 ` [PATCH v2 2/8] evmctl: Handle engine initialization properly Stefan Berger
2021-09-03 12:55   ` Mimi Zohar [this message]
2021-08-10 13:45 ` [PATCH v2 3/8] evmctl: Move code setting up engine to own funtion Stefan Berger
2021-09-03 12:55   ` Mimi Zohar
2021-08-10 13:45 ` [PATCH v2 4/8] evmctl: Extend libimaevm_params with ENGINE field and use it Stefan Berger
2021-09-03 12:55   ` Mimi Zohar
2021-08-10 13:45 ` [PATCH v2 5/8] evmctl: Setup the pkcs11 engine if key has pkcs11: prefix Stefan Berger
2021-09-03 12:55   ` Mimi Zohar
2021-08-10 13:45 ` [PATCH v2 6/8] libimaevm: Add support for pkcs11 private keys for signing a v2 hash Stefan Berger
2021-09-03 12:55   ` Mimi Zohar
2021-08-10 13:45 ` [PATCH v2 7/8] tests: Extend sign_verify test with pkcs11-specific test Stefan Berger
2021-09-03 19:11   ` Mimi Zohar
2021-09-03 19:30     ` Stefan Berger
2021-08-10 13:45 ` [PATCH v2 8/8] tests: Get the packages for pkcs11 testing on the CI/CD system Stefan Berger
2021-09-03 19:17   ` Mimi Zohar
2021-09-03 20:27     ` Stefan Berger
2021-09-03 12:54 ` [PATCH v2 0/8] ima-evm-utils: Add support for signing with pkcs11 URIs 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=95f0afde0cd006b57e44721b12051d77de2dd0ee.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=stefanb@linux.ibm.com \
    --cc=stefanb@linux.vnet.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;
as well as URLs for NNTP newsgroup(s).