Linux Integrity Measurement development
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Sughosh Ganu <sughosh.ganu@linaro.org>, linux-integrity@vger.kernel.org
Subject: Re: Question on loading trusted key with keyctl command
Date: Mon, 19 Dec 2022 06:43:40 -0500	[thread overview]
Message-ID: <1a74e603cb6924a19e4995ede5190d2488b2da36.camel@linux.ibm.com> (raw)
In-Reply-To: <CADg8p96Obiio+CUOCKzKqqc6m+B+zSDgs6SWLKSpSo5po94ApQ@mail.gmail.com>

On Mon, 2022-12-19 at 15:50 +0530, Sughosh Ganu wrote:
> hi,
> I am trying to enable the evm hmac solution on my qemu arm64 virt
> platform running Debian. I am using the swtpm 2.0 implementation for
> the TPM trusted source. Before I get into trying out the evm hmac
> solution on the target system, I wanted to check creating the trusted
> and encrypted keys.  Other details on my set up are as follows
> 
> Distro - Debian 11
> TPM - swtpm
> Linux kernel - Linux version 6.1.0-13032, commit 77856d911a8c [1]
> keyctl --version
> keyctl from keyutils-1.6.1 (Built 2020-02-10)
> 
> When trying to follow the steps highlighted in the
> Documentation/security/keys/trusted-encrypted.rst, I can generate the
> trusted key. However, when I try to load the trusted key using the
> command shown in the document, it throws an error. Has there been a
> change in the code, or am I missing some step when trying to load the
> trusted key?
> 
> Steps that I am following (after having created the SRK).
> 
> # keyctl add trusted kmk "new 32 keyhandle=0x81000001" @u
> # keyctl show
> Session Keyring
>  442944693 --alswrv      0     0  keyring: _ses
>  925986946 --alswrv      0 65534   \_ keyring: _uid.0
>  401286062 --alswrv      0     0       \_ trusted: kmk
> # keyctl pipe 401286062 > kmk.blob
> # keyctl add trusted kmk "load `cat kmk.blob` keyhandle=0x81000001" @u
> add_key: Invalid argument
> 
> -sughosh
> 
> [1] - I enable trusted and encrypted keys above the said commit

Try deleting/unlinking the existing kmk key before re-loading it.

-- 
thanks,

Mimi




  reply	other threads:[~2022-12-19 11:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 10:20 Question on loading trusted key with keyctl command Sughosh Ganu
2022-12-19 11:43 ` Mimi Zohar [this message]
2022-12-19 12:50 ` James Bottomley
2022-12-20  6:33   ` Sughosh Ganu
2022-12-20 12:50     ` James Bottomley
2022-12-20 13:54       ` Mimi Zohar
2022-12-20 14:03         ` James Bottomley
2022-12-20 14:13           ` Mimi Zohar
2022-12-20 14:23             ` James Bottomley
2022-12-20 15:40               ` Mimi Zohar

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=1a74e603cb6924a19e4995ede5190d2488b2da36.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=sughosh.ganu@linaro.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