linux/drivers/s390/crypto
Harald Freudenberger fa6999e326 s390/pkey: support CCA and EP11 secure ECC private keys
This patch extends the pkey kernel module to support CCA
and EP11 secure ECC (private) keys as source for deriving
ECC protected (private) keys.

There is yet another new ioctl to support this: PKEY_KBLOB2PROTK3
can handle all the old keys plus CCA and EP11 secure ECC keys.
For details see ioctl description in pkey.h.

The CPACF unit currently only supports a subset of 5
different ECC curves (P-256, P-384, P-521, ED25519, ED448) and
so only keys of this curve type can be transformed into
protected keys. However, the pkey and the cca/ep11 low level
functions do not check this but simple pass-through the key
blob to the firmware onto the crypto cards. So most likely
the failure will be a response carrying an error code
resulting in user space errno value EIO instead of EINVAL.

Deriving a protected key from an EP11 ECC secure key
requires a CEX7 in EP11 mode. Deriving a protected key from
an CCA ECC secure key requires a CEX7 in CCA mode.

Together with this new ioctl the ioctls for querying lists
of apqns (PKEY_APQNS4K and PKEY_APQNS4KT) have been extended
to support EP11 and CCA ECC secure key type and key blobs.

Together with this ioctl there comes a new struct ep11kblob_header
which is to be prepended onto the EP11 key blob. See details
in pkey.h for the fields in there. The older EP11 AES key blob
with some info stored in the (unused) session field is also
supported with this new ioctl.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2020-09-24 10:03:28 +02:00
..
ap_bus.c s390/ap: remove unnecessary spin_lock_init() 2020-09-17 14:11:04 +02:00
ap_bus.h mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
ap_card.c s390/ap: introduce new ap function ap_get_qdev() 2020-05-20 10:22:51 +02:00
ap_debug.h s390/zcrypt: Make ap init functions static. 2018-04-10 07:39:01 +02:00
ap_queue.c s390/ap: rename and clarify ap state machine related stuff 2020-07-03 10:49:49 +02:00
Makefile s390/zcrypt: add new low level ep11 functions support file 2020-01-30 13:07:55 +01:00
pkey_api.c s390/pkey: support CCA and EP11 secure ECC private keys 2020-09-24 10:03:28 +02:00
vfio_ap_drv.c s390/zcrypt: CEX7S exploitation support 2019-09-19 12:56:06 +02:00
vfio_ap_ops.c s390/vfio: use fallthrough; 2020-03-25 12:39:38 +01:00
vfio_ap_private.h s390: ap: implement PAPQ AQIC interception in kernel 2019-07-02 16:00:28 +02:00
zcrypt_api.c s390/zcrypt: remove set_fs() invocation in zcrypt device driver 2020-09-17 14:11:03 +02:00
zcrypt_api.h s390/zcrypt: remove set_fs() invocation in zcrypt device driver 2020-09-17 14:11:03 +02:00
zcrypt_card.c s390/zcrypt: replace snprintf/sprintf with scnprintf 2020-03-23 13:41:54 +01:00
zcrypt_cca_key.h s390/zcrypt: zcrypt device driver cleanup 2018-10-09 11:21:35 +02:00
zcrypt_ccamisc.c s390/pkey: support CCA and EP11 secure ECC private keys 2020-09-24 10:03:28 +02:00
zcrypt_ccamisc.h s390/pkey: support CCA and EP11 secure ECC private keys 2020-09-24 10:03:28 +02:00
zcrypt_cex2a.c s390/ap: remove power management code from ap bus and drivers 2020-03-27 10:22:47 +01:00
zcrypt_cex2a.h s390/zcrypt: zcrypt device driver cleanup 2018-10-09 11:21:35 +02:00
zcrypt_cex2c.c s390/zcrypt: Support for CCA APKA master keys 2020-09-24 10:03:28 +02:00
zcrypt_cex2c.h s390/zcrypt: zcrypt device driver cleanup 2018-10-09 11:21:35 +02:00
zcrypt_cex4.c s390/zcrypt: Support for CCA APKA master keys 2020-09-24 10:03:28 +02:00
zcrypt_cex4.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zcrypt_debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zcrypt_ep11misc.c s390/pkey: support CCA and EP11 secure ECC private keys 2020-09-24 10:03:28 +02:00
zcrypt_ep11misc.h s390/pkey: support CCA and EP11 secure ECC private keys 2020-09-24 10:03:28 +02:00
zcrypt_error.h s390/zcrypt: code beautification and struct field renames 2020-07-03 10:49:34 +02:00
zcrypt_msgtype6.c s390/zcrypt: remove set_fs() invocation in zcrypt device driver 2020-09-17 14:11:03 +02:00
zcrypt_msgtype6.h s390/zcrypt: remove set_fs() invocation in zcrypt device driver 2020-09-17 14:11:03 +02:00
zcrypt_msgtype50.c s390/zcrypt: code beautification and struct field renames 2020-07-03 10:49:34 +02:00
zcrypt_msgtype50.h s390/zcrypt: zcrypt device driver cleanup 2018-10-09 11:21:35 +02:00
zcrypt_queue.c s390/zcrypt: code beautification and struct field renames 2020-07-03 10:49:34 +02:00