Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Kernelspace interface to the pkey device driver |
| 4 | * |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 5 | * Copyright IBM Corp. 2016,2019 |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 6 | * |
| 7 | * Author: Harald Freudenberger <freude@de.ibm.com> |
| 8 | * |
| 9 | */ |
| 10 | |
| 11 | #ifndef _KAPI_PKEY_H |
| 12 | #define _KAPI_PKEY_H |
| 13 | |
| 14 | #include <linux/ioctl.h> |
| 15 | #include <linux/types.h> |
| 16 | #include <uapi/asm/pkey.h> |
| 17 | |
| 18 | /* |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 19 | * In-kernel API: Transform an key blob (of any type) into a protected key. |
| 20 | * @param key pointer to a buffer containing the key blob |
| 21 | * @param keylen size of the key blob in bytes |
| 22 | * @param protkey pointer to buffer receiving the protected key |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 23 | * @return 0 on success, negative errno value on failure |
| 24 | */ |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 25 | int pkey_keyblob2pkey(const u8 *key, u32 keylen, |
| 26 | struct pkey_protkey *protkey); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 27 | |
| 28 | #endif /* _KAPI_PKEY_H */ |