hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/linux/verification.h
....@@ -1,12 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /* Signature verification
23 *
34 * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
45 * Written by David Howells (dhowells@redhat.com)
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public Licence
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the Licence, or (at your option) any later version.
106 */
117
128 #ifndef _LINUX_VERIFICATION_H
....@@ -17,6 +13,7 @@
1713 * should be used.
1814 */
1915 #define VERIFY_USE_SECONDARY_KEYRING ((struct key *)1UL)
16
+#define VERIFY_USE_PLATFORM_KEYRING ((struct key *)2UL)
2017
2118 /*
2219 * The use to which an asymmetric key is being put.
....@@ -35,6 +32,7 @@
3532 #ifdef CONFIG_SYSTEM_DATA_VERIFICATION
3633
3734 struct key;
35
+struct pkcs7_message;
3836
3937 extern int verify_pkcs7_signature(const void *data, size_t len,
4038 const void *raw_pkcs7, size_t pkcs7_len,
....@@ -44,6 +42,15 @@
4442 const void *data, size_t len,
4543 size_t asn1hdrlen),
4644 void *ctx);
45
+extern int verify_pkcs7_message_sig(const void *data, size_t len,
46
+ struct pkcs7_message *pkcs7,
47
+ struct key *trusted_keys,
48
+ enum key_being_used_for usage,
49
+ int (*view_content)(void *ctx,
50
+ const void *data,
51
+ size_t len,
52
+ size_t asn1hdrlen),
53
+ void *ctx);
4754
4855 #ifdef CONFIG_SIGNED_PE_FILE_VERIFICATION
4956 extern int verify_pefile_signature(const void *pebuf, unsigned pelen,