| 1 |
--source include/have_tlsv13.inc |
| 2 |
|
| 3 |
# Save the initial number of concurrent sessions |
| 4 |
--source include/count_sessions.inc |
| 5 |
|
| 6 |
--echo #======================================================================= |
| 7 |
--echo |
| 8 |
--echo # Setup |
| 9 |
--echo |
| 10 |
SELECT @@ssl_cipher INTO @saved_ssl_cipher; |
| 11 |
SELECT @@admin_ssl_cipher INTO @saved_admin_ssl_cipher; |
| 12 |
SELECT @@tls_ciphersuites INTO @saved_tls_ciphersuites; |
| 13 |
SELECT @@admin_tls_ciphersuites INTO @saved_admin_tls_ciphersuites; |
| 14 |
|
| 15 |
CREATE DATABASE cipher_db; |
| 16 |
CREATE TABLE cipher_db.ciphers_data(ciphers JSON); |
| 17 |
--echo |
| 18 |
--echo #======================================================================= |
| 19 |
--echo |
| 20 |
|
| 21 |
--let $TLS_VERSION=TLSv1.2 |
| 22 |
|
| 23 |
--echo # Valid cipher: Search should return empty |
| 24 |
INSERT INTO cipher_db.ciphers_data VALUES ('["ECDHE-RSA-AES128-GCM-SHA256"]'); |
| 25 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 26 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 27 |
|
| 28 |
--echo # Valid ciphers: Search should return empty |
| 29 |
INSERT INTO cipher_db.ciphers_data VALUES ('["ECDHE-RSA-AES128-GCM-SHA256", |
| 30 |
"ECDHE-RSA-AES256-GCM-SHA384"]'); |
| 31 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 32 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 33 |
|
| 34 |
--echo # Deprecated cipher: Search should find warnings |
| 35 |
INSERT INTO cipher_db.ciphers_data VALUES ('["ECDHE-RSA-AES128-SHA256"]'); |
| 36 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 37 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 38 |
|
| 39 |
--echo # Deprecated ciphers: Search should find warnings for each of them |
| 40 |
INSERT INTO cipher_db.ciphers_data VALUES ('["ECDHE-RSA-AES128-SHA256", |
| 41 |
"DHE-RSA-AES256-SHA256"]'); |
| 42 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 43 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 44 |
|
| 45 |
--echo # Mix of valid and deprecated ciphers: Search should find warnings for two of them |
| 46 |
INSERT INTO cipher_db.ciphers_data VALUES ('["ECDHE-RSA-AES128-GCM-SHA256", |
| 47 |
"ECDHE-RSA-AES128-SHA256", |
| 48 |
"DHE-RSA-AES256-SHA256"]'); |
| 49 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 50 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 51 |
|
| 52 |
--echo # Deprecated cipher with "!" prefix: Search should return empty |
| 53 |
INSERT INTO cipher_db.ciphers_data VALUES ('["!ECDHE-RSA-AES128-SHA256"]'); |
| 54 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 55 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 56 |
|
| 57 |
--echo # Deprecated ciphers with "!" prefix: Search should return empty |
| 58 |
INSERT INTO cipher_db.ciphers_data VALUES ('["!ECDHE-RSA-AES128-GCM-SHA256", |
| 59 |
"!ECDHE-RSA-AES256-GCM-SHA384"]'); |
| 60 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 61 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 62 |
|
| 63 |
--echo # Valid ciphers and deprecated ciphers with "!" prefix: Search should return empty |
| 64 |
INSERT INTO cipher_db.ciphers_data VALUES ('["ECDHE-RSA-AES128-GCM-SHA256", |
| 65 |
"!ECDHE-RSA-AES128-SHA256", |
| 66 |
"!DHE-RSA-AES256-SHA256"]'); |
| 67 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 68 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 69 |
|
| 70 |
--let $TLS_VERSION=TLSv1.3 |
| 71 |
|
| 72 |
--echo # Valid cipher: Search should return empty |
| 73 |
INSERT INTO cipher_db.ciphers_data VALUES ('["TLS_AES_128_GCM_SHA256"]'); |
| 74 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 75 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 76 |
|
| 77 |
--echo # Valid ciphers: Search should return empty |
| 78 |
INSERT INTO cipher_db.ciphers_data VALUES ('["TLS_AES_128_GCM_SHA256", |
| 79 |
"TLS_AES_256_GCM_SHA384"]'); |
| 80 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 81 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 82 |
|
| 83 |
--echo # Deprecated cipher: Search should find warnings |
| 84 |
INSERT INTO cipher_db.ciphers_data VALUES ('["TLS_AES_128_CCM_8_SHA256"]'); |
| 85 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 86 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 87 |
|
| 88 |
--echo # Mix of valid and deprecated ciphers: Search should find warnings for one of them |
| 89 |
INSERT INTO cipher_db.ciphers_data VALUES ('["TLS_AES_128_GCM_SHA256", |
| 90 |
"TLS_AES_128_CCM_8_SHA256"]'); |
| 91 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 92 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 93 |
|
| 94 |
--echo # Deprecated cipher with "!" prefix: Search should return empty |
| 95 |
INSERT INTO cipher_db.ciphers_data VALUES ('["!TLS_AES_128_CCM_8_SHA256"]'); |
| 96 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 97 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 98 |
|
| 99 |
--echo # Mix of valid and deprecated ciphers: Search should find warnings for one of them |
| 100 |
INSERT INTO cipher_db.ciphers_data VALUES ('["TLS_AES_128_GCM_SHA256", |
| 101 |
"TLS_AES_128_CCM_8_SHA256", |
| 102 |
"TLS_CHACHA20_POLY1305_SHA256"]'); |
| 103 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 104 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 105 |
|
| 106 |
--echo # Valid ciphers and deprecated ciphers with "!" prefix: Search should return empty |
| 107 |
INSERT INTO cipher_db.ciphers_data VALUES ('["TLS_AES_128_GCM_SHA256", |
| 108 |
"!TLS_AES_128_CCM_8_SHA256"]'); |
| 109 |
--source suite/auth_sec/include/wl15800_variables_test.inc |
| 110 |
TRUNCATE TABLE cipher_db.ciphers_data; |
| 111 |
|
| 112 |
--echo |
| 113 |
--echo #======================================================================= |
| 114 |
--echo |
| 115 |
--echo # Cleanup |
| 116 |
--echo |
| 117 |
SET GLOBAL ssl_cipher = @saved_ssl_cipher; |
| 118 |
SET GLOBAL admin_ssl_cipher = @saved_admin_ssl_cipher; |
| 119 |
SET GLOBAL tls_ciphersuites = @saved_tls_ciphersuites; |
| 120 |
SET GLOBAL admin_tls_ciphersuites = @saved_tls_ciphersuites; |
| 121 |
ALTER INSTANCE RELOAD TLS; |
| 122 |
|
| 123 |
DROP DATABASE cipher_db; |
| 124 |
--echo |
| 125 |
--echo #======================================================================= |
| 126 |
# Wait till we reached the initial number of concurrent sessions |
| 127 |
--source include/wait_until_count_sessions.inc |
| 128 |
|
| 129 |
# Clean slate |
| 130 |
--source include/force_restart.inc |