summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-09-17 23:46:53 +0300
committermonty@mashka.mysql.fi <>2002-09-17 23:46:53 +0300
commit7f55d9263749ec0b0c8dacea1fd1616c0262bd5e (patch)
treec51e7c970efa7653918302f4513422428385158d /mysys
parent3bb2660d1047f33988ae9703dd8172d059037fdc (diff)
downloadmariadb-git-7f55d9263749ec0b0c8dacea1fd1616c0262bd5e.tar.gz
fixed so that --ssl and --skip-ssl works with the MySQL clients.
Fixed core dump bug when sending wrong string to AES_DECRYPT()
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_aes.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mysys/my_aes.c b/mysys/my_aes.c
index 10ef62ae0a5..a3618e44b82 100644
--- a/mysys/my_aes.c
+++ b/mysys/my_aes.c
@@ -178,7 +178,7 @@ int my_aes_decrypt(const char *source, int source_length, char *dest,
char block[AES_BLOCK_SIZE]; /* 128 bit block used for padding */
int rc; /* Result codes */
int num_blocks; /* Number of complete blocks */
- char pad_len; /* Pad size for the last block */
+ uint pad_len; /* Pad size for the last block */
int i;
if ((rc=my_aes_create_key(&aes_key,AES_DECRYPT,key,key_length)))
@@ -197,7 +197,8 @@ int my_aes_decrypt(const char *source, int source_length, char *dest,
}
rijndaelDecrypt(aes_key.rk, aes_key.nr, source, block);
- pad_len = block[AES_BLOCK_SIZE-1]; /* Use last char in the block as size */
+ /* Use last char in the block as size */
+ pad_len = (uint) (uchar) block[AES_BLOCK_SIZE-1];
if (pad_len > AES_BLOCK_SIZE)
return AES_BAD_DATA;