| 1 |
# Purpose : Test ssl fips mode behavior in not supported OS. |
| 2 |
# Author : Yashwant Kumar sahu |
| 3 |
############################################################# |
| 4 |
|
| 5 |
# Want to skip this test from daily Valgrind execution |
| 6 |
--source include/no_valgrind_without_big.inc |
| 7 |
--source include/not_have_fips.inc |
| 8 |
|
| 9 |
# Save the initial number of concurrent sessions |
| 10 |
--source include/count_sessions.inc |
| 11 |
|
| 12 |
--echo # |
| 13 |
--echo # Fips support in OS without fips enabled openssl. |
| 14 |
--echo # |
| 15 |
|
| 16 |
--disable_query_log |
| 17 |
call mtr.add_suppression("Resizing redo log"); |
| 18 |
call mtr.add_suppression("Starting to delete and rewrite"); |
| 19 |
call mtr.add_suppression("New redo log files created"); |
| 20 |
--enable_query_log |
| 21 |
|
| 22 |
perl; |
| 23 |
my $filetodelete = "$ENV{'MYSQLTEST_VARDIR'}/log/my_restart.err"; |
| 24 |
while (-e $filetodelete) { |
| 25 |
unlink $filetodelete; |
| 26 |
sleep 1; |
| 27 |
} |
| 28 |
EOF |
| 29 |
|
| 30 |
--echo # |
| 31 |
--echo # Bug #27809371: CLIENTS DO NOT EXIT FOR INVALID --SSL-FIPS-MODE SETTINGS |
| 32 |
--echo # |
| 33 |
|
| 34 |
--echo ##Test: Start the MySQL clients with SSL FIPS mode ON, MySQL clients will abort. |
| 35 |
--error 1 |
| 36 |
--exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT --ssl-fips-mode=ON -e "SHOW VARIABLES LIKE 'ssl_fips%';" |
| 37 |
|
| 38 |
--error 2 |
| 39 |
--exec $MYSQL_DUMP --databases test --ssl-fips-mode=ON |
| 40 |
|
| 41 |
--echo ##Test: Set the variable SSL FIPS mode to ON, since OS doesn't support it. operation will throw error. |
| 42 |
--error 1 |
| 43 |
--exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "SET @@global.ssl_fips_mode = 'ON';" |
| 44 |
--exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "SHOW VARIABLES LIKE 'ssl_fips%';" |
| 45 |
|
| 46 |
--echo MD5 digest |
| 47 |
--echo If FIPS ON set fails, FIPS mode will be set to OFF. All the openssl cryptography should work fine. |
| 48 |
--exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "select md5(8);" |
| 49 |
|
| 50 |
--echo # |
| 51 |
--echo # Bug #33082255: SERVER EXIT TRYING TO SET FIPS MODE |
| 52 |
--echo # |
| 53 |
|
| 54 |
--echo ##Test: Start the server with SSL FIPS mode ON, server will throw error and abort. |
| 55 |
let $error_log = $MYSQLTEST_VARDIR/log/my_restart.err; |
| 56 |
--error 0,1 |
| 57 |
--remove_file $error_log |
| 58 |
let SEARCH_FILE = $error_log; |
| 59 |
let $restart_file = $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; |
| 60 |
--exec echo "wait" > $restart_file |
| 61 |
--shutdown_server |
| 62 |
--source include/wait_until_disconnected.inc |
| 63 |
--error 1 |
| 64 |
--exec $MYSQLD_CMD --loose-console --ssl-fips-mode=ON > $error_log 2>&1 |
| 65 |
let SEARCH_PATTERN = (FIPS_mode_set:fips mode not supported|FIPS_module_mode_set:fingerprint does not match|SSL fips mode error:); |
| 66 |
--source include/search_pattern.inc |
| 67 |
--remove_file $error_log |
| 68 |
|
| 69 |
--echo Restart server with FIPS mode OFF. |
| 70 |
--exec echo "restart:--ssl-fips-mode=OFF " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 71 |
--enable_reconnect |
| 72 |
--source include/wait_until_connected_again.inc |
| 73 |
--disable_reconnect |