~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/auth_sec/t/server_withoutssl_client_withoutssl.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
###############################################################################
 
2
#                                                                             #
 
3
# Authorization and authentication of the key-value pair shared between       #
 
4
# the server and the client when server is started without SSL and client     #
 
5
# is connected without SSL                                                    #
 
6
#                                                                             #
 
7
#                                                                             #
 
8
# Creation Date: 2012-12-26                                                   #
 
9
# Author : Tanjot Singh Uppal                                                 #
 
10
#                                                                             #
 
11
#                                                                             #
 
12
# Description:Test Cases of validates the authentication of the handshake     #
 
13
# information when server started without SSL and client started without SSL  #
 
14
#                                                                             #
 
15
###############################################################################
 
16
 
 
17
--source include/not_embedded.inc
 
18
#--source include/not_ssl.inc
 
19
#--source include/not_openssl.inc
 
20
--source include/not_sha256_rsa_auth.inc
 
21
 
 
22
# This test will intentionally generate errors in the server error log
 
23
# when a broken password is inserted into the mysql.user table.
 
24
# The below suppression is to clear those errors.
 
25
 
 
26
--disable_query_log
 
27
call mtr.add_suppression(".*Password salt for user.*");
 
28
--enable_query_log
 
29
 
 
30
--disable_query_log
 
31
call mtr.add_suppression(".*SSL.*");
 
32
--enable_query_log
 
33
 
 
34
 
 
35
# The default authentication plugin at the server side is mysql_native_password
 
36
 
 
37
--echo
 
38
--echo 
 
39
--echo ======================================================================================
 
40
--echo Checking the user access with SSL through user created with mysql_old_password plugin
 
41
--echo ======================================================================================
 
42
--echo 
 
43
 
 
44
# Creating a user at localhost with mysql_old_password plugin
 
45
 
 
46
--echo Creating a user with the mysql_old_plugin
 
47
 
 
48
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
 
49
 
 
50
set @@session.old_passwords=1;
 
51
 
 
52
set password for 'Tanjotuser1'@'localhost' = password('abc');
 
53
 
 
54
 
 
55
# Trying connecting the client with the mysql_old_password user with out the SSL credentials with secure auth enabled.
 
56
 
 
57
--echo The client should not connect with secure auth enabled.
 
58
 
 
59
select @@global.secure_auth;
 
60
--echo 1 Expected
 
61
 
 
62
--echo **** connecting client using the ssl credentials
 
63
--error 1
 
64
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth -e "select @@Global.old_passwords;select @@session.old_passwords"
 
65
 
 
66
--echo **** connecting client using the ssl credentials
 
67
--error 1
 
68
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
69
 
 
70
--echo **** connecting client using the ssl credentials
 
71
--error 1
 
72
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
73
 
 
74
--echo **** connecting client using the ssl credentials
 
75
--error 1
 
76
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
77
 
 
78
 
 
79
 
 
80
# Trying connecting the client with the mysql_old_password user with out the SSL credentials with secure auth disabled.
 
81
 
 
82
--echo The client should connect with secure auth disabled.
 
83
 
 
84
--disable_warnings
 
85
set @@global.secure_auth=0;
 
86
--enable_warnings
 
87
 
 
88
 
 
89
--echo **** connecting client using the ssl credentials
 
90
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth -e "select @@Global.old_passwords;select @@session.old_passwords"
 
91
--echo 0 for GLOBAL Expected
 
92
--echo 1 for SESSION Expected
 
93
 
 
94
 
 
95
--echo **** connecting client using the ssl credentials
 
96
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
97
--echo 0 for GLOBAL Expected
 
98
--echo 1 for SESSION Expected
 
99
 
 
100
 
 
101
--echo **** connecting client using the ssl credentials
 
102
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
103
--echo 0 for GLOBAL Expected
 
104
--echo 1 for SESSION Expected
 
105
 
 
106
 
 
107
--echo **** connecting client using the ssl credentials
 
108
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
109
--echo 0 for GLOBAL Expected
 
110
--echo 1 for SESSION Expected
 
