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

Function scramble_323

sql/password.c:170–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168*/
169
170void scramble_323(char *to, const char *message, const char *password)
171{
172 struct rand_struct rand_st;
173 ulong hash_pass[2], hash_message[2];
174
175 if (password && password[0])
176 {
177 char extra, *to_start=to;
178 const char *message_end= message + SCRAMBLE_LENGTH_323;
179 hash_password(hash_pass,password, (uint) strlen(password));
180 hash_password(hash_message, message, SCRAMBLE_LENGTH_323);
181 randominit(&rand_st,hash_pass[0] ^ hash_message[0],
182 hash_pass[1] ^ hash_message[1]);
183 for (; message < message_end; message++)
184 *to++= (char) (floor(my_rnd(&rand_st)*31)+64);
185 extra=(char) (floor(my_rnd(&rand_st)*31));
186 while (to_start != to)
187 *(to_start++)^=extra;
188 }
189 *to= 0;
190}
191
192
193/**

Callers 1

old_password_auth_clientFunction · 0.85

Calls 3

hash_passwordFunction · 0.85
randominitFunction · 0.85
my_rndFunction · 0.85

Tested by

no test coverage detected