Commit 817a63f2 authored by Sergei Golubchik's avatar Sergei Golubchik

pass the correct key length to encryption routines

parent 2643cc54
...@@ -411,7 +411,6 @@ static int ma_encrypt(MARIA_CRYPT_DATA *crypt_data, ...@@ -411,7 +411,6 @@ static int ma_encrypt(MARIA_CRYPT_DATA *crypt_data,
int rc; int rc;
uint32 dstlen; uint32 dstlen;
uchar counter[COUNTER_LEN]; uchar counter[COUNTER_LEN];
uchar *key= crypt_data->iv;
// create counter block // create counter block
memcpy(counter + 0, crypt_data->iv + CRYPT_SCHEME_1_IV_LEN, 4); memcpy(counter + 0, crypt_data->iv + CRYPT_SCHEME_1_IV_LEN, 4);
...@@ -420,7 +419,7 @@ static int ma_encrypt(MARIA_CRYPT_DATA *crypt_data, ...@@ -420,7 +419,7 @@ static int ma_encrypt(MARIA_CRYPT_DATA *crypt_data,
rc = my_aes_encrypt_dynamic(src, size, rc = my_aes_encrypt_dynamic(src, size,
dst, &dstlen, dst, &dstlen,
key, sizeof(crypt_data->iv), crypt_data->iv, CRYPT_SCHEME_1_IV_LEN,
counter, sizeof(counter), counter, sizeof(counter),
1); 1);
...@@ -447,7 +446,6 @@ static int ma_decrypt(MARIA_CRYPT_DATA *crypt_data, ...@@ -447,7 +446,6 @@ static int ma_decrypt(MARIA_CRYPT_DATA *crypt_data,
int rc; int rc;
uint32 dstlen; uint32 dstlen;
uchar counter[COUNTER_LEN]; uchar counter[COUNTER_LEN];
uchar *key= crypt_data->iv;
// create counter block // create counter block
memcpy(counter + 0, crypt_data->iv + CRYPT_SCHEME_1_IV_LEN, 4); memcpy(counter + 0, crypt_data->iv + CRYPT_SCHEME_1_IV_LEN, 4);
...@@ -456,7 +454,7 @@ static int ma_decrypt(MARIA_CRYPT_DATA *crypt_data, ...@@ -456,7 +454,7 @@ static int ma_decrypt(MARIA_CRYPT_DATA *crypt_data,
rc = my_aes_decrypt_dynamic(src, size, rc = my_aes_decrypt_dynamic(src, size,
dst, &dstlen, dst, &dstlen,
key, sizeof(crypt_data->iv), crypt_data->iv, CRYPT_SCHEME_1_IV_LEN,
counter, sizeof(counter), counter, sizeof(counter),
1); 1);
......
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