diff options
author | David Sterba <dsterba@suse.cz> | 2011-03-04 15:28:52 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2011-03-04 15:28:52 +0800 |
commit | 91814f5281764f93c8a5d0281b721b76086a0389 (patch) | |
tree | f4b627160b02c95ef24aec04c6a16b9ce646341c /crypto | |
parent | c4c28e13752e3fe7e95dbc8220d0c31892dfe717 (diff) | |
download | linux-crypto-91814f5281764f93c8a5d0281b721b76086a0389.tar.gz linux-crypto-91814f5281764f93c8a5d0281b721b76086a0389.zip |
crypto: tcrypt - do not attempt to write to readonly variable
Commit c711937af9a55d9 (”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: David Sterba <dsterba@suse.cz>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/tcrypt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 9aac5e58..e912ea5d 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -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; |