Commit f07ef1de authored by David Sterba's avatar David Sterba Committed by Herbert Xu

crypto: tcrypt - do not attempt to write to readonly variable

Commit da7f033d (”crypto: cryptomgr - Add test infrastructure”) added a
const to variable which is later used as target buffer of memcpy.

crypto/tcrypt.c:217:12: warning: passing 'const char (*)[128]' to parameter of type 'void *' discards qualifiers
                                memset(&iv, 0xff, iv_len);


crypto/tcrypt.c:test_cipher_speed()

-       unsigned char *key, iv[128];
+       const char *key, iv[128];
...
        memset(&iv, 0xff, iv_len);
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 442a4fff
......@@ -146,7 +146,8 @@ static void test_cipher_speed(const char *algo, int enc, unsigned int sec,
unsigned int tcount, u8 *keysize)
{
unsigned int ret, i, j, iv_len;
const char *key, iv[128];
const char *key;
char iv[128];
struct crypto_blkcipher *tfm;
struct blkcipher_desc desc;
const char *e;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment