summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/pkey.h
diff options
context:
space:
mode:
authorIngo Franzki <ifranzki@linux.ibm.com>2018-08-23 10:06:26 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-10-09 11:21:38 +0200
commita45a5c7d36a53646094c2ba4970777a20ec0ec42 (patch)
treee31f212b548141d0fd3b1240674b0417eb28d9cc /arch/s390/include/asm/pkey.h
parentaa55bf5f022271903fe8a71e08be3e217e1b6363 (diff)
s390/pkey: Introduce new API for random protected key generation
This patch introduces a new ioctl API and in-kernel API to generate a random protected key. The protected key is generated in a way that the effective clear key is never exposed in clear. Both APIs are described in detail in the header files arch/s390/include/asm/pkey.h and arch/s390/include/uapi/asm/pkey.h. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Reviewed-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/pkey.h')
-rw-r--r--arch/s390/include/asm/pkey.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/s390/include/asm/pkey.h b/arch/s390/include/asm/pkey.h
index 053117ba7328..c931818b9921 100644
--- a/arch/s390/include/asm/pkey.h
+++ b/arch/s390/include/asm/pkey.h
@@ -109,4 +109,12 @@ int pkey_verifykey(const struct pkey_seckey *seckey,
u16 *pcardnr, u16 *pdomain,
u16 *pkeysize, u32 *pattributes);
+/*
+ * In-kernel API: Generate (AES) random protected key.
+ * @param keytype one of the PKEY_KEYTYPE values
+ * @param protkey pointer to buffer receiving the protected key
+ * @return 0 on success, negative errno value on failure
+ */
+int pkey_genprotkey(__u32 keytype, struct pkey_protkey *protkey);
+
#endif /* _KAPI_PKEY_H */