| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* Signature verification |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved. |
|---|
| 4 | 5 | * 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. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #ifndef _LINUX_VERIFICATION_H |
|---|
| .. | .. |
|---|
| 17 | 13 | * should be used. |
|---|
| 18 | 14 | */ |
|---|
| 19 | 15 | #define VERIFY_USE_SECONDARY_KEYRING ((struct key *)1UL) |
|---|
| 16 | +#define VERIFY_USE_PLATFORM_KEYRING ((struct key *)2UL) |
|---|
| 20 | 17 | |
|---|
| 21 | 18 | /* |
|---|
| 22 | 19 | * The use to which an asymmetric key is being put. |
|---|
| .. | .. |
|---|
| 35 | 32 | #ifdef CONFIG_SYSTEM_DATA_VERIFICATION |
|---|
| 36 | 33 | |
|---|
| 37 | 34 | struct key; |
|---|
| 35 | +struct pkcs7_message; |
|---|
| 38 | 36 | |
|---|
| 39 | 37 | extern int verify_pkcs7_signature(const void *data, size_t len, |
|---|
| 40 | 38 | const void *raw_pkcs7, size_t pkcs7_len, |
|---|
| .. | .. |
|---|
| 44 | 42 | const void *data, size_t len, |
|---|
| 45 | 43 | size_t asn1hdrlen), |
|---|
| 46 | 44 | 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); |
|---|
| 47 | 54 | |
|---|
| 48 | 55 | #ifdef CONFIG_SIGNED_PE_FILE_VERIFICATION |
|---|
| 49 | 56 | extern int verify_pefile_signature(const void *pebuf, unsigned pelen, |
|---|