MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / create_password_hash_buffer

Method create_password_hash_buffer

sql/item_strfunc.cc:1516–1535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1514}
1515
1516char *Item_func_password::
1517 create_password_hash_buffer(THD *thd, const char *password, size_t pass_len)
1518{
1519 char *buff= NULL;
1520 if (thd->variables.old_passwords == 0)
1521 {
1522 /* Allocate memory for the password scramble and one extra byte for \0 */
1523 buff= (char *) thd->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH + 1);
1524 my_make_scrambled_password_sha1(buff, password, pass_len);
1525 }
1526#if defined(HAVE_OPENSSL)
1527 else
1528 {
1529 /* Allocate memory for the password scramble and one extra byte for \0 */
1530 buff= (char *) thd->alloc(CRYPT_MAX_PASSWORD_SIZE + 1);
1531 my_make_scrambled_password(buff, password, pass_len);
1532 }
1533#endif
1534 return buff;
1535}
1536
1537/* Item_func_old_password */
1538

Callers

nothing calls this directly

Calls 3

allocMethod · 0.45

Tested by

no test coverage detected