111
 
 
112
 
 
113
 
 
114
# Trying connecting the client with the mysql_old_password user with out the SSL credentials with secure auth disabled at the server side but enabled at the client side.
 
115
 
 
116
--echo The mysql_old_password plugin client should not connect with secure auth enabled at the client side.
 
117
 
 
118
select @@global.secure_auth;
 
119
--echo 0 Expected
 
120
 
 
121
 
 
122
--echo **** connecting client using the ssl credentials
 
123
--error 1
 
124
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
125
 
 
126
--echo **** connecting client using the ssl credentials
 
127
--error 1
 
128
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
129
 
 
130
--echo **** connecting client using the ssl credentials
 
131
--error 1
 
132
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
133
 
 
134
--echo **** connecting client using the ssl credentials
 
135
--error 1
 
136
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
137
 
 
138
 
 
139
# Dropping the created users
 
140
 
 
141
DROP USER 'Tanjotuser1'@'localhost';
 
142
 
 
143
 
 
144
--echo
 
145
--echo 
 
146
--echo ======================================================================================
 
147
--echo Checking the user access with SSL through user created with mysql_native_password plugin
 
148
--echo ======================================================================================
 
149
--echo 
 
150
 
 
151
# Creating a user at localhost with mysql_native_password plugin
 
152
 
 
153
--echo Creating a user with the mysql_old_plugin
 
154
 
 
155
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
 
156
 
 
157
set @@session.old_passwords=0;
 
158
 
 
159
set password for 'Tanjotuser1'@'localhost' = password('abc');
 
160
 
 
161
 
 
162
# Trying connecting the client with the mysql_native_password user with out the SSL credentials with secure auth enabled.
 
163
 
 
164
--echo The client should connect with secure auth enabled.
 
165
 
 
166
select @@global.secure_auth;
 
167
--echo 0 Expected
 
168
 
 
169
--echo **** connecting client using the ssl credentials
 
170
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
171
--echo 0 for GLOBAL Expected
 
172
--echo 0 for SESSION Expected
 
173
 
 
174
 
 
175
--echo **** connecting client using the ssl credentials
 
176
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
177
--echo 0 for GLOBAL Expected
 
178
--echo 0 for SESSION Expected
 
179
 
 
180
 
 
181
--echo **** connecting client using the ssl credentials
 
182
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
183
--echo 0 for GLOBAL Expected
 
184
--echo 0 for SESSION Expected
 
185
 
 
186
 
 
187
--echo **** connecting client using the ssl credentials
 
188
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
189
--echo 0 for GLOBAL Expected
 
190
--echo 0 for SESSION Expected
 
191
 
 
192
 
 
193
 
 
194
# Trying connecting the client with the mysql_native_password user with out the SSL credentials with secure auth disabled.
 
195
 
 
196
--echo The client should connect with secure auth disabled.
 
197
 
 
198
--disable_warnings
 
199
set @@global.secure_auth=0;
 
200
--enable_warnings
 
201
 
 
202
--echo **** connecting client using the ssl credentials
 
203
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
204
--echo 0 for GLOBAL Expected
 
205
--echo 0 for SESSION Expected
 
206
 
 
207
 
 
208
--echo **** connecting client using the ssl credentials
 
209
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
210
--echo 0 for GLOBAL Expected
 
211
--echo 0 for SESSION Expected
 
212
 
 
213
--echo **** connecting client using the ssl credentials
 
214
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
215
--echo 0 for GLOBAL Expected
 
216
--echo 0 for SESSION Expected
 
217
 
 
218
 
 
219
--echo **** connecting client using the ssl credentials
 
220
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
221
--echo 0 for GLOBAL Expected
 
222
--echo 0 for SESSION Expected
 
223
 
 
224
 
 
225
# Trying connecting the client with the mysql_native_password user with out the SSL credentials with secure auth disabled at the server side but enabled at the client side.
 
226
 
 
227
--echo The mysql_native_password plugin client should  connect with secure auth enabled at the client side.
 
228
 
 
229
select @@global.secure_auth;
 
230
--echo 0 Expected
 
