From a5a1f7eac398192060b6b1c5aae79a6695791b59 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 29 Nov 2009 01:04:10 +0200 Subject: Only check that size is multiple of blocksize on ciphers. --- Makefile | 2 +- cryptodev.c | 2 +- cryptodev.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 12bb5e2..7c4a33b 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ build: install: make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install @echo "Installing cryptodev.h in /usr/include/crypto ..." - @install -D cryptodev.h /usr/include/crypto + @install -D cryptodev.h /usr/include/crypto/cryptodev.h clean: make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean diff --git a/cryptodev.c b/cryptodev.c index 76581c4..f09a38d 100644 --- a/cryptodev.c +++ b/cryptodev.c @@ -465,7 +465,7 @@ static int crypto_runv(struct fcrypt *fcr, struct crypt_opv *copv) for (i=0;iiovec_cnt;i++) { nbytes = copv->iovec[i].len; - if (unlikely(bdesc.tfm && (nbytes % blocksize))) { + if (unlikely(bdesc.tfm && (copv->iovec[i].op_flags & IOP_CIPHER) && (nbytes % blocksize))) { dprintk(1, KERN_ERR, "data size (%zu) isn't a multiple of block size (%u)\n", nbytes, crypto_blkcipher_blocksize(ses_ptr->tfm)); diff --git a/cryptodev.h b/cryptodev.h index 891ad2a..55c3279 100644 --- a/cryptodev.h +++ b/cryptodev.h @@ -49,7 +49,7 @@ enum { CRYPTO_ALGORITHM_MAX }; -#define CRYPTO_CIPHER_MAX_KEY_LEN 512 +#define CRYPTO_CIPHER_MAX_KEY_LEN 64 #define CRYPTO_HMAC_MAX_KEY_LEN 512 #define HASH_MAX_LEN 64 -- cgit