public inbox for linux-integrity@vger.kernel.org
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Bruno Meneguele <bmeneg@redhat.com>,
	Simon.THOBY@viveris.fr, kgold@linux.ibm.com
Cc: linux-integrity@vger.kernel.org
Subject: Re: [PATCH v5 ima-evm-utils 1/2] set default hash algorithm in configuration time
Date: Thu, 09 Sep 2021 17:03:41 -0400	[thread overview]
Message-ID: <ab238b241d1328c3933681b8b939b5e5a9288aaf.camel@linux.ibm.com> (raw)
In-Reply-To: <20210902192427.314337-2-bmeneg@redhat.com>

On Thu, 2021-09-02 at 16:24 -0300, Bruno Meneguele wrote:
> +       AC_ARG_WITH([default_hash],
> +               AS_HELP_STRING([--with-default-hash=ALGORITHM], [specifies the default hash algorithm to be used]),
> +               [HASH_ALGO=$withval],
> +               [HASH_ALGO=sha1])
> +
> +       AC_CHECK_HEADER([$HASH_INFO_HEADER],
> +               [HAVE_HASH_INFO_HEADER=yes],
> +               [AC_MSG_WARN([$HASH_INFO_HEADER not found.])])
> +
> +       if test "x$HAVE_HASH_INFO_HEADER" = "x"; then
> +               AC_MSG_RESULT([using $HASH_ALGO algorithm as default hash algorith])
> +               AC_DEFINE_UNQUOTED(DEFAULT_HASH_ALGO, "$HASH_ALGO", [Define default hash algorithm])
> +       else
> +               AC_PROG_SED()
> +               AC_PROG_GREP()
> +               $SED -n 's/HASH_ALGO_\(.*\),/\L\1\E/p' $HASH_INFO_HEADER | $GREP -w -i $HASH_ALGO > /dev/null

This does an a case insensitive test for the hash algorithm, but the
code itself doesn't support upper case hash algorithms (e.g. SHA1,
SHA256).

thanks,

Mimi


> +               have_hash=$?
> +
> +               if test $have_hash -ne 0; then
> +                       AC_MSG_ERROR([$HASH_ALGO algorithm specified, but not provided by the kernel], 1)
> +               else
> +                       AC_MSG_NOTICE([using $HASH_ALGO as default hash algorithm])
> +                       AC_DEFINE_UNQUOTED(DEFAULT_HASH_ALGO, "$HASH_ALGO", [Define default hash algorithm])
> +               fi



  reply	other threads:[~2021-09-09 21:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 19:24 [PATCH v5 ima-evm-utils 0/2] make default hash algorithm dynamic Bruno Meneguele
2021-09-02 19:24 ` [PATCH v5 ima-evm-utils 1/2] set default hash algorithm in configuration time Bruno Meneguele
2021-09-09 21:03   ` Mimi Zohar [this message]
2021-09-10 15:19     ` Bruno Meneguele
2021-09-10 15:24   ` [PATCH v6 " Bruno Meneguele
2021-09-02 19:24 ` [PATCH v5 ima-evm-utils 2/2] make SHA-256 the default hash algorithm Bruno Meneguele

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=ab238b241d1328c3933681b8b939b5e5a9288aaf.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=Simon.THOBY@viveris.fr \
    --cc=bmeneg@redhat.com \
    --cc=kgold@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    /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