231
 
 
232
 
 
233
--echo **** connecting client using the ssl credentials
 
234
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth -e "select @@Global.old_passwords;select @@session.old_passwords"
 
235
--echo 0 for GLOBAL Expected
 
236
--echo 0 for SESSION Expected
 
237
 
 
238
 
 
239
--echo **** connecting client using the ssl credentials
 
240
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
241
--echo 0 for GLOBAL Expected
 
242
--echo 0 for SESSION Expected
 
243
 
 
244
 
 
245
--echo **** connecting client using the ssl credentials
 
246
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
247
--echo 0 for GLOBAL Expected
 
248
--echo 0 for SESSION Expected
 
249
 
 
250
 
 
251
--echo **** connecting client using the ssl credentials
 
252
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
253
--echo 0 for GLOBAL Expected
 
254
--echo 0 for SESSION Expected
 
255
 
 
256
 
 
257
# Dropping the created users
 
258
 
 
259
DROP USER 'Tanjotuser1'@'localhost';
 
260
 
 
261
 
 
262
 
 
263
--echo
 
264
--echo 
 
265
--echo ======================================================================================
 
266
--echo Checking the user access with SSL through user created with sha256_password plugin
 
267
--echo ======================================================================================
 
268
--echo 
 
269
 
 
270
# Creating a user at localhost with sha256_password plugin
 
271
 
 
272
--echo Creating a user with the mysql_old_plugin
 
273
 
 
274
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password';
 
275
 
 
276
set @@session.old_passwords=2;
 
277
 
 
278
set password for 'Tanjotuser1'@'localhost' = password('abc');
 
279
 
 
280
 
 
281
# Trying connecting the client with the sha256_password user with out the SSL credentials with secure auth enabled.
 
282
 
 
283
--echo The client should connect with secure auth enabled.
 
284
 
 
285
select @@global.secure_auth;
 
286
--echo 0 Expected
 
287
 
 
288
--echo **** connecting client using the ssl credentials
 
289
--error 1
 
290
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
291
 
 
292
 
 
293
--echo **** connecting client using the ssl credentials
 
294
--error 1
 
295
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
296
 
 
297
 
 
298
--echo **** connecting client using the ssl credentials
 
299
--error 1
 
300
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
301
 
 
302
 
 
303
--echo **** connecting client using the ssl credentials
 
304
--error 1
 
305
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
306
 
 
307
 
 
308
# Trying connecting the client with the sha256_password user with out the SSL credentials with secure auth disabled.
 
309
 
 
310
--echo The client should connect with secure auth disabled.
 
311
 
 
312
--disable_warnings
 
313
set @@global.secure_auth=0;
 
314
--enable_warnings
 
315
 
 
316
--echo **** connecting client using the ssl credentials
 
317
--error 1
 
318
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
319
 
 
320
 
 
321
--echo **** connecting client using the ssl credentials
 
322
--error 1
 
323
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
324
 
 
325
--echo **** connecting client using the ssl credentials
 
326
--error 1
 
327
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
328
 
 
329
 
 
330
--echo **** connecting client using the ssl credentials
 
331
--error 1
 
332
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
333
 
 
334
 
 
335
# Trying connecting the client with the mysql_native_password user with out the SSL credentials with secure auth disabled at the server side but enabled at the client side.
 
336
 
 
337
--echo The mysql_native_password plugin client should  connect with secure auth enabled at the client side.
 
338
 
 
339
select @@global.secure_auth;
 
340
--echo 0 Expected
 
341
 
 
342
 
 
343
--echo **** connecting client using the ssl credentials
 
344
--error 1
 
345
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth -e "select @@Global.old_passwords;select @@session.old_passwords"
 
346
 
 
347
 
 
348
--echo **** connecting client using the ssl credentials
 
349
--error 1
 
350
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
351
 
 
352
 
 
353
--echo **** connecting client using the ssl credentials
 
354
--error 1
 
355
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
356
 
 
357
 
 
358
--echo **** connecting client using the ssl credentials
 
359
--error 1
 
