]> git.baikalelectronics.ru Git - kernel.git/commit
s390/paes: Prepare paes functions for large key blobs
authorHarald Freudenberger <freude@linux.ibm.com>
Fri, 19 Jul 2019 13:22:26 +0000 (15:22 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 21 Aug 2019 10:58:54 +0000 (12:58 +0200)
commitd17b5c7b06bea867936f2af2490ff549baad2f1a
tree8dbf1a73746fb3e9657f9033bf807f25acfc647b
parent9f014549afe0f7f8ef6600c155231c0b78dee3fd
s390/paes: Prepare paes functions for large key blobs

The context used to store the key blob used a fixed 80 bytes
buffer. And all the set_key functions did not even check the given key
size. With CCA variable length AES cipher keys there come key blobs
with about 136 bytes and maybe in the future there will arise the need
to store even bigger key blobs.

This patch reworks the paes set_key functions and the context
buffers to work with small key blobs (<= 128 bytes) directly in the
context buffer and larger blobs by allocating additional memory and
storing the pointer in the context buffer. If there has been memory
allocated for storing a key blob, it also needs to be freed on release
of the tfm. So all the paes ciphers now have a init and exit function
implemented for this job.

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>
arch/s390/crypto/paes_s390.c