#include <item_strfunc.h>
Inheritance diagram for Item_func_aes_encrypt:


Public Member Functions | |
| Item_func_aes_encrypt (Item *a, Item *b) | |
| String * | val_str (String *) |
| void | fix_length_and_dec () |
| const char * | func_name () const |
Definition at line 64 of file item_strfunc.h.
| void Item_func_aes_encrypt::fix_length_and_dec | ( | ) | [virtual] |
Implements Item_result_field.
Definition at line 250 of file item_strfunc.cc.
References Item_func::args, Item::max_length, and my_aes_get_size().
00251 { 00252 max_length=my_aes_get_size(args[0]->max_length); 00253 }
Here is the call graph for this function:

| const char* Item_func_aes_encrypt::func_name | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 220 of file item_strfunc.cc.
References String::alloc(), Item_func::args, DBUG_ASSERT, Item::fixed, key, String::length(), my_aes_encrypt(), my_aes_get_size(), Item::null_value, String::ptr(), Item::str_value, system_charset_info, and Item::val_str().
00221 { 00222 DBUG_ASSERT(fixed == 1); 00223 char key_buff[80]; 00224 String tmp_key_value(key_buff, sizeof(key_buff), system_charset_info); 00225 String *sptr= args[0]->val_str(str); // String to encrypt 00226 String *key= args[1]->val_str(&tmp_key_value); // key 00227 int aes_length; 00228 if (sptr && key) // we need both arguments to be not NULL 00229 { 00230 null_value=0; 00231 aes_length=my_aes_get_size(sptr->length()); // Calculate result length 00232 00233 if (!str_value.alloc(aes_length)) // Ensure that memory is free 00234 { 00235 // finally encrypt directly to allocated buffer. 00236 if (my_aes_encrypt(sptr->ptr(),sptr->length(), (char*) str_value.ptr(), 00237 key->ptr(), key->length()) == aes_length) 00238 { 00239 // We got the expected result length 00240 str_value.length((uint) aes_length); 00241 return &str_value; 00242 } 00243 } 00244 } 00245 null_value=1; 00246 return 0; 00247 }
Here is the call graph for this function:

1.4.7

