From f5a824e1b2f3896fd73e18f5a73293caffbc2f02 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Sat, 15 Dec 2018 11:23:09 +0900 Subject: [PATCH] Warn when old password is used --- pymysql/_auth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pymysql/_auth.py b/pymysql/_auth.py index 7a7377bf..e0a48f74 100644 --- a/pymysql/_auth.py +++ b/pymysql/_auth.py @@ -15,6 +15,7 @@ import hashlib import io import struct +import warnings DEBUG = False @@ -72,6 +73,8 @@ def my_rnd(self): def scramble_old_password(password, message): """Scramble for old_password""" + warnings.warn("old password (for MySQL <4.1) is used. Upgrade your password with newer auth method.\n" + "old password support will be removed in future PyMySQL version") hash_pass = _hash_password_323(password) hash_message = _hash_password_323(message[:SCRAMBLE_LENGTH_323]) hash_pass_n = struct.unpack(">LL", hash_pass)