360
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
361
 
 
362
 
 
363
# Dropping the created users
 
364
 
 
365
DROP USER 'Tanjotuser1'@'localhost';
 
366
 
 
367
 
 
368
 
 
369
--echo
 
370
--echo 
 
371
--echo =================================================================================================
 
372
--echo Starting the server with the default authentication sha256_password
 
373
--echo =================================================================================================
 
374
--echo 
 
375
 
 
376
--echo # Restart server with default-authentication-plugin=sha256_password;
 
377
 
 
378
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
 
379
--exec echo "wait" > $restart_file
 
380
--shutdown_server 10
 
381
--source include/wait_until_disconnected.inc
 
382
-- exec echo "restart:--default-authentication-plugin=sha256_password  " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 
383
-- enable_reconnect
 
384
-- source include/wait_until_connected_again.inc
 
385
 
 
386
 
 
387
 
 
388
--echo
 
389
--echo 
 
390
--echo ======================================================================================
 
391
--echo Checking the user access with SSL through user created with mysql_old_password plugin
 
392
--echo ======================================================================================
 
393
--echo 
 
394
 
 
395
# Creating a user at localhost with mysql_old_password plugin
 
396
 
 
397
--echo Creating a user with the mysql_old_plugin
 
398
 
 
399
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
 
400
 
 
401
set @@session.old_passwords=1;
 
402
 
 
403
set password for 'Tanjotuser1'@'localhost' = password('abc');
 
404
 
 
405
 
 
406
# Trying connecting the client with the mysql_old_password user with out the SSL credentials with secure auth enabled.
 
407
 
 
408
--echo The client should not connect with secure auth enabled.
 
409
 
 
410
select @@global.secure_auth;
 
411
--echo 1 Expected
 
412
 
 
413
--echo **** connecting client using the ssl credentials
 
414
--error 1
 
415
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth -e "select @@Global.old_passwords;select @@session.old_passwords"
 
416
 
 
417
--echo **** connecting client using the ssl credentials
 
418
--error 1
 
419
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
420
 
 
421
--echo **** connecting client using the ssl credentials
 
422
--error 1
 
423
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
424
 
 
425
--echo **** connecting client using the ssl credentials
 
426
--error 1
 
427
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
428
 
 
429
 
 
430
 
 
431
# Trying connecting the client with the mysql_old_password user with out the SSL credentials with secure auth disabled.
 
432
 
 
433
--echo The client should connect with secure auth disabled.
 
434
 
 
435
--disable_warnings
 
436
set @@global.secure_auth=0;
 
437
--enable_warnings
 
438
 
 
439
 
 
440
--echo **** connecting client using the ssl credentials
 
441
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth -e "select @@Global.old_passwords;select @@session.old_passwords"
 
442
--echo 2 for GLOBAL Expected
 
443
--echo 1 for SESSION Expected
 
444
 
 
445
 
 
446
--echo **** connecting client using the ssl credentials
 
447
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
448
--echo 2 for GLOBAL Expected
 
449
--echo 1 for SESSION Expected
 
450
 
 
451
 
 
452
--echo **** connecting client using the ssl credentials
 
453
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
454
--echo 2 for GLOBAL Expected
 
455
--echo 1 for SESSION Expected
 
456
 
 
457
 
 
458
--echo **** connecting client using the ssl credentials
 
459
--error 1
 
460
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --skip-secure-auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
461
--echo 2 for GLOBAL Expected
 
462
--echo 1 for SESSION Expected
 
463
 
 
464
 
 
465
 
 
466
# Trying connecting the client with the mysql_old_password user with out the SSL credentials with secure auth disabled at the server side but enabled at the client side.
 
467
 
 
468
--echo The mysql_old_password plugin client should not connect with secure auth enabled at the client side.
 
469
 
 
470
select @@global.secure_auth;
 
471
--echo 0 Expected
 
472
 
 
473
 
 
474
--echo **** connecting client using the ssl credentials
 
475
--error 1
 
476
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
477
 
 
478
--echo **** connecting client using the ssl credentials
 
479
--error 1
 
