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-next>] [day] [month] [year] [list]
Message-Id: <3ge.ZcSB.212DbbvIi2E.1cwKdC@seznam.cz>
Date: Tue, 17 Sep 2024 11:20:12 +0200 (CEST)
From: "Tomas Paukrt" <tomaspaukrt@...il.cz>
To: <linux-crypto@...r.kernel.org>
Cc: "Herbert Xu" <herbert@...dor.apana.org.au>,
	"David S. Miller" <davem@...emloft.net>,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH] crypto: algif_skcipher - Enable access to internal skciphers

Add an option to enable the userspace interface for symmetric key
cipher algorithms marked as internal (CRYPTO_ALG_INTERNAL).

Signed-off-by: Tomas Paukrt <tomaspaukrt@...il.cz>
---
 crypto/Kconfig          | 10 ++++++++++
 crypto/algif_skcipher.c |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/crypto/Kconfig b/crypto/Kconfig
index a779cab..2ce1877 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -1392,6 +1392,16 @@ config CRYPTO_USER_API_SKCIPHER
 	  See Documentation/crypto/userspace-if.rst and
 	  https://www.chronox.de/libkcapi/html/index.html
 
+config CRYPTO_USER_API_SKCIPHER_INTERNAL
+	bool "Enable access to internal symmetric key cipher algorithms"
+	depends on CRYPTO_USER_API_SKCIPHER
+	default n
+	help
+	  Enable the userspace interface for symmetric key cipher algorithms
+	  marked as internal (CRYPTO_ALG_INTERNAL).
+
+	  Say N unless you know what you are doing.
+
 config CRYPTO_USER_API_RNG
 	tristate "RNG (random number generator) algorithms"
 	depends on NET
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 125d395..028aef7 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -342,6 +342,10 @@ static struct proto_ops algif_skcipher_ops_nokey = {
 
 static void *skcipher_bind(const char *name, u32 type, u32 mask)
 {
+#ifdef CONFIG_CRYPTO_USER_API_SKCIPHER_INTERNAL
+	type |= CRYPTO_ALG_INTERNAL;
+#endif
+
 	return crypto_alloc_skcipher(name, type, mask);
 }
 
-- 
2.7.4
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