From e636c8d336489bf3eed5878299e6cc045bbad077 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Tue, 20 Feb 2024 01:17:29 +0000 Subject: [PATCH] debug lk --- kernel/include/crypto/public_key.h | 33 +++++++++++++++++++++++---------- 1 files changed, 23 insertions(+), 10 deletions(-) diff --git a/kernel/include/crypto/public_key.h b/kernel/include/crypto/public_key.h index 052e26f..948c520 100644 --- a/kernel/include/crypto/public_key.h +++ b/kernel/include/crypto/public_key.h @@ -1,18 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* Asymmetric public-key algorithm definitions * - * See Documentation/crypto/asymmetric-keys.txt + * See Documentation/crypto/asymmetric-keys.rst * * 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. */ #ifndef _LINUX_PUBLIC_KEY_H #define _LINUX_PUBLIC_KEY_H + +#include <linux/keyctl.h> +#include <linux/oid_registry.h> +#include <crypto/akcipher.h> /* * Cryptographic data for the public-key subtype of the asymmetric key type. @@ -23,6 +23,10 @@ struct public_key { void *key; u32 keylen; + enum OID algo; + void *params; + u32 paramlen; + bool key_is_private; const char *id_type; const char *pkey_algo; }; @@ -35,11 +39,14 @@ struct public_key_signature { struct asymmetric_key_id *auth_ids[2]; u8 *s; /* Signature */ - u8 *digest; u32 s_size; /* Number of bytes in signature */ - u32 digest_size; /* Number of bytes in digest */ + u8 *digest; + u8 digest_size; /* Number of bytes in digest */ const char *pkey_algo; const char *hash_algo; + const char *encoding; + const void *data; + unsigned int data_size; }; extern void public_key_signature_free(struct public_key_signature *sig); @@ -65,8 +72,14 @@ const union key_payload *payload, struct key *trusted); -extern int verify_signature(const struct key *key, - const struct public_key_signature *sig); +extern int query_asymmetric_key(const struct kernel_pkey_params *, + struct kernel_pkey_query *); + +extern int encrypt_blob(struct kernel_pkey_params *, const void *, void *); +extern int decrypt_blob(struct kernel_pkey_params *, const void *, void *); +extern int create_signature(struct kernel_pkey_params *, const void *, void *); +extern int verify_signature(const struct key *, + const struct public_key_signature *); int public_key_verify_signature(const struct public_key *pkey, const struct public_key_signature *sig); -- Gitblit v1.6.2