8000 Warn when old password is used (#756) · kevinvoid/PyMySQL@c42ddff · GitHub
[go: up one dir, main page]

Skip to content

Commit c42ddff

Browse files
authored
Warn when old password is used (PyMySQL#756)
1 parent 9fa5daf commit c42ddff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pymysql/_auth.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import hashlib
1616
import io
1717
import struct
18+
import warnings
1819

1920

2021
DEBUG = False
@@ -72,6 +73,8 @@ def my_rnd(self):
7273

7374
def scramble_old_password(password, message):
7475
"""Scramble for old_password"""
76+
warnings.warn("old password (for MySQL <4.1) is used. Upgrade your password with newer auth method.\n"
77+
"old password support will be removed in future PyMySQL version")
7578
hash_pass = _hash_password_323(password)
7679
hash_message = _hash_password_323(message[:SCRAMBLE_LENGTH_323])
7780
hash_pass_n = struct.unpack(">LL", hash_pass)

0 commit comments

Comments
 (0)
0