Bug #54623 AES_DECRYPT and AES_ENCRYPT bug
Submitted: 18 Jun 2010 20:27 Modified: 24 Jun 2010 22:24
Reporter: Teste Silva Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.1.47 OS:Linux (rhel 5.5 )
Assigned to: CPU Architecture:Any
Tags: AES_DECRYPT, AES_ENCRYPT

[18 Jun 2010 20:27] Teste Silva
Description:
AES_DECRYPT and AES_ENCRYPT have stopped working

How to repeat:
mysql> CREATE TABLE `test` (  `id` int(11) NOT NULL auto_increment, `string` blob, PRIMARY KEY  (`id`) ) TYPE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2;
Query OK, 0 rows affected, 2 warnings (0.78 sec)

mysql> INSERT INTO test(string) VALUES(AES_ENCRYPT('Libero','eKqvqhjXKvrNt3aBjyVXg1'));
Query OK, 1 row affected (0.00 sec)

mysql> SELECT id,AES_DECRYPT(string,'eKqvqhjXKvrNt3aBjyVXg1')  as string FROM test;
+----+--------+
| id | string |
+----+--------+
|  2 | NULL   |
+----+--------+
1 row in set (0.00 sec)

Suggested fix:
None
[18 Jun 2010 20:29] Teste Silva
C compiler:    icc (ICC) 11.1 20100203
C++ compiler:  icpc (ICC) 11.1 20100203
[18 Jun 2010 20:38] MySQL Verification Team
Thank you for the bug report. I couldn't repeat with server built from today source tree:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.49 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE TABLE `test` (  `id` int(11) NOT NULL auto_increment, `string` blob,
    -> PRIMARY KEY  (`id`) ) TYPE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2;
Query OK, 0 rows affected, 1 warning (0.07 sec)

mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                 |
+---------+------+-------------------------------------------------------------------------------------------------------------------------+
| Warning | 1287 | 'TYPE=storage_engine' is deprecated and will be removed in a future release. Please use 'ENGINE=storage_engine' instead |
+---------+------+-------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> INSERT INTO test(string) VALUES(AES_ENCRYPT('Libero','eKqvqhjXKvrNt3aBjyVXg1'));
Query OK, 1 row affected (0.01 sec)

mysql> SELECT id,AES_DECRYPT(string,'eKqvqhjXKvrNt3aBjyVXg1')  as string FROM test;
+----+--------+
| id | string |
+----+--------+
|  2 | Libero |
+----+--------+
1 row in set (0.00 sec)

mysql> show variables like "%version%";
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| protocol_version        | 10                  |
| version                 | 5.1.49              |
| version_comment         | Source distribution |
| version_compile_machine | x86_64              |
| version_compile_os      | slackware-linux-gnu |
+-------------------------+---------------------+
5 rows in set (0.00 sec)

mysql> 

Please wait for new release. Thanks in advance.
[24 Jun 2010 22:24] Teste Silva
Have you used icc 11.1? If not, please reopen.