lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <16730.1539098496@warthog.procyon.org.uk>
Date:   Tue, 09 Oct 2018 16:21:36 +0100
From:   David Howells <dhowells@...hat.com>
To:     James Morris <jmorris@...ei.org>
Cc:     dhowells@...hat.com, denkenz@...il.com, keyrings@...r.kernel.org,
        linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/22] KEYS: Provide software public key query function

James Morris <jmorris@...ei.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 */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