diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-03-25 19:36:10 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-04-08 10:58:46 +0200 |
commit | b937574293ee731dc7b5c949d27fede1f5d17db5 (patch) | |
tree | 3f75c7eb84197a885df6a2d16f453afe27dee1ba /sql/item_strfunc.h | |
parent | 91f7363e4baff9debe43cf039fe4525c43aee4cc (diff) | |
download | mariadb-git-b937574293ee731dc7b5c949d27fede1f5d17db5.tar.gz |
remove old my_aes_encrypt/decrypt
and simplify Item_func_aes_encrypt/decrypt
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r-- | sql/item_strfunc.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index b79009c6778..e11d2c41bc6 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -134,21 +134,33 @@ public: const char *func_name() const { return "from_base64"; } }; +#include <my_crypt.h> -class Item_func_aes_encrypt :public Item_str_func +class Item_aes_crypt :public Item_str_func { + enum { AES_KEY_LENGTH = 128 }; + void create_key(String *user_key, uchar* key); + +protected: + my_aes_encrypt_dynamic_type crypt; + public: - Item_func_aes_encrypt(Item *a, Item *b) :Item_str_func(a,b) {} + Item_aes_crypt(Item *a, Item *b) :Item_str_func(a,b) {} String *val_str(String *); +}; + +class Item_func_aes_encrypt :public Item_aes_crypt +{ +public: + Item_func_aes_encrypt(Item *a, Item *b) :Item_aes_crypt(a,b) {} void fix_length_and_dec(); const char *func_name() const { return "aes_encrypt"; } }; -class Item_func_aes_decrypt :public Item_str_func +class Item_func_aes_decrypt :public Item_aes_crypt { public: - Item_func_aes_decrypt(Item *a, Item *b) :Item_str_func(a,b) {} - String *val_str(String *); + Item_func_aes_decrypt(Item *a, Item *b) :Item_aes_crypt(a,b) {} void fix_length_and_dec(); const char *func_name() const { return "aes_decrypt"; } }; |