480
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
481
 
 
482
--echo **** connecting client using the ssl credentials
 
483
--error 1
 
484
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
485
 
 
486
--echo **** connecting client using the ssl credentials
 
487
--error 1
 
488
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
489
 
 
490
 
 
491
# Dropping the created users
 
492
 
 
493
DROP USER 'Tanjotuser1'@'localhost';
 
494
 
 
495
 
 
496
--echo
 
497
--echo 
 
498
--echo ======================================================================================
 
499
--echo Checking the user access with SSL through user created with mysql_native_password plugin
 
500
--echo ======================================================================================
 
501
--echo 
 
502
 
 
503
# Creating a user at localhost with mysql_native_password plugin
 
504
 
 
505
--echo Creating a user with the mysql_old_plugin
 
506
 
 
507
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
 
508
 
 
509
set @@session.old_passwords=0;
 
510
 
 
511
set password for 'Tanjotuser1'@'localhost' = password('abc');
 
512
 
 
513
 
 
514
# Trying connecting the client with the mysql_native_password user with out the SSL credentials with secure auth enabled.
 
515
 
 
516
--echo The client should connect with secure auth enabled.
 
517
 
 
518
select @@global.secure_auth;
 
519
--echo 0 Expected
 
520
 
 
521
--echo **** connecting client using the ssl credentials
 
522
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
523
--echo 2 for GLOBAL Expected
 
524
--echo 0 for SESSION Expected
 
525
 
 
526
 
 
527
--echo **** connecting client using the ssl credentials
 
528
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
529
--echo 2 for GLOBAL Expected
 
530
--echo 0 for SESSION Expected
 
531
 
 
532
 
 
533
--echo **** connecting client using the ssl credentials
 
534
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
535
--echo 2 for GLOBAL Expected
 
536
--echo 0 for SESSION Expected
 
537
 
 
538
 
 
539
--echo **** connecting client using the ssl credentials
 
540
--error 1
 
541
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
542
--echo 2 for GLOBAL Expected
 
543
--echo 0 for SESSION Expected
 
544
 
 
545
 
 
546
 
 
547
# Trying connecting the client with the mysql_native_password user with out the SSL credentials with secure auth disabled.
 
548
 
 
549
--echo The client should connect with secure auth disabled.
 
550
 
 
551
--disable_warnings
 
552
set @@global.secure_auth=0;
 
553
--enable_warnings
 
554
 
 
555
--echo **** connecting client using the ssl credentials
 
556
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
557
--echo 2 for GLOBAL Expected
 
558
--echo 0 for SESSION Expected
 
559
 
 
560
 
 
561
--echo **** connecting client using the ssl credentials
 
562
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
563
--echo 2 for GLOBAL Expected
 
564
--echo 0 for SESSION Expected
 
565
 
 
566
--echo **** connecting client using the ssl credentials
 
567
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
568
--echo 2 for GLOBAL Expected
 
569
--echo 0 for SESSION Expected
 
570
 
 
571
 
 
572
--echo **** connecting client using the ssl credentials
 
573
--error 1
 
574
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
575
--echo 2 for GLOBAL Expected
 
576
--echo 0 for SESSION Expected
 
577
 
 
578
 
 
579
# Trying connecting the client with the mysql_native_password user without the SSL credentials with secure auth disabled at the server side but enabled at the client side.
 
580
 
 
581
--echo The mysql_native_password plugin client should  connect with secure auth enabled at the client side.
 
582
 
 
583
select @@global.secure_auth;
 
584
--echo 0 Expected
 
585
 
 
586
 
 
587
--echo **** connecting client using the ssl credentials
 
588
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth -e "select @@Global.old_passwords;select @@session.old_passwords"
 
589
--echo 2 for GLOBAL Expected
 
590
--echo 0 for SESSION Expected
 
591
 
 
592
 
 
593
--echo **** connecting client using the ssl credentials
 
594
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
595
--echo 2 for GLOBAL Expected
 
596
--echo 0 for SESSION Expected
 
597
 
 
598
 
 
599
--echo **** connecting client using the ssl credentials
 
