encrypt_done called from interrupt context on rk3288 crypto driver

2017-05-25 Thread Emil Karlson
Greetings It seems to me that rk3288 crypto driver calls encrypt_done from interrupt context which causes runtime tests to fail. This regression is probably introduced with patch: crypto: xts - Convert to skcipher by Herbert Xu

Re: [PATCH net-next 0/4] kernel TLS

2017-05-25 Thread David Miller
From: Dave Watson Date: Wed, 24 May 2017 09:26:33 -0700 > This series adds support for kernel TLS encryption over TCP sockets. > A standard TCP socket is converted to a TLS socket using a setsockopt. > Only symmetric crypto is done in the kernel, as well as TLS record >

Re: [PATCH net-next 2/4] tcp: export do_tcp_sendpages and tcp_rate_check_app_limited functions

2017-05-25 Thread David Miller
From: Dave Watson Date: Wed, 24 May 2017 09:26:57 -0700 > Export do_tcp_sendpages and tcp_rate_check_app_limited, since tls will need to > sendpages while the socket is already locked. > > tcp_sendpage is exported, but requires the socket lock to not be held already. > >

[PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.

2017-05-25 Thread Harsh Jain
Initialise ctr_completion variable before use. Signed-off-by: Harsh Jain --- crypto/drbg.c |1 + 1 file changed, 1 insertion(+) diff --git a/crypto/drbg.c b/crypto/drbg.c index fa749f4..f1db29d 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1840,6 +1840,7 @@

[PATCH v4 12/14] crypto: caampkc - comply with crypto_akcipher_maxsize()

2017-05-25 Thread Tudor Ambarus
crypto_akcipher_maxsize() asks for the output buffer size without caring for errors. It allways assume that will be called after a valid setkey. Comply with it and return what he wants. Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/caampkc.c | 5 ++--- 1 file

[PATCH v4 11/14] crypto: rsa - comply with crypto_akcipher_maxsize()

2017-05-25 Thread Tudor Ambarus
crypto_akcipher_maxsize() asks for the output buffer size without caring for errors. It allways assume that will be called after a valid setkey. Comply with it and return what he wants. Signed-off-by: Tudor Ambarus --- crypto/rsa.c | 4 ++-- 1 file changed, 2

[PATCH v4 13/14] crypto: qat - comply with crypto_akcipher_maxsize()

2017-05-25 Thread Tudor Ambarus
crypto_akcipher_maxsize() asks for the output buffer size without caring for errors. It allways assume that will be called after a valid setkey. Comply with it and return what he wants. Signed-off-by: Tudor Ambarus --- drivers/crypto/qat/qat_common/qat_asym_algs.c |

[PATCH v4 14/14] crypto: pkcs1pad - comply with crypto_akcipher_maxsize()

2017-05-25 Thread Tudor Ambarus
crypto_akcipher_maxsize() asks for the output buffer size without caring for errors. It allways assume that will be called after a valid setkey. Comply with it and return what he wants. crypto_akcipher_maxsize() now returns an unsigned int. Remove the unnecessary check. Signed-off-by: Tudor

[PATCH v4 01/14] crypto: kpp, (ec)dh - fix typos

2017-05-25 Thread Tudor Ambarus
While here, add missing argument description (ndigits). Signed-off-by: Tudor Ambarus --- crypto/dh.c | 4 ++-- crypto/dh_helper.c| 4 ++-- crypto/ecc.h | 8 +--- crypto/ecdh.c | 4 ++-- crypto/ecdh_helper.c | 4 ++--

[PATCH v4 09/14] crypto: qat - comply with crypto_kpp_maxsize()

2017-05-25 Thread Tudor Ambarus
crypto_kpp_maxsize() asks for the output buffer size without caring for errors. It allways assume that will be called after a valid setkey. Comply with it and return what he wants. Signed-off-by: Tudor Ambarus --- drivers/crypto/qat/qat_common/qat_asym_algs.c | 4

[PATCH v4 08/14] crypto: ecdh - comply with crypto_kpp_maxsize()

2017-05-25 Thread Tudor Ambarus
crypto_kpp_maxsize() asks for the output buffer size without caring for errors. It allways assume that will be called after a valid setkey. Comply with it and return what he wants. nbytes has no sense now, remove it and directly return the maxsize. Signed-off-by: Tudor Ambarus

[PATCH v4 05/14] crypto: dh - fix memleak in setkey

2017-05-25 Thread Tudor Ambarus
setkey can be called multiple times during the existence of the transformation object. In case of multiple setkey calls, the old key was not freed and we leaked memory. Free the old MPI key if any. Signed-off-by: Tudor Ambarus --- crypto/dh.c | 3 +++ 1 file

[PATCH v4 02/14] crypto: ecc - remove unused function arguments

2017-05-25 Thread Tudor Ambarus
Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 8 +++- crypto/ecc.h | 13 +++-- crypto/ecdh.c | 11 +-- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/crypto/ecc.c b/crypto/ecc.c index 414c78a..69b4cc4 100644 ---

[PATCH v4 03/14] crypto: ecc - remove unnecessary casts

2017-05-25 Thread Tudor Ambarus
ecc software implementation works with chunks of u64 data. There were some unnecessary casts to u8 and then back to u64 for the ecc keys. This patch removes the unnecessary casts. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 28 +---

[PATCH v4 04/14] crypto: ecc - don't be selfish on pubkeys

2017-05-25 Thread Tudor Ambarus
Rename ecdh_make_pub_key() to ecc_make_pub_key(). This function might as well be used by ecdsa. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 4 ++-- crypto/ecc.h | 4 ++-- crypto/ecdh.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH v4 06/14] crypto: kpp: maxsize() - assume key is already set

2017-05-25 Thread Tudor Ambarus
As of now, crypto_kpp_maxsize() can not be reached without successfully setting the key for the transformation. kpp algorithm implementations check if the key was set and then return the output buffer size required for the given key. Change the return type to unsigned int and always assume that

[PATCH v4 07/14] crypto: dh - comply with crypto_kpp_maxsize()

2017-05-25 Thread Tudor Ambarus
crypto_kpp_maxsize() asks for the output buffer size without caring for errors. It allways assume that will be called after a valid setkey. Comply with it and return what he wants. Signed-off-by: Tudor Ambarus --- crypto/dh.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH v4 10/14] crypto: akcipher: maxsize() - assume key is already set

2017-05-25 Thread Tudor Ambarus
As of now, crypto_akcipher_maxsize() can not be reached without successfully setting the key for the transformation. akcipher algorithm implementations check if the key was set and then return the output buffer size required for the given key. Change the return type to unsigned int and always

[PATCH v4 00/14] fixes for kpp and akcipher

2017-05-25 Thread Tudor Ambarus
Hi, These are various fixes that I made while reading kpp and akcipher implementations. Changes in v4: - assume key is already set when calling crypto_akcipher/kpp_maxsize() v3 can be found at: http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg25312.html Tudor Ambarus (14):