• Harald Freudenberger's avatar
    s390/paes: Prepare paes functions for large key blobs · 416f79c2
    Harald Freudenberger authored
    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: default avatarHarald Freudenberger <freude@linux.ibm.com>
    Reviewed-by: default avatarIngo Franzki <ifranzki@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    416f79c2
paes_s390.c 19.5 KB