600
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
601
--echo 2 for GLOBAL Expected
 
602
--echo 0 for SESSION Expected
 
603
 
 
604
 
 
605
--echo **** connecting client using the ssl credentials
 
606
--error 1
 
607
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
608
--echo 2 for GLOBAL Expected
 
609
--echo 0 for SESSION Expected
 
610
 
 
611
 
 
612
# Dropping the created users
 
613
 
 
614
DROP USER 'Tanjotuser1'@'localhost';
 
615
 
 
616
 
 
617
 
 
618
--echo
 
619
--echo 
 
620
--echo ======================================================================================
 
621
--echo Checking the user access with SSL through user created with sha256_password plugin
 
622
--echo ======================================================================================
 
623
--echo 
 
624
 
 
625
# Creating a user at localhost with sha256_password plugin
 
626
 
 
627
--echo Creating a user with the sha256_plugin
 
628
 
 
629
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password';
 
630
 
 
631
set @@session.old_passwords=2;
 
632
 
 
633
set password for 'Tanjotuser1'@'localhost' = password('abc');
 
634
 
 
635
GRANT ALL on *.* to 'Tanjotuser1'@'localhost';
 
636
 
 
637
# Trying connecting the client with the sha256_password user without the SSL credentials with secure auth enabled.
 
638
 
 
639
--echo The client should connect with secure auth enabled.
 
640
 
 
641
select @@global.secure_auth;
 
642
--echo 0 Expected
 
643
 
 
644
--echo **** connecting client using the ssl credentials
 
645
--error 1
 
646
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
647
 
 
648
 
 
649
--echo **** connecting client using the ssl credentials
 
650
--error 1
 
651
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
652
 
 
653
 
 
654
--echo **** connecting client using the ssl credentials
 
655
--error 1
 
656
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
657
 
 
658
 
 
659
--echo **** connecting client using the ssl credentials
 
660
--error 1
 
661
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
662
 
 
663
 
 
664
# Trying connecting the client with the sha256_password user without the SSL credentials with secure auth disabled.
 
665
 
 
666
--echo The client should connect with secure auth disabled.
 
667
 
 
668
--disable_warnings
 
669
set @@global.secure_auth=0;
 
670
--enable_warnings
 
671
 
 
672
--echo **** connecting client using the ssl credentials
 
673
--error 1
 
674
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc -e "select @@Global.old_passwords;select @@session.old_passwords"
 
675
 
 
676
 
 
677
--echo **** connecting client using the ssl credentials
 
678
--error 1
 
679
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
680
 
 
681
--echo **** connecting client using the ssl credentials
 
682
--error 1
 
683
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
684
 
 
685
 
 
686
--echo **** connecting client using the ssl credentials
 
687
--error 1
 
688
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
689
 
 
690
# Trying connecting the client with the mysql_native_password user without the SSL credentials with secure auth disabled at the server side but enabled at the client side.
 
691
 
 
692
--echo The mysql_native_password plugin client should  connect with secure auth enabled at the client side.
 
693
 
 
694
select @@global.secure_auth;
 
695
--echo 0 Expected
 
696
 
 
697
 
 
698
--echo **** connecting client using the ssl credentials
 
699
--error 1
 
700
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth -e "select @@Global.old_passwords;select @@session.old_passwords"
 
701
 
 
702
 
 
703
--echo **** connecting client using the ssl credentials
 
704
--error 1
 
705
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_old_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
706
 
 
707
 
 
708
--echo **** connecting client using the ssl credentials
 
709
--error 1
 
710
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=mysql_native_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
711
 
 
712
 
 
713
--echo **** connecting client using the ssl credentials
 
714
--error 1
 
715
--exec $MYSQL -uTanjotuser1 -hlocalhost -pabc --secure_auth --default_auth=sha256_password -e "select @@Global.old_passwords;select @@session.old_passwords"
 
716
 
 
717
# Dropping the created users
 
718
 
 
719
DROP USER 'Tanjotuser1'@'localhost';
 
720
 
 
721
set @@global.secure_auth=default;
 
722
set @@session.old_passwords=default;