Linux Integrity Measurement development
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: "Bruno E. O. Meneguele" <bmeneg@redhat.com>
Cc: linux-integrity@vger.kernel.org,
	Vitaly Chikunov <vt@altlinux.org>, Petr Vorel <pvorel@suse.cz>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Subject: Re: [PATCH v2] ima-evm-utils: use tsspcrread to read the TPM 2.0 PCRs
Date: Tue, 23 Jul 2019 11:53:10 -0400	[thread overview]
Message-ID: <1563897190.14396.144.camel@linux.ibm.com> (raw)
In-Reply-To: <20190723154759.GB16649@glitch>

On Tue, 2019-07-23 at 12:47 -0300, Bruno E. O. Meneguele wrote:

> > @@ -1402,6 +1400,41 @@ static int tpm_pcr_read(int idx, uint8_t *pcr, int len)
> >  	return result;
> >  }
> >  
> > +#ifdef HAVE_TSSPCRREAD
> > +static int tpm2_pcr_read(int idx, uint8_t *hwpcr, int len, char **errmsg)
> > +{
> > +	FILE *fp;
> > +	char pcr[100];	/* may contain an error */
> > +	char cmd[50];
> > +	int ret;
> > +
> > +	sprintf(cmd, "tsspcrread -halg sha1 -ha %d -ns 2> /dev/null", idx);
> > +	fp = popen(cmd, "r");
> > +	if (!fp) {
> > +		snprintf(pcr, sizeof(pcr), "popen failed: %s", strerror(errno));
> > +		*errmsg = strdup("popen failed:");
> 
> Should it have been 
> 
> *errmsg = strdup(pcr);
> 
Yes, of course.

thanks!

Mimi


  reply	other threads:[~2019-07-23 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 14:55 [PATCH v2] ima-evm-utils: use tsspcrread to read the TPM 2.0 PCRs Mimi Zohar
2019-07-23 15:47 ` Bruno E. O. Meneguele
2019-07-23 15:53   ` Mimi Zohar [this message]
2019-07-23 16:41     ` Vitaly Chikunov
2019-07-23 18:24       ` Mimi Zohar
2019-07-23 19:31         ` Vitaly Chikunov
2019-07-23 19:37           ` Mimi Zohar
2019-07-23 19:41             ` Vitaly Chikunov

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=1563897190.14396.144.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=bmeneg@redhat.com \
    --cc=dbaryshkov@gmail.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=pvorel@suse.cz \
    --cc=vt@altlinux.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