linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: linux-integrity@vger.kernel.org, Bruno Meneguele <bmeneg@redhat.com>
Subject: Re: [PATCH 2/3] ima-evm-utils: output specific "unknown keyid" file msg based on log level
Date: Mon, 20 Jul 2020 10:33:30 +0200	[thread overview]
Message-ID: <20200720083330.GD11397@dell5510> (raw)
In-Reply-To: <1595174524-4976-2-git-send-email-zohar@linux.ibm.com>

Hi Mimi,

> -		log_info("%s: verification failed: unknown keyid %x\n",
> -			 file, __be32_to_cpup(&keyid));
> +		if (imaevm_params.verbose > LOG_INFO)
> +			log_info("%s: verification failed: unknown keyid %x\n",

BTW, I was thinking to add more macros which would handle if
(imaevm_params.verbose > LOG_INFO), something like:

+#define log_dump_verbose(p, len)               if (imaevm_params.verbose > LOG_INFO) do_dump(p, len, true)
+#define log_verbose(fmt, args...)              if (imaevm_params.verbose > LOG_INFO) log_info(fmt, ##args)

But in the end I didn't post it, because:
1) imaevm_params.verbose is sometimes used for other purpose:
src/evmctl.c:
	if (sigdump || imaevm_params.verbose >= LOG_INFO)
		imaevm_hexdump(sig, len);
...
	if (imaevm_params.verbose > LOG_INFO) {
		log_info("%d ", entry->header.pcr);
		log_dump_n(entry->header.digest, sizeof(entry->header.digest));
		log_info(" %s %s", entry->name, algo);
		log_dump_n(digest, digest_len);
		log_info(" %s", path);
		if (fbuf) {
			log_info(" ");
			log_dump_n(fbuf, fbuf_len);
		}
	}
...
     if (imaevm_params.verbose <= LOG_INFO)
         return;

2) code sometimes compares: imaevm_params.verbose >= LOG_INFO (i.e. >= vs >; is
that intentional?)

Kind regards,
Petr

  parent reply	other threads:[~2020-07-20  8:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 16:02 [PATCH 1/3] ima-evm-utils: similarly add sanity check for file parameter of TPM 1.2 PCRs Mimi Zohar
2020-07-19 16:02 ` [PATCH 2/3] ima-evm-utils: output specific "unknown keyid" file msg based on log level Mimi Zohar
2020-07-20  8:13   ` Petr Vorel
2020-07-20  8:33   ` Petr Vorel [this message]
2020-07-19 16:02 ` [PATCH 3/3] ima_evm_utils: indicate "--verify" template data digest failures Mimi Zohar
2020-07-20  8:18   ` Petr Vorel
2020-07-20  8:04 ` [PATCH 1/3] ima-evm-utils: similarly add sanity check for file parameter of TPM 1.2 PCRs Petr Vorel

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=20200720083330.GD11397@dell5510 \
    --to=pvorel@suse.cz \
    --cc=bmeneg@redhat.com \
    --cc=linux-integrity@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).