(password, salt)
| 124 | |
| 125 | |
| 126 | def _xor_password(password, salt): |
| 127 | # Trailing NUL character will be added in Auth Switch Request. |
| 128 | # See https://github.com/mysql/mysql-server/blob/7d10c82196c8e45554f27c00681474a9fb86d137/sql/auth/sha2_password.cc#L939-L945 |
| 129 | salt = salt[:SCRAMBLE_LENGTH] |
| 130 | password_bytes = bytearray(password) |
| 131 | # salt = bytearray(salt) # for PY2 compat. |
| 132 | salt_len = len(salt) |
| 133 | for i in range(len(password_bytes)): |
| 134 | password_bytes[i] ^= salt[i % salt_len] |
| 135 | return bytes(password_bytes) |
| 136 | |
| 137 | |
| 138 | def sha2_rsa_encrypt(password, salt, public_key): |
no outgoing calls
no test coverage detected
searching dependent graphs…