]> git.baikalelectronics.ru Git - 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)
commitb20f04c9fab90d593f5e9d61fa5155f79acbdcd4
treea1a7d34c7f384b85724127b1a0a31153ed98709d
parent046f6cb886236b46938740b05e121d7136e8a52e
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