lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 29 Apr 2022 17:41:04 -0400
From:   Mimi Zohar <zohar@...ux.ibm.com>
To:     Stefan Berger <stefanb@...ux.ibm.com>,
        linux-integrity@...r.kernel.org
Cc:     Eric Biggers <ebiggers@...nel.org>, linux-fscrypt@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 4/7] ima: define a new template field named 'd-ngv2'
 and templates

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