]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
crypto: algif_skcipher - overhaul memory management
authorStephan Mueller <smueller@chronox.de>
Sun, 25 Jun 2017 15:12:39 +0000 (17:12 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 28 Jul 2017 09:54:30 +0000 (17:54 +0800)
commite870456d8e7c8d57c059ea479b5aadbb55ff4c3a
treea1a7d34c7f384b85724127b1a0a31153ed98709d
parent10a515ddb5f19a1ff0b9882c430b4427843169f3
crypto: algif_skcipher - overhaul memory management

The updated memory management is described in the top part of the code.
As one benefit of the changed memory management, the AIO and synchronous
operation is now implemented in one common function. The AF_ALG
operation uses the async kernel crypto API interface for each cipher
operation. Thus, the only difference between the AIO and sync operation
types visible from user space is:

1. the callback function to be invoked when the asynchronous operation
   is completed

2. whether to wait for the completion of the kernel crypto API operation
   or not

In addition, the code structure is adjusted to match the structure of
algif_aead for easier code assessment.

The user space interface changed slightly as follows: the old AIO
operation returned zero upon success and < 0 in case of an error to user
space. As all other AF_ALG interfaces (including the sync skcipher
interface) returned the number of processed bytes upon success and < 0
in case of an error, the new skcipher interface (regardless of AIO or
sync) returns the number of processed bytes in case of success.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_skcipher.c