Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 964f3b3b authored by David Howells's avatar David Howells Committed by Rusty Russell
Browse files

KEYS: Implement asymmetric key type



Create a key type that can be used to represent an asymmetric key type for use
in appropriate cryptographic operations, such as encryption, decryption,
signature generation and signature verification.

The key type is "asymmetric" and can provide access to a variety of
cryptographic algorithms.

Possibly, this would be better as "public_key" - but that has the disadvantage
that "public key" is an overloaded term.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 9a83b465
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1043,5 +1043,6 @@ config CRYPTO_USER_API_SKCIPHER
	  key cipher algorithms.

source "drivers/crypto/Kconfig"
source crypto/asymmetric_keys/Kconfig

endif	# if CRYPTO
+1 −0
Original line number Diff line number Diff line
@@ -96,3 +96,4 @@ obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o
#
obj-$(CONFIG_XOR_BLOCKS) += xor.o
obj-$(CONFIG_ASYNC_CORE) += async_tx/
obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/
+13 −0
Original line number Diff line number Diff line
menuconfig ASYMMETRIC_KEY_TYPE
	tristate "Asymmetric (public-key cryptographic) key type"
	depends on KEYS
	help
	  This option provides support for a key type that holds the data for
	  the asymmetric keys used for public key cryptographic operations such
	  as encryption, decryption, signature generation and signature
	  verification.

if ASYMMETRIC_KEY_TYPE


endif # ASYMMETRIC_KEY_TYPE
+7 −0
Original line number Diff line number Diff line
#
# Makefile for asymmetric cryptographic keys
#

obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys.o

asymmetric_keys-y := asymmetric_type.o
+15 −0
Original line number Diff line number Diff line
/* Internal definitions for asymmetric key type
 *
 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public Licence
 * as published by the Free Software Foundation; either version
 * 2 of the Licence, or (at your option) any later version.
 */

static inline const char *asymmetric_key_id(const struct key *key)
{
	return key->type_data.p[1];
}
Loading