[PATCH 06/15] crypto: algif_skcipher - Disallow nonincremental algorithms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As algif_skcipher does not support nonincremental algorithms, check
for them and return ENOSYS.  If necessary support for them could
be added in the same way as AEAD.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
---
 crypto/algif_skcipher.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index e22516c3d285..ac59fd9ea4e4 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -131,6 +131,10 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
 	 * full block size buffers.
 	 */
 	if (ctx->more || len < ctx->used) {
+		err = -ENOSYS;
+		if (!crypto_skcipher_isincremental(tfm))
+			goto free;
+
 		if (ctx->more && ctx->used - ts < len)
 			len = ctx->used - ts;
 		len -= len % bs;
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux