aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2016-01-26 18:54:55 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-01-27 20:36:25 +0800
commite9f6452e0e55ceea004f5bc0802fb14778d16c42 (patch)
treefac475037fed7e3376772af75fb70c7541f26558 /net/ceph
parentcrypto: compress - remove unused pcomp interface (diff)
downloadlinux-dev-e9f6452e0e55ceea004f5bc0802fb14778d16c42.tar.xz
linux-dev-e9f6452e0e55ceea004f5bc0802fb14778d16c42.zip
libceph: Remove unnecessary ivsize variables
This patch removes the unnecessary ivsize variabls as they always have the value of AES_BLOCK_SIZE. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/crypto.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index fb9cb2bb0894..db2847ac5f12 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -166,8 +166,7 @@ static int ceph_aes_encrypt(const void *key, int key_len,
struct crypto_skcipher *tfm = ceph_crypto_alloc_cipher();
SKCIPHER_REQUEST_ON_STACK(req, tfm);
int ret;
- int ivsize = AES_BLOCK_SIZE;
- char iv[ivsize];
+ char iv[AES_BLOCK_SIZE];
size_t zero_padding = (0x10 - (src_len & 0x0f));
char pad[16];
@@ -186,7 +185,7 @@ static int ceph_aes_encrypt(const void *key, int key_len,
goto out_tfm;
crypto_skcipher_setkey((void *)tfm, key, key_len);
- memcpy(iv, aes_iv, ivsize);
+ memcpy(iv, aes_iv, AES_BLOCK_SIZE);
skcipher_request_set_tfm(req, tfm);
skcipher_request_set_callback(req, 0, NULL, NULL);
@@ -229,8 +228,7 @@ static int ceph_aes_encrypt2(const void *key, int key_len, void *dst,
struct crypto_skcipher *tfm = ceph_crypto_alloc_cipher();
SKCIPHER_REQUEST_ON_STACK(req, tfm);
int ret;
- int ivsize = AES_BLOCK_SIZE;
- char iv[ivsize];
+ char iv[AES_BLOCK_SIZE];
size_t zero_padding = (0x10 - ((src1_len + src2_len) & 0x0f));
char pad[16];
@@ -250,7 +248,7 @@ static int ceph_aes_encrypt2(const void *key, int key_len, void *dst,
goto out_tfm;
crypto_skcipher_setkey((void *)tfm, key, key_len);
- memcpy(iv, aes_iv, ivsize);
+ memcpy(iv, aes_iv, AES_BLOCK_SIZE);
skcipher_request_set_tfm(req, tfm);
skcipher_request_set_callback(req, 0, NULL, NULL);
@@ -294,8 +292,7 @@ static int ceph_aes_decrypt(const void *key, int key_len,
struct crypto_skcipher *tfm = ceph_crypto_alloc_cipher();
SKCIPHER_REQUEST_ON_STACK(req, tfm);
char pad[16];
- int ivsize = AES_BLOCK_SIZE;
- char iv[16];
+ char iv[AES_BLOCK_SIZE];
int ret;
int last_byte;
@@ -310,7 +307,7 @@ static int ceph_aes_decrypt(const void *key, int key_len,
goto out_tfm;
crypto_skcipher_setkey((void *)tfm, key, key_len);
- memcpy(iv, aes_iv, ivsize);
+ memcpy(iv, aes_iv, AES_BLOCK_SIZE);
skcipher_request_set_tfm(req, tfm);
skcipher_request_set_callback(req, 0, NULL, NULL);
@@ -363,8 +360,7 @@ static int ceph_aes_decrypt2(const void *key, int key_len,
struct crypto_skcipher *tfm = ceph_crypto_alloc_cipher();
SKCIPHER_REQUEST_ON_STACK(req, tfm);
char pad[16];
- int ivsize = AES_BLOCK_SIZE;
- char iv[ivsize];
+ char iv[AES_BLOCK_SIZE];
int ret;
int last_byte;
@@ -380,7 +376,7 @@ static int ceph_aes_decrypt2(const void *key, int key_len,
goto out_tfm;
crypto_skcipher_setkey((void *)tfm, key, key_len);
- memcpy(iv, aes_iv, ivsize);
+ memcpy(iv, aes_iv, AES_BLOCK_SIZE);
skcipher_request_set_tfm(req, tfm);
skcipher_request_set_callback(req, 0, NULL, NULL);