1
###############################################################################
3
# Authorization and authentication using the SHA256_PASSWORD plugin at #
4
# server and client side #
8
# Creation Date: 2012-12-10 #
9
# Author : Tanjot Singh Uppal #
12
# Description:Test Cases of authenticating the hashed password using the #
13
# sha256_password plugin at the server side as well as the client side #
16
###############################################################################
18
--source include/not_embedded.inc
19
--source include/have_ssl.inc
20
--source include/have_sha256_rsa_auth.inc
21
--source include/mysql_upgrade_preparation.inc
23
# This test will intentionally generate errors in the server error log
24
# when a broken password is inserted into the mysql.user table.
25
# The below suppression is to clear those errors.
29
call mtr.add_suppression(".*Password salt for user.*");
34
--echo ===========================================================================================================================================
35
--echo Checking the password authentication using the sha256_password plugin at the client and mysql_native_password plugin at the server side
36
--echo ===========================================================================================================================================
39
select @@Global.old_passwords;
42
select @@session.old_passwords;
45
# Checking the password authentication with sha256_password plugin
46
# Creating 2 users and encrypting the server side password with the sha256_password plugin
48
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password';
50
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'sha256_password';
52
# Verifying the server side plugin used to be sha256_password
54
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='sha256_password';
57
select (select plugin from mysql.user where User='Tanjotuser2' and Host='127.0.0.1')='sha256_password';
60
# Verifying the client connection using the same sha256_password plugin and NULL password
62
connect(con1,localhost,Tanjotuser1,,,);
63
connect(con2,127.0.0.1,Tanjotuser2,,,);
65
# Verifying the client connection using the same sha256_password plugin and junk password
67
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
68
--replace_result "NO" "" "YES" ""
70
--error ER_ACCESS_DENIED_ERROR
71
connect(con3,localhost,Tanjotuser1," ",,);
74
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
75
--replace_result "NO" "" "YES" ""
77
--error ER_ACCESS_DENIED_ERROR
78
connect(con4,127.0.0.1,Tanjotuser2," ",,);
81
# setting the password for the 2 users using the sha256_password plugin
85
# setting the old_passwords in sync with the sha256 plugin
87
set @@session.old_passwords=2;
90
SET PASSWORD FOR 'Tanjotuser1'@'localhost'=PASSWORD('abc');
91
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'=PASSWORD('abc');
93
# Validating the old_passwords value from the created users.
96
--echo **** connecting Tanjotuser1 with server
97
--exec $MYSQL -uTanjotuser1 -pabc -hlocalhost --default_auth=mysql_native_password -e "select @@session.old_passwords"
100
--echo **** connecting Tanjotuser2 with server
101
--exec $MYSQL -uTanjotuser2 -pabc -h127.0.0.1 --default_auth=mysql_native_password -e "select @@session.old_passwords"
106
--echo **** connecting Tanjotuser1 with server
107
--exec $MYSQL -uTanjotuser1 -pabc -hlocalhost --default_auth=mysql_old_password -e "select @@session.old_passwords"
110
--echo **** connecting Tanjotuser2 with server
111
--exec $MYSQL -uTanjotuser2 -pabc -h127.0.0.1 --default_auth=mysql_old_password -e "select @@session.old_passwords"
116
--echo **** connecting Tanjotuser1 with server
117
--exec $MYSQL -uTanjotuser1 -pabc -hlocalhost --default_auth=sha256_password -e "select @@session.old_passwords"
120
--echo **** connecting Tanjotuser2 with server
121
--exec $MYSQL -uTanjotuser2 -pabc -h127.0.0.1 --default_auth=sha256_password -e "select @@session.old_passwords"
126
--echo **** connecting Tanjotuser1 with server
127
--exec $MYSQL -uTanjotuser1 -pabc -hlocalhost -e "select @@session.old_passwords"
130
--echo **** connecting Tanjotuser2 with server
131
--exec $MYSQL -uTanjotuser2 -pabc -h127.0.0.1 -e "select @@session.old_passwords"
135
# Verifying the client connection using the sha256_password plugin and NULL password
137
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
138
--replace_result "NO" "" "YES" ""
140
--error ER_ACCESS_DENIED_ERROR
141
connect(con5,localhost,Tanjotuser1,,,);
144
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
145
--replace_result "NO" "" "YES" ""
147
--error ER_ACCESS_DENIED_ERROR
148
connect(con6,127.0.0.1,Tanjotuser2,,,);
151
# Verifying the client connection using the sha256_password plugin and junk password
153
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
154
--replace_result "NO" "" "YES" ""
156
--error ER_ACCESS_DENIED_ERROR
157
connect(con7,localhost,Tanjotuser1," ",,);
160
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
161
--replace_result "NO" "" "YES" ""
163
--error ER_ACCESS_DENIED_ERROR
164
connect(con8,127.0.0.1,Tanjotuser2," ",,);
167
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
168
--replace_result "NO" "" "YES" ""
170
--error ER_ACCESS_DENIED_ERROR
171
connect(con9,localhost,Tanjotuser1,"%",,);
174
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
175
--replace_result "NO" "" "YES" ""
177
--error ER_ACCESS_DENIED_ERROR
178
connect(con10,127.0.0.1,Tanjotuser2,"%",,);
181
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
182
--replace_result "NO" "" "YES" ""
184
--error ER_ACCESS_DENIED_ERROR
185
connect(con11,localhost,Tanjotuser1,"_",,);
188
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
189
--replace_result "NO" "" "YES" ""
191
--error ER_ACCESS_DENIED_ERROR
192
connect(con12,127.0.0.1,Tanjotuser2,"_",,);
195
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
196
--replace_result "NO" "" "YES" ""
198
--error ER_ACCESS_DENIED_ERROR
199
connect(con13,localhost,Tanjotuser1,"0",,);
202
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
203
--replace_result "NO" "" "YES" ""
205
--error ER_ACCESS_DENIED_ERROR
206
connect(con14,127.0.0.1,Tanjotuser2,"0",,);
209
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
210
--replace_result "NO" "" "YES" ""
212
--error ER_ACCESS_DENIED_ERROR
213
connect(con15,localhost,Tanjotuser1,"^",,);
216
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
217
--replace_result "NO" "" "YES" ""
219
--error ER_ACCESS_DENIED_ERROR
220
connect(con16,127.0.0.1,Tanjotuser2,"^",,);
223
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
224
--replace_result "NO" "" "YES" ""
226
--error ER_ACCESS_DENIED_ERROR
227
connect(con17,localhost,Tanjotuser1,'\$',,);
230
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
231
--replace_result "NO" "" "YES" ""
233
--error ER_ACCESS_DENIED_ERROR
234
connect(con18,127.0.0.1,Tanjotuser2,'\$',,);
237
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
238
--replace_result "NO" "" "YES" ""
240
--error ER_ACCESS_DENIED_ERROR
241
connect(con19,localhost,Tanjotuser1,"&",,);
244
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
245
--replace_result "NO" "" "YES" ""
247
--error ER_ACCESS_DENIED_ERROR
248
connect(con20,127.0.0.1,Tanjotuser2,"&",,);
252
# Verifying the client connection using the same sha256_password plugin and correct password with secure auth enabled
256
select @@global.secure_auth;
259
connect(con21,localhost,Tanjotuser1,abc,,);
260
connect(con22,127.0.0.1,Tanjotuser2,abc,,);
262
# Verifying the client connection using the same sha256_password plugin and correct password with secure_auth disabled
267
set @@global.secure_auth=0;
271
connect(con23,localhost,Tanjotuser1,abc,,);
272
connect(con24,127.0.0.1,Tanjotuser2,abc,,);
275
# Below section is hashed till the bug16040690 is fixed.
277
#--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
278
#connect(con25,localhost,Tanjotuser1,"abc ",,);
279
#--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
280
#connect(con26,127.0.0.1,Tanjotuser2,"abc ",,);
282
#--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
283
#connect(con27,localhost,Tanjotuser1," abc",,);
284
#--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
285
#connect(con28,127.0.0.1,Tanjotuser2," abc",,);
287
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
288
--replace_result "NO" "" "YES" ""
290
--error ER_ACCESS_DENIED_ERROR
291
connect(con29,localhost,Tanjotuser1,"0abc",,);
294
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
295
--replace_result "NO" "" "YES" ""
297
--error ER_ACCESS_DENIED_ERROR
298
connect(con30,127.0.0.1,Tanjotuser2,"0abc",,);
301
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
302
--replace_result "NO" "" "YES" ""
304
--error ER_ACCESS_DENIED_ERROR
305
connect(con31,localhost,Tanjotuser1,"abc0",,);
308
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
309
--replace_result "NO" "" "YES" ""
311
--error ER_ACCESS_DENIED_ERROR
312
connect(con32,127.0.0.1,Tanjotuser2,"abc0",,);
315
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
316
--replace_result "NO" "" "YES" ""
318
--error ER_ACCESS_DENIED_ERROR
319
connect(con33,localhost,Tanjotuser1,"@abc",,);
322
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
323
--replace_result "NO" "" "YES" ""
325
--error ER_ACCESS_DENIED_ERROR
326
connect(con34,127.0.0.1,Tanjotuser2,"@abc",,);
329
# Dropping the created users
333
DROP USER 'Tanjotuser1'@'localhost';
334
DROP USER 'Tanjotuser2'@'127.0.0.1';
338
--echo ====================================================================================================
339
--echo checking the integrity of long password (more than 40 chars) using sha256_password plugin
340
--echo ====================================================================================================
344
# Checking the password authentication with sha256_password plugin
345
# Creating 2 users and encrypting the server side password with the sha256_password plugin
347
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password';
349
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'sha256_password';
351
# setting the password for the 2 users using the sha256_password plugin
353
SET @@session.old_passwords=2;
355
SET PASSWORD FOR 'Tanjotuser1'@'localhost'=PASSWORD('$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________');
356
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'=PASSWORD('$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________');
359
# Verifying the client connection using the same sha256_password plugin and correct password with secure_auth disabled
362
set @@global.secure_auth=0;
366
connect(con35,localhost,Tanjotuser1,"\$\$\$\$\$\$\$\$\$\$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________",,);
367
connect(con36,127.0.0.1,Tanjotuser2,"\$\$\$\$\$\$\$\$\$\$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________",,);
371
# Verifying the client connection using the same sha256_password plugin and correct password with secure_auth enabled
376
set @@global.secure_auth=1;
380
connect(con37,localhost,Tanjotuser1,"\$\$\$\$\$\$\$\$\$\$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________",,);
381
connect(con38,127.0.0.1,Tanjotuser2,"\$\$\$\$\$\$\$\$\$\$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________",,);
385
# Verifying the client access denied passing null password
387
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
388
--replace_result "NO" "" "YES" ""
390
--error ER_ACCESS_DENIED_ERROR
391
connect(con39,localhost,Tanjotuser1," ",,);
394
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
395
--replace_result "NO" "" "YES" ""
397
--error ER_ACCESS_DENIED_ERROR
398
connect(con40,127.0.0.1,Tanjotuser2," ",,);
401
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
402
--replace_result "NO" "" "YES" ""
404
--error ER_ACCESS_DENIED_ERROR
405
connect(con41,localhost,Tanjotuser1,,,);
408
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
409
--replace_result "NO" "" "YES" ""
411
--error ER_ACCESS_DENIED_ERROR
412
connect(con42,127.0.0.1,Tanjotuser2,,,);
415
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
416
--replace_result "NO" "" "YES" ""
418
--error ER_ACCESS_DENIED_ERROR
419
connect(con43,localhost,Tanjotuser1,"@_",,);
422
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
423
--replace_result "NO" "" "YES" ""
425
--error ER_ACCESS_DENIED_ERROR
426
connect(con44,127.0.0.1,Tanjotuser2,"@_",,);
429
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
430
--replace_result "NO" "" "YES" ""
432
--error ER_ACCESS_DENIED_ERROR
433
connect(con45,localhost,Tanjotuser1,"$_",,);
436
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
437
--replace_result "NO" "" "YES" ""
439
--error ER_ACCESS_DENIED_ERROR
440
connect(con46,127.0.0.1,Tanjotuser2,"$_",,);
444
# Dropping the created users
448
DROP USER 'Tanjotuser1'@'localhost';
449
DROP USER 'Tanjotuser2'@'127.0.0.1';
453
--echo ============================================================================================================================================
454
--echo Checking the password authentication using the sha256_password plugin at the client and sha256_password plugin at the server side
455
--echo ============================================================================================================================================
458
--echo # Restart server with default-authentication-plugin=sha256_password;
460
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
461
--exec echo "wait" > $restart_file
463
--source include/wait_until_disconnected.inc
464
-- exec echo "restart:--default-authentication-plugin=sha256_password " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
466
-- source include/wait_until_connected_again.inc
470
select @@Global.old_passwords;
473
select @@session.old_passwords;
476
# Checking the password authentication with sha256_password plugin
477
# Creating 2 users and encrypting the server side password with the sha256_password plugin
479
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password';
481
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'sha256_password';
483
# Verifying the server side plugin used to be sha256_password
485
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='sha256_password';
488
select (select plugin from mysql.user where User='Tanjotuser2' and Host='127.0.0.1')='sha256_password';
491
# Verifying the client connection using the same sha256_password plugin and NULL password
493
connect(con89,localhost,Tanjotuser1,,,);
494
connect(con90,127.0.0.1,Tanjotuser2,,,);
496
# Verifying the client connection using the same sha256_password plugin and junk password
498
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
499
--replace_result "NO" "" "YES" ""
501
--error ER_ACCESS_DENIED_ERROR
502
connect(con91,localhost,Tanjotuser1," ",,);
505
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
506
--replace_result "NO" "" "YES" ""
508
--error ER_ACCESS_DENIED_ERROR
509
connect(con92,127.0.0.1,Tanjotuser2," ",,);
512
# setting the password for the 2 users using the sha256_password plugin
516
SET @@session.old_passwords=2;
518
SET PASSWORD FOR 'Tanjotuser1'@'localhost'=PASSWORD('abc');
519
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'=PASSWORD('abc');
522
# Validating the old_passwords value from the created users.
525
--echo **** connecting Tanjotuser1 with server
526
--exec $MYSQL -uTanjotuser1 -pabc -hlocalhost --default_auth=mysql_native_password -e "select @@session.old_passwords"
529
--echo **** connecting Tanjotuser2 with server
530
--exec $MYSQL -uTanjotuser2 -pabc -h127.0.0.1 --default_auth=mysql_native_password -e "select @@session.old_passwords"
535
--echo **** connecting Tanjotuser1 with server
536
--exec $MYSQL -uTanjotuser1 -pabc -hlocalhost --default_auth=mysql_old_password -e "select @@session.old_passwords"
539
--echo **** connecting Tanjotuser2 with server
540
--exec $MYSQL -uTanjotuser2 -pabc -h127.0.0.1 --default_auth=mysql_old_password -e "select @@session.old_passwords"
545
--echo **** connecting Tanjotuser1 with server
546
--exec $MYSQL -uTanjotuser1 -pabc -hlocalhost --default_auth=sha256_password -e "select @@session.old_passwords"
549
--echo **** connecting Tanjotuser2 with server
550
--exec $MYSQL -uTanjotuser2 -pabc -h127.0.0.1 --default_auth=sha256_password -e "select @@session.old_passwords"
555
--echo **** connecting Tanjotuser1 with server
556
--exec $MYSQL -uTanjotuser1 -pabc -hlocalhost -e "select @@session.old_passwords"
559
--echo **** connecting Tanjotuser2 with server
560
--exec $MYSQL -uTanjotuser2 -pabc -h127.0.0.1 -e "select @@session.old_passwords"
564
# Verifying the client connection using the same sha256_password plugin and NULL password
566
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
567
--replace_result "NO" "" "YES" ""
569
--error ER_ACCESS_DENIED_ERROR
570
connect(con93,localhost,Tanjotuser1,,,);
573
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
574
--replace_result "NO" "" "YES" ""
576
--error ER_ACCESS_DENIED_ERROR
577
connect(con94,127.0.0.1,Tanjotuser2,,,);
580
# Verifying the client connection using the same sha256_password plugin and junk password
582
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
583
--replace_result "NO" "" "YES" ""
585
--error ER_ACCESS_DENIED_ERROR
586
connect(con95,localhost,Tanjotuser1," ",,);
589
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
590
--replace_result "NO" "" "YES" ""
592
--error ER_ACCESS_DENIED_ERROR
593
connect(con96,127.0.0.1,Tanjotuser2," ",,);
596
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
597
--replace_result "NO" "" "YES" ""
599
--error ER_ACCESS_DENIED_ERROR
600
connect(con97,localhost,Tanjotuser1,"%",,);
603
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
604
--replace_result "NO" "" "YES" ""
606
--error ER_ACCESS_DENIED_ERROR
607
connect(con98,127.0.0.1,Tanjotuser2,"%",,);
610
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
611
--replace_result "NO" "" "YES" ""
613
--error ER_ACCESS_DENIED_ERROR
614
connect(con99,localhost,Tanjotuser1,"_",,);
617
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
618
--replace_result "NO" "" "YES" ""
620
--error ER_ACCESS_DENIED_ERROR
621
connect(con100,127.0.0.1,Tanjotuser2,"_",,);
624
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
625
--replace_result "NO" "" "YES" ""
627
--error ER_ACCESS_DENIED_ERROR
628
connect(con101,localhost,Tanjotuser1,"0",,);
631
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
632
--replace_result "NO" "" "YES" ""
634
--error ER_ACCESS_DENIED_ERROR
635
connect(con102,127.0.0.1,Tanjotuser2,"0",,);
638
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
639
--replace_result "NO" "" "YES" ""
641
--error ER_ACCESS_DENIED_ERROR
642
connect(con103,localhost,Tanjotuser1,"^",,);
645
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
646
--replace_result "NO" "" "YES" ""
648
--error ER_ACCESS_DENIED_ERROR
649
connect(con104,127.0.0.1,Tanjotuser2,"^",,);
652
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
653
--replace_result "NO" "" "YES" ""
655
--error ER_ACCESS_DENIED_ERROR
656
connect(con105,localhost,Tanjotuser1,"\$",,);
659
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
660
--replace_result "NO" "" "YES" ""
662
--error ER_ACCESS_DENIED_ERROR
663
connect(con106,127.0.0.1,Tanjotuser2,"\$",,);
666
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
667
--replace_result "NO" "" "YES" ""
669
--error ER_ACCESS_DENIED_ERROR
670
connect(con107,localhost,Tanjotuser1,"&",,);
673
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
674
--replace_result "NO" "" "YES" ""
676
--error ER_ACCESS_DENIED_ERROR
677
connect(con108,127.0.0.1,Tanjotuser2,"&",,);
681
# Verifying the client connection using the same sha256_password plugin and correct password with secure_auth enabled
685
select @@global.secure_auth;
688
connect(con109,localhost,Tanjotuser1,abc,,);
689
connect(con110,127.0.0.1,Tanjotuser2,abc,,);
691
# Verifying the client connection using the same sha256_password plugin and correct password with secure_auth disabled
696
set @@global.secure_auth=0;
700
connect(con111,localhost,Tanjotuser1,abc,,);
701
connect(con112,127.0.0.1,Tanjotuser2,abc,,);
704
# Below section is hashed till the bug16040690 is fixed.
706
#--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
707
#connect(con113,localhost,Tanjotuser1,"abc ",,);
708
#--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
709
#connect(con114,127.0.0.1,Tanjotuser2,"abc ",,);
711
#--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
712
#connect(con115,localhost,Tanjotuser1," abc",,);
713
#--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
714
#connect(con116,127.0.0.1,Tanjotuser2," abc",,);
716
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
717
--replace_result "NO" "" "YES" ""
719
--error ER_ACCESS_DENIED_ERROR
720
connect(con117,localhost,Tanjotuser1,"0abc",,);
723
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
724
--replace_result "NO" "" "YES" ""
726
--error ER_ACCESS_DENIED_ERROR
727
connect(con118,127.0.0.1,Tanjotuser2,"0abc",,);
730
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
731
--replace_result "NO" "" "YES" ""
733
--error ER_ACCESS_DENIED_ERROR
734
connect(con119,localhost,Tanjotuser1,"abc0",,);
737
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
738
--replace_result "NO" "" "YES" ""
740
--error ER_ACCESS_DENIED_ERROR
741
connect(con120,127.0.0.1,Tanjotuser2,"abc0",,);
744
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
745
--replace_result "NO" "" "YES" ""
747
--error ER_ACCESS_DENIED_ERROR
748
connect(con121,localhost,Tanjotuser1,"@abc",,);
751
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
752
--replace_result "NO" "" "YES" ""
754
--error ER_ACCESS_DENIED_ERROR
755
connect(con122,127.0.0.1,Tanjotuser2,"@abc",,);
758
# Dropping the created users
762
DROP USER 'Tanjotuser1'@'localhost';
763
DROP USER 'Tanjotuser2'@'127.0.0.1';
767
--echo ====================================================================================================
768
--echo checking the integrity of long password (more than 40 chars) using sha256_password plugin
769
--echo ====================================================================================================
773
# Checking the password authentication with sha256_password plugin
774
# Creating 2 users and encrypting the server side password with the sha256_password plugin
776
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password';
778
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'sha256_password';
780
# setting the password for the 2 users using the sha256_password plugin
782
SET @@session.old_passwords=2;
784
SET PASSWORD FOR 'Tanjotuser1'@'localhost'=PASSWORD('$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________');
785
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'=PASSWORD('$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________');
788
# Verifying the client connection using the same sha256_password plugin and correct password with secure_auth disabled
791
set @@global.secure_auth=0;
795
connect(con123,localhost,Tanjotuser1,"\$\$\$\$\$\$\$\$\$\$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________",,);
796
connect(con124,127.0.0.1,Tanjotuser2,"\$\$\$\$\$\$\$\$\$\$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________",,);
799
# Verifying the client connection using the same sha256_password plugin and correct password with secure_auth enabled
804
set @@global.secure_auth=1;
808
connect(con125,localhost,Tanjotuser1,"\$\$\$\$\$\$\$\$\$\$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________",,);
809
connect(con126,127.0.0.1,Tanjotuser2,"\$\$\$\$\$\$\$\$\$\$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________",,);
812
# Verifying the client access denied passing null password
814
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
815
--replace_result "NO" "" "YES" ""
817
--error ER_ACCESS_DENIED_ERROR
818
connect(con127,localhost,Tanjotuser1," ",,);
821
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
822
--replace_result "NO" "" "YES" ""
824
--error ER_ACCESS_DENIED_ERROR
825
connect(con128,127.0.0.1,Tanjotuser2," ",,);
828
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
829
--replace_result "NO" "" "YES" ""
831
--error ER_ACCESS_DENIED_ERROR
832
connect(con127,localhost,Tanjotuser1,,,);
835
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
836
--replace_result "NO" "" "YES" ""
838
--error ER_ACCESS_DENIED_ERROR
839
connect(con128,127.0.0.1,Tanjotuser2,,,);
842
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
843
--replace_result "NO" "" "YES" ""
845
--error ER_ACCESS_DENIED_ERROR
846
connect(con129,localhost,Tanjotuser1,"@_",,);
849
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
850
--replace_result "NO" "" "YES" ""
852
--error ER_ACCESS_DENIED_ERROR
853
connect(con130,127.0.0.1,Tanjotuser2,"@_",,);
856
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
857
--replace_result "NO" "" "YES" ""
859
--error ER_ACCESS_DENIED_ERROR
860
connect(con131,localhost,Tanjotuser1,"$_",,);
863
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
864
--replace_result "NO" "" "YES" ""
866
--error ER_ACCESS_DENIED_ERROR
867
connect(con132,127.0.0.1,Tanjotuser2,"$_",,);
871
# Dropping the created users
1009
DROP USER 'Tanjotuser1'@'localhost';
1010
DROP USER 'Tanjotuser2'@'127.0.0.1';
1011
SET @@global.secure_auth=default;
1012
SET @@global.old_passwords=default;
1013
SET @@session.old_passwords=default;