| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* System keyring containing trusted public keys. |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (C) 2013 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 _KEYS_SYSTEM_KEYRING_H |
|---|
| .. | .. |
|---|
| 35 | 31 | #define restrict_link_by_builtin_and_secondary_trusted restrict_link_by_builtin_trusted |
|---|
| 36 | 32 | #endif |
|---|
| 37 | 33 | |
|---|
| 34 | +extern struct pkcs7_message *pkcs7; |
|---|
| 38 | 35 | #ifdef CONFIG_SYSTEM_BLACKLIST_KEYRING |
|---|
| 39 | 36 | extern int mark_hash_blacklisted(const char *hash); |
|---|
| 40 | 37 | extern int is_hash_blacklisted(const u8 *hash, size_t hash_len, |
|---|
| 41 | 38 | const char *type); |
|---|
| 39 | +extern int is_binary_blacklisted(const u8 *hash, size_t hash_len); |
|---|
| 42 | 40 | #else |
|---|
| 43 | 41 | static inline int is_hash_blacklisted(const u8 *hash, size_t hash_len, |
|---|
| 44 | 42 | const char *type) |
|---|
| 45 | 43 | { |
|---|
| 46 | 44 | return 0; |
|---|
| 45 | +} |
|---|
| 46 | + |
|---|
| 47 | +static inline int is_binary_blacklisted(const u8 *hash, size_t hash_len) |
|---|
| 48 | +{ |
|---|
| 49 | + return 0; |
|---|
| 50 | +} |
|---|
| 51 | +#endif |
|---|
| 52 | + |
|---|
| 53 | +#ifdef CONFIG_SYSTEM_REVOCATION_LIST |
|---|
| 54 | +extern int add_key_to_revocation_list(const char *data, size_t size); |
|---|
| 55 | +extern int is_key_on_revocation_list(struct pkcs7_message *pkcs7); |
|---|
| 56 | +#else |
|---|
| 57 | +static inline int add_key_to_revocation_list(const char *data, size_t size) |
|---|
| 58 | +{ |
|---|
| 59 | + return 0; |
|---|
| 60 | +} |
|---|
| 61 | +static inline int is_key_on_revocation_list(struct pkcs7_message *pkcs7) |
|---|
| 62 | +{ |
|---|
| 63 | + return -ENOKEY; |
|---|
| 47 | 64 | } |
|---|
| 48 | 65 | #endif |
|---|
| 49 | 66 | |
|---|
| .. | .. |
|---|
| 61 | 78 | } |
|---|
| 62 | 79 | #endif /* CONFIG_IMA_BLACKLIST_KEYRING */ |
|---|
| 63 | 80 | |
|---|
| 81 | +#if defined(CONFIG_INTEGRITY_PLATFORM_KEYRING) && \ |
|---|
| 82 | + defined(CONFIG_SYSTEM_TRUSTED_KEYRING) |
|---|
| 83 | +extern void __init set_platform_trusted_keys(struct key *keyring); |
|---|
| 84 | +#else |
|---|
| 85 | +static inline void set_platform_trusted_keys(struct key *keyring) |
|---|
| 86 | +{ |
|---|
| 87 | +} |
|---|
| 88 | +#endif |
|---|
| 64 | 89 | |
|---|
| 65 | 90 | #endif /* _KEYS_SYSTEM_KEYRING_H */ |
|---|