diff options
author | Richard Levitte <levitte@openssl.org> | 2004-12-28 10:35:13 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2004-12-28 10:35:13 +0000 |
commit | 37b11ca78e4a5f71fc1558927a732a8783bb347a (patch) | |
tree | 64f6733fa2259c5b2175cdaa774ee97b50df1759 | |
parent | a17af9e2773581d2848ccfcf7afe651696f9421c (diff) |
iv needs to be const because it sometimes takes it's value from a
const.
-rw-r--r-- | crypto/aes/aes_cbc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/aes/aes_cbc.c b/crypto/aes/aes_cbc.c index 41d538f2b5..f909aaf47a 100644 --- a/crypto/aes/aes_cbc.c +++ b/crypto/aes/aes_cbc.c @@ -65,7 +65,8 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, unsigned long n; unsigned long len = length; - unsigned char tmp[AES_BLOCK_SIZE], *iv = ivec; + unsigned char tmp[AES_BLOCK_SIZE]; + const unsigned char *iv = ivec; assert(in && out && key && ivec); assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc)); @@ -87,7 +88,7 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, out[n] = iv[n]; AES_encrypt(out, out, key); iv = out; - } + } memcpy(ivec,iv,AES_BLOCK_SIZE); } else if (in != out) { while (len >= AES_BLOCK_SIZE) { @@ -123,6 +124,6 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, for(n=0; n < len; ++n) out[n] = tmp[n] ^ ivec[n]; memcpy(ivec, tmp, AES_BLOCK_SIZE); - } + } } } |