nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH 1/3] ndctl: fix load-keys for user master-key
Date: Thu, 28 Mar 2019 12:19:33 -0700	[thread overview]
Message-ID: <CAPcyv4ho=s5PSyDQ+kuz9h00jPcko+PaqLB294mPh+y2yucOKg@mail.gmail.com> (raw)
In-Reply-To: <73b19eaf-ace5-632c-33a6-0db018ebe05e@intel.com>

On Thu, Mar 28, 2019 at 12:17 PM Dave Jiang <dave.jiang@intel.com> wrote:
>
>
>
> On 3/28/19 12:11 PM, Dan Williams wrote:
> > On Thu, Mar 28, 2019 at 12:07 PM Dave Jiang <dave.jiang@intel.com> wrote:
> >>
> >> load-keys incorrectly assumes that all keys have TPM handles. TPM handle is
> >> only for trusted-keys. Fix in order to allow user master-key work.
> >
> > s/work/to operate/ ?
> >
> >>
> >> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> >> ---
> >>  ndctl/load-keys.c |    6 ++----
> >>  1 file changed, 2 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/ndctl/load-keys.c b/ndctl/load-keys.c
> >> index 8e4998f2..19380152 100644
> >> --- a/ndctl/load-keys.c
> >> +++ b/ndctl/load-keys.c
> >> @@ -213,10 +213,8 @@ static int load_keys(struct loadkeys *lk_ctx, const char *keypath,
> >>
> >>         if (!tpmhandle) {
> >>                 rc = check_tpm_handle(lk_ctx);
> >> -               if (rc < 0) {
> >> -                       rc = -errno;
> >> -                       goto erropen;
> >> -               }
> >> +               if (rc < 0)
> >> +                       printf("No TPM handle discovered.\n");
> >
> > Please keep error messages on stderr.
>
> Actually this is info. At this point we do not have context as to if a
> trusted key or user key being loaded, and it could be we are using user
> master key or it could be TPM handle can't be found.

Ok, but it should still be stderr. ndctl tries to enforce only json on stdout.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

      reply	other threads:[~2019-03-28 19:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 19:07 [PATCH 1/3] ndctl: fix load-keys for user master-key Dave Jiang
2019-03-28 19:07 ` [PATCH 2/3] ndctl: fix key blob loading for user keys Dave Jiang
2019-03-28 19:18   ` Dan Williams
2019-03-28 19:30     ` Dave Jiang
2019-03-28 19:07 ` [PATCH 3/3] ndctl: add unit test for load-keys Dave Jiang
2019-03-28 21:29   ` Verma, Vishal L
2019-03-28 19:11 ` [PATCH 1/3] ndctl: fix load-keys for user master-key Dan Williams
2019-03-28 19:17   ` Dave Jiang
2019-03-28 19:19     ` Dan Williams [this message]

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='CAPcyv4ho=s5PSyDQ+kuz9h00jPcko+PaqLB294mPh+y2yucOKg@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=linux-nvdimm@lists.01.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;
as well as URLs for NNTP newsgroup(s).