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


Public Member Functions | |
| Item_func_aes_decrypt (Item *a, Item *b) | |
| String * | val_str (String *) |
| void | fix_length_and_dec () |
| const char * | func_name () const |
Definition at line 73 of file item_strfunc.h.
| void Item_func_aes_decrypt::fix_length_and_dec | ( | ) | [virtual] |
Implements Item_result_field.
Definition at line 289 of file item_strfunc.cc.
References Item_func::args, Item::max_length, and Item::maybe_null.
00290 { 00291 max_length=args[0]->max_length; 00292 maybe_null= 1; 00293 }
| const char* Item_func_aes_decrypt::func_name | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 256 of file item_strfunc.cc.
References String::alloc(), Item_func::args, DBUG_ASSERT, DBUG_ENTER, DBUG_RETURN, Item::fixed, key, String::length(), my_aes_decrypt(), Item::null_value, String::ptr(), Item::str_value, system_charset_info, and Item::val_str().
00257 { 00258 DBUG_ASSERT(fixed == 1); 00259 char key_buff[80]; 00260 String tmp_key_value(key_buff, sizeof(key_buff), system_charset_info); 00261 String *sptr, *key; 00262 DBUG_ENTER("Item_func_aes_decrypt::val_str"); 00263 00264 sptr= args[0]->val_str(str); // String to decrypt 00265 key= args[1]->val_str(&tmp_key_value); // Key 00266 if (sptr && key) // Need to have both arguments not NULL 00267 { 00268 null_value=0; 00269 if (!str_value.alloc(sptr->length())) // Ensure that memory is free 00270 { 00271 // finally decrypt directly to allocated buffer. 00272 int length; 00273 length=my_aes_decrypt(sptr->ptr(), sptr->length(), 00274 (char*) str_value.ptr(), 00275 key->ptr(), key->length()); 00276 if (length >= 0) // if we got correct data data 00277 { 00278 str_value.length((uint) length); 00279 DBUG_RETURN(&str_value); 00280 } 00281 } 00282 } 00283 // Bad parameters. No memory or bad data will all go here 00284 null_value=1; 00285 DBUG_RETURN(0); 00286 }
Here is the call graph for this function:

1.4.7

