Keyrings Archive mirror
 help / color / mirror / Atom feed
From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Ignat Korchagin" <ignat@cloudflare.com>,
	"James Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Mimi Zohar" <zohar@linux.ibm.com>,
	"David Howells" <dhowells@redhat.com>,
	"Paul Moore" <paul@paul-moore.com>,
	"James Morris" <jmorris@namei.org>, <serge@hallyn.com>,
	<linux-integrity@vger.kernel.org>, <keyrings@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <kernel-team@cloudflare.com>
Subject: Re: [RFC PATCH 1/2] tpm: add some algorithm and constant definitions from the TPM spec
Date: Wed, 15 May 2024 01:51:50 +0300	[thread overview]
Message-ID: <D19QI1MDD734.3FA17QYMV3TD3@kernel.org> (raw)
In-Reply-To: <20240503221634.44274-2-ignat@cloudflare.com>

I'll go through the code changes. I've barely skimmed them because I
needed to understand the gist of the cover letter first and was busy
with 6.10 release and asymmetric keys.

On Sat May 4, 2024 at 1:16 AM EEST, Ignat Korchagin wrote:
> In preparation for implementing TPM derived keys we need to use some new TPM
> functionality in the kernel, so add relevant constant definitions.

Define "TPM derived key" what is. It is *undefined* at this point of the
Git history.

