| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* Definitions for key type implementations |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (C) 2007 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_KEY_TYPE_H |
|---|
| .. | .. |
|---|
| 14 | 10 | |
|---|
| 15 | 11 | #include <linux/key.h> |
|---|
| 16 | 12 | #include <linux/errno.h> |
|---|
| 13 | +#include <linux/android_kabi.h> |
|---|
| 17 | 14 | |
|---|
| 18 | 15 | #ifdef CONFIG_KEYS |
|---|
| 16 | + |
|---|
| 17 | +struct kernel_pkey_query; |
|---|
| 18 | +struct kernel_pkey_params; |
|---|
| 19 | 19 | |
|---|
| 20 | 20 | /* |
|---|
| 21 | 21 | * Pre-parsed payload, used by key add, update and instantiate. |
|---|
| .. | .. |
|---|
| 70 | 70 | * function only needs to be called if the real datalen is different |
|---|
| 71 | 71 | */ |
|---|
| 72 | 72 | size_t def_datalen; |
|---|
| 73 | + |
|---|
| 74 | + unsigned int flags; |
|---|
| 75 | +#define KEY_TYPE_NET_DOMAIN 0x00000001 /* Keys of this type have a net namespace domain */ |
|---|
| 73 | 76 | |
|---|
| 74 | 77 | /* vet a description */ |
|---|
| 75 | 78 | int (*vet_description)(const char *description); |
|---|
| .. | .. |
|---|
| 145 | 148 | */ |
|---|
| 146 | 149 | struct key_restriction *(*lookup_restriction)(const char *params); |
|---|
| 147 | 150 | |
|---|
| 151 | + /* Asymmetric key accessor functions. */ |
|---|
| 152 | + int (*asym_query)(const struct kernel_pkey_params *params, |
|---|
| 153 | + struct kernel_pkey_query *info); |
|---|
| 154 | + int (*asym_eds_op)(struct kernel_pkey_params *params, |
|---|
| 155 | + const void *in, void *out); |
|---|
| 156 | + int (*asym_verify_signature)(struct kernel_pkey_params *params, |
|---|
| 157 | + const void *in, const void *in2); |
|---|
| 158 | + |
|---|
| 159 | + ANDROID_KABI_RESERVE(1); |
|---|
| 160 | + ANDROID_KABI_RESERVE(2); |
|---|
| 161 | + |
|---|
| 148 | 162 | /* internal fields */ |
|---|
| 149 | 163 | struct list_head link; /* link in types list */ |
|---|
| 150 | 164 | struct lock_class_key lock_class; /* key->sem lock class */ |
|---|