Skip to content

Commit 11aa54b

Browse files
hfreudeAlexander Gordeev
authored andcommitted
s390/pkey: Forward keygenflags to ep11_unwrapkey
The pkey ioctl PKEY_CLR2SECK2 describes in the pkey.h header file the parameter 'keygenflags' which is forwarded to the handler functions which actually deal with the clear key to secure key operation. The ep11 handler module function ep11_clr2keyblob() function receives this parameter but does not forward it to the underlying function ep11_unwrapkey() on invocation. So in the end the user of this ioctl could not forward additional key generation flags to the ep11 implementation and thus was unable to modify the key generation process in any way. So now call ep11_unwrapkey() with the real keygenflags instead of 0 and thus the user of this ioctl can for example via keygenflags provide valid combinations of XCP_BLOB_* flags. Suggested-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent b3597eb commit 11aa54b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/s390/crypto/zcrypt_ep11misc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,9 @@ int ep11_clr2keyblob(u16 card, u16 domain, u32 keybitsize, u32 keygenflags,
14051405
/* Step 3: import the encrypted key value as a new key */
14061406
rc = ep11_unwrapkey(card, domain, kek, keklen,
14071407
encbuf, encbuflen, 0, def_iv,
1408-
keybitsize, 0, keybuf, keybufsize, keytype, xflags);
1408+
keybitsize, keygenflags,
1409+
keybuf, keybufsize,
1410+
keytype, xflags);
14091411
if (rc) {
14101412
ZCRYPT_DBF_ERR("%s importing key value as new key failed, rc=%d\n",
14111413
__func__, rc);

0 commit comments

Comments
 (0)