>
> Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
> ---
>  include/linux/tpm.h | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/tpm.h b/include/linux/tpm.h
> index 4ee9d13749ad..5be0808b1b91 100644
> --- a/include/linux/tpm.h
> +++ b/include/linux/tpm.h
> @@ -35,6 +35,7 @@ struct trusted_key_options;
>  enum tpm_algorithms {
>  	TPM_ALG_ERROR		= 0x0000,
>  	TPM_ALG_SHA1		= 0x0004,
> +	TPM_ALG_HMAC		= 0x0005,
>  	TPM_ALG_KEYEDHASH	= 0x0008,
>  	TPM_ALG_SHA256		= 0x000B,
>  	TPM_ALG_SHA384		= 0x000C,

I had a point after all when asking for split and it was about this
patch. This should be a separate comment and with a clear rationale what
for this is required for the new key type.

It is a logically separate change [1].

> @@ -209,6 +210,7 @@ enum tpm2_return_codes {
>  	TPM2_RC_DISABLED	= 0x0120,
>  	TPM2_RC_UPGRADE		= 0x012D,
>  	TPM2_RC_COMMAND_CODE    = 0x0143,
> +	TPM2_RC_OBJECT_MEMORY	= 0x0902,
>  	TPM2_RC_TESTING		= 0x090A, /* RC_WARN */
>  	TPM2_RC_REFERENCE_H0	= 0x0910,
>  	TPM2_RC_RETRY		= 0x0922,

Ditto.

> @@ -227,6 +229,7 @@ enum tpm2_command_codes {
>  	TPM2_CC_CREATE		        = 0x0153,
>  	TPM2_CC_LOAD		        = 0x0157,
>  	TPM2_CC_SEQUENCE_UPDATE         = 0x015C,
> +	TPM2_CC_SIGN		        = 0x015D,
>  	TPM2_CC_UNSEAL		        = 0x015E,
>  	TPM2_CC_CONTEXT_LOAD	        = 0x0161,
>  	TPM2_CC_CONTEXT_SAVE	        = 0x0162,

Ditto.

> @@ -234,6 +237,7 @@ enum tpm2_command_codes {
>  	TPM2_CC_VERIFY_SIGNATURE        = 0x0177,
>  	TPM2_CC_GET_CAPABILITY	        = 0x017A,
>  	TPM2_CC_GET_RANDOM	        = 0x017B,
> +	TPM2_CC_HASH	        	= 0x017D,
>  	TPM2_CC_PCR_READ	        = 0x017E,
>  	TPM2_CC_PCR_EXTEND	        = 0x0182,
>  	TPM2_CC_EVENT_SEQUENCE_COMPLETE = 0x0185,


Ditto.

> @@ -243,7 +247,8 @@ enum tpm2_command_codes {
>  };
>  
>  enum tpm2_permanent_handles {
> -	TPM2_RS_PW		= 0x40000009,
> +	TPM2_RH_OWNER = 0x40000001,

Ditto.

> +	TPM2_RS_PW    = 0x40000009,
>  };
>  
>  enum tpm2_capabilities {
> @@ -312,9 +317,12 @@ struct tpm_buf {
>  };
>  
>  enum tpm2_object_attributes {
> -	TPM2_OA_FIXED_TPM		= BIT(1),
> -	TPM2_OA_FIXED_PARENT		= BIT(4),
> -	TPM2_OA_USER_WITH_AUTH		= BIT(6),
> +	TPM2_OA_FIXED_TPM 		= BIT(1),
> +	TPM2_OA_FIXED_PARENT 		= BIT(4),
> +	TPM2_OA_SENSITIVE_DATA_ORIGIN	= BIT(5),
> +	TPM2_OA_USER_WITH_AUTH 		= BIT(6),
> +	TPM2_OA_RESTRICTED 		= BIT(16),
> +	TPM2_OA_SIGN 			= BIT(18),
>  };
>  
>  enum tpm2_session_attributes {

Ditto.

[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html#separate-your-changes

BR, Jarkko

  reply	other threads:[~2024-05-14 22:51 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 22:16 [RFC PATCH 0/2] TPM derived keys Ignat Korchagin
2024-05-03 22:16 ` [RFC PATCH 1/2] tpm: add some algorithm and constant definitions from the TPM spec Ignat Korchagin
2024-05-14 22:51   ` Jarkko Sakkinen [this message]
2024-05-14 22:52     ` Jarkko Sakkinen
2024-05-03 22:16 ` [RFC PATCH 2/2] KEYS: implement derived keys Ignat Korchagin
2024-05-14 23:10   ` Jarkko Sakkinen
2024-05-14 23:44     ` Jarkko Sakkinen
2024-05-15  0:00       ` Jarkko Sakkinen
2024-05-15  6:44       ` Ignat Korchagin
2024-05-15 12:00         ` Jarkko Sakkinen
2024-05-15 12:03           ` Jarkko Sakkinen
2024-05-15  7:26     ` Ignat Korchagin
2024-05-04  0:21 ` [RFC PATCH 0/2] TPM " Jarkko Sakkinen
2024-05-04 13:55   ` Ben Boeckel
2024-05-04 14:51     ` Jarkko Sakkinen
2024-05-04 15:35       ` Jarkko Sakkinen
2024-05-13 17:09         ` Ignat Korchagin
2024-05-13 22:33           ` James Bottomley
2024-05-14  9:50             ` Ignat Korchagin
2024-05-14 14:11               ` James Bottomley
2024-05-14 14:54                 ` Ignat Korchagin
2024-05-13 17:11 ` Ignat Korchagin
2024-05-14  0:28   ` Jarkko Sakkinen
2024-05-14 10:05     ` Ignat Korchagin
2024-05-14 12:09       ` Jarkko Sakkinen
2024-05-14 13:11         ` Ignat Korchagin
2024-05-14 14:00           ` Jarkko Sakkinen
2024-05-14 14:30             ` Jarkko Sakkinen
2024-05-14 15:21               ` Jarkko Sakkinen
2024-05-14 15:26                 ` Jarkko Sakkinen
2024-05-14 15:30                   ` Ignat Korchagin
2024-05-14 15:42                     ` Jarkko Sakkinen
2024-05-14 16:08                       ` Ignat Korchagin
2024-05-14 16:22                         ` Jarkko Sakkinen
2024-05-14 14:41             ` Ignat Korchagin
2024-05-14 14:45               ` Jarkko Sakkinen
2024-05-14 15:30           ` James Bottomley
2024-05-14 15:38             ` Ignat Korchagin
2024-05-14 15:54               ` James Bottomley
2024-05-14 16:01                 ` Ignat Korchagin

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=D19QI1MDD734.3FA17QYMV3TD3@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dhowells@redhat.com \
    --cc=ignat@cloudflare.com \
    --cc=jmorris@namei.org \
    --cc=kernel-team@cloudflare.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    --cc=zohar@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 read-only IMAP folder(s) and NNTP newsgroup(s).