The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: James Morris <jmorris@namei.org>
Cc: dhowells@redhat.com, denkenz@gmail.com, keyrings@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 05/22] KEYS: Provide software public key query function
Date: Tue, 09 Oct 2018 16:21:36 +0100	[thread overview]
Message-ID: <16730.1539098496@warthog.procyon.org.uk> (raw)
In-Reply-To: <alpine.LRH.2.21.1810040520570.16168@namei.org>

James Morris <jmorris@namei.org> wrote:

> > +	if (strcmp(encoding, "raw") == 0) {
> > +		strcpy(alg_name, pkey->pkey_algo);
> > +		return 0;
> > +	}
> 
> Can encoding here also be NULL to indicate raw? per patch 01:

Okay, I'm making the attached changes to patch 01.  They're
documentary/commentary only.

David
---
diff --git a/Documentation/security/keys/core.rst b/Documentation/security/keys/core.rst
index 2cdccde6c585..c144978479d5 100644
--- a/Documentation/security/keys/core.rst
+++ b/Documentation/security/keys/core.rst
@@ -1507,12 +1507,12 @@ The structure has a number of fields, some of which are mandatory:
 		enum kernel_pkey_operation op : 8;
 	};
 
-     This includes the key to be used; an optional string indicating the
-     encoding to use (for instance, "pkcs1" may be used with an RSA key to
-     indicate RSASSA-PKCS1-v1.5 or RSAES-PKCS1-v1.5 encoding); the name of the
-     hash algorithm used to generate the data for a signature (if appropriate);
-     the sizes of the input and output (or second input) buffers; and the ID of
-     the operation to be performed.
+     This includes the key to be used; a string indicating the encoding to use
+     (for instance, "pkcs1" may be used with an RSA key to indicate
+     RSASSA-PKCS1-v1.5 or RSAES-PKCS1-v1.5 encoding or "raw" if no encoding);
+     the name of the hash algorithm used to generate the data for a signature
+     (if appropriate); the sizes of the input and output (or second input)
+     buffers; and the ID of the operation to be performed.
 
      For a given operation ID, the input and output buffers are used as
      follows::
diff --git a/include/linux/keyctl.h b/include/linux/keyctl.h
index e89b4a4e43d0..c7c48c79ce0e 100644
--- a/include/linux/keyctl.h
+++ b/include/linux/keyctl.h
@@ -32,7 +32,7 @@ enum kernel_pkey_operation {
 
 struct kernel_pkey_params {
 	struct key	*key;
-	const char	*encoding;	/* Encoding (eg. "oaep" or NULL for raw) */
+	const char	*encoding;	/* Encoding (eg. "oaep" or "raw" for none) */
 	const char	*hash_algo;	/* Digest algorithm used (eg. "sha1") or NULL if N/A */
 	char		*info;		/* Modified info string to be released later */
 	__u32		in_len;		/* Input data size */

  parent reply	other threads:[~2018-10-09 15:21 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05 21:54 [PATCH 00/22] KEYS: Support TPM-wrapped key and crypto ops David Howells
2018-09-05 21:54 ` [PATCH 01/22] KEYS: Provide key type operations for asymmetric key ops David Howells
2018-09-05 21:54 ` [PATCH 02/22] KEYS: Provide keyctls to drive the new key type ops for asymmetric keys David Howells
2018-09-05 21:54 ` [PATCH 03/22] KEYS: Provide missing asymmetric key subops for new key type ops David Howells
2018-10-03 19:03   ` James Morris
2018-10-05 15:39     ` David Howells
2018-09-05 21:54 ` [PATCH 04/22] KEYS: Make the X.509 and PKCS7 parsers supply the sig encoding type David Howells
2018-10-03 19:12   ` James Morris
2018-10-05 15:43     ` David Howells
2018-09-05 21:54 ` [PATCH 05/22] KEYS: Provide software public key query function David Howells
2018-10-03 19:24   ` James Morris
2018-10-05 15:51     ` David Howells
2018-10-05 16:28       ` James Morris
2018-10-05 18:23         ` James Morris
2018-10-09 15:21     ` David Howells [this message]
2018-09-05 21:54 ` [PATCH 06/22] KEYS: Allow the public_key struct to hold a private key David Howells
2018-09-05 21:55 ` [PATCH 07/22] KEYS: Implement encrypt, decrypt and sign for software asymmetric key David Howells
2018-09-05 21:55 ` [PATCH 08/22] KEYS: Implement PKCS#8 RSA Private Key parser David Howells
2018-09-05 21:55 ` [PATCH 09/22] crypto: rsa-pkcs1pad: Allow hash to be optional David Howells
2018-09-05 21:55 ` [PATCH 10/22] KEYS: asym_tpm: add skeleton for asym_tpm David Howells
2018-09-05 21:55 ` [PATCH 11/22] KEYS: asym_tpm: extract key size & public key David Howells
2018-09-05 21:55 ` [PATCH 12/22] KEYS: Add parser for TPM-based keys David Howells
2018-09-05 21:55 ` [PATCH 13/22] KEYS: asym_tpm: Implement pkey_query David Howells
2018-09-05 21:55 ` [PATCH 14/22] KEYS: asym_tpm: Implement encryption operation David Howells
2018-09-05 21:55 ` [PATCH 15/22] KEYS: trusted: Expose common functionality David Howells
2018-09-05 21:56 ` [PATCH 16/22] KEYS: Move trusted.h to include/keys David Howells
2018-09-05 21:56 ` [PATCH 17/22] KEYS: asym_tpm: Add loadkey2 and flushspecific David Howells
2018-09-05 21:56 ` [PATCH 18/22] KEYS: asym_tpm: Implement tpm_unbind David Howells
2018-09-05 21:56 ` [PATCH 19/22] KEYS: asym_tpm: Implement the decrypt operation David Howells
2018-09-05 21:56 ` [PATCH 20/22] KEYS: asym_tpm: Implement signature verification David Howells
2018-09-05 21:56 ` [PATCH 21/22] KEYS: asym_tpm: Implement tpm_sign David Howells
2018-09-05 21:56 ` [PATCH 22/22] KEYS: asym_tpm: Add support for the sign operation David Howells
2018-09-06  0:07 ` [PATCH 00/22] KEYS: Support TPM-wrapped key and crypto ops James Morris
2018-09-07 17:31   ` Marcel Holtmann
2018-09-07 17:32     ` James Morris
2018-09-08 15:26     ` David Howells
2018-09-18  7:00       ` David Woodhouse
2018-09-18 11:30         ` James Bottomley
2018-09-18  6:59 ` David Woodhouse
2018-09-18  4:34   ` Denis Kenzior
2018-09-18 15:50     ` David Howells
2018-09-18  5:24       ` Denis Kenzior
2018-09-18 16:17         ` David Woodhouse
2018-09-18  5:41           ` Denis Kenzior
2018-09-18 16:33           ` David Howells
2018-09-18  5:51             ` Denis Kenzior
2018-09-18 16:55               ` David Howells
2018-09-18 17:00                 ` Denis Kenzior
2018-09-18 17:18                   ` David Howells
2018-09-20  7:26                     ` Marcel Holtmann
2018-09-20 16:45                       ` David Woodhouse
2018-09-20 17:07                         ` Denis Kenzior
2018-09-28 17:20                         ` Marcel Holtmann
2018-09-18 15:02   ` David Howells
2018-09-18 15:26     ` David Woodhouse

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=16730.1539098496@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=denkenz@gmail.com \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.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