linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Stefan Berger <stefanb@linux.ibm.com>, linux-integrity@vger.kernel.org
Cc: Eric Biggers <ebiggers@kernel.org>,
	linux-fscrypt@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 4/7] ima: define a new template field named 'd-ngv2' and templates
Date: Fri, 29 Apr 2022 17:41:04 -0400	[thread overview]
Message-ID: <c317858898c7974b5f046f9fb8117d299f0c6504.camel@linux.ibm.com> (raw)
In-Reply-To: <026c9596-9ebe-d148-fc5f-442a7e16f48b@linux.ibm.com>

On Fri, 2022-04-29 at 11:09 -0400, Stefan Berger wrote:
> > -     if (hash_algo < HASH_ALGO__LAST) {
> > +     if (digest_type < DIGEST_TYPE__LAST && hash_algo < HASH_ALGO__LAST) {
> > +             fmt = DATA_FMT_DIGEST_WITH_TYPE_AND_ALGO;
> > +             offset += 1 + sprintf(buffer, "%*s:%*s:",
> > +                                   (int)strlen(digest_type_name[digest_type]),
> > +                                   digest_type_name[digest_type],
> > +                                   (int)strlen(hash_algo_name[hash_algo]),
> > +                                   hash_algo_name[hash_algo]);
> 
> '%*s' seems to be for right-alignment but only makes sense if the length 
> indicator is different than then following string. sprintf(buffer, 
> "|%*s|",5,"test") prints | test|. Otherwise it seems to behave like 
> plain '%s' in this case... ?

Re-testing now, it works properly without the length.

thanks,

Mimi


  reply	other threads:[~2022-04-29 21:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 11:25 [PATCH v8 0/7] ima: support fs-verity digests and signatures Mimi Zohar
2022-04-29 11:25 ` [PATCH v8 1/7] ima: fix 'd-ng' comments and documentation Mimi Zohar
2022-04-29 16:44   ` Stefan Berger
2022-05-02 12:14     ` Mimi Zohar
2022-04-29 11:25 ` [PATCH v8 2/7] ima: use IMA default hash algorithm for integrity violations Mimi Zohar
2022-04-29 16:09   ` Stefan Berger
2022-04-29 11:25 ` [PATCH v8 3/7] fs-verity: define a function to return the integrity protected file digest Mimi Zohar
2022-04-29 11:25 ` [PATCH v8 4/7] ima: define a new template field named 'd-ngv2' and templates Mimi Zohar
2022-04-29 15:09   ` Stefan Berger
2022-04-29 21:41     ` Mimi Zohar [this message]
2022-04-29 11:25 ` [PATCH v8 5/7] ima: permit fsverity's file digests in the IMA measurement list Mimi Zohar
2022-04-29 17:30   ` Stefan Berger
2022-04-29 11:26 ` [PATCH v8 6/7] ima: support fs-verity file digest based version 3 signatures Mimi Zohar
2022-04-29 21:51   ` Stefan Berger
2022-05-02 12:16     ` Mimi Zohar
2022-04-29 11:26 ` [PATCH v8 7/7] fsverity: update the documentation Mimi Zohar
2022-04-29 17:42   ` Stefan Berger

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=c317858898c7974b5f046f9fb8117d299f0c6504.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=ebiggers@kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefanb@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).