Skip to content

Commit 441b4af

Browse files
author
Ramil Kalimullin
committed
Bug#25094892: ADD SUPPORT FOR OPENSSL 1.1
1 parent d20ccda commit 441b4af

30 files changed

+205
-92
lines changed

extra/yassl/include/openssl/ssl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ enum { /* X509 Constants */
192192
unsigned long ERR_get_error_line_data(const char**, int*, const char**, int *);
193193
void ERR_print_errors_fp(FILE*);
194194
char* ERR_error_string(unsigned long,char*);
195-
void ERR_remove_state(unsigned long);
195+
void ERR_remove_thread_state(const void *);
196196
unsigned long ERR_get_error(void);
197197
unsigned long ERR_peek_error(void);
198198
int ERR_GET_REASON(int);

extra/yassl/src/ssl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ int SSLeay_add_ssl_algorithms() // compatibility only
16671667
}
16681668

16691669

1670-
void ERR_remove_state(unsigned long)
1670+
void ERR_remove_thread_state(const void *)
16711671
{
16721672
GetErrors().Remove();
16731673
}

mysql-test/r/ssl_crl.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
2828
# try to connect with '--ssl-crl' option using tilde home directoy
2929
# path substitution : should connect
3030
Variable_name Value
31-
Ssl_cipher DHE-RSA-AES128-GCM-SHA256
31+
Ssl_cipher SSL_CIPHER
3232
# try to connect with '--ssl-crlpath' option using tilde home directoy
3333
# path substitution : should connect
3434
Variable_name Value
35-
Ssl_cipher DHE-RSA-AES128-GCM-SHA256
35+
Ssl_cipher SSL_CIPHER

mysql-test/suite/auth_sec/t/mysql_ssl_connection.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
connection default;
88
CREATE USER u_20693153@localhost IDENTIFIED BY 'abcd';
99

10-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
10+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
1111
--exec $MYSQL --protocol=TCP -uu_20693153 -pabcd --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem -e "SHOW STATUS LIKE 'Ssl_cipher';"
1212

1313
DROP USER u_20693153@localhost;

mysql-test/suite/auth_sec/t/openssl_cert_generation.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ let SEARCH_PATTERN= Auto generated SSL certificates are placed in data directory
182182
--file_exists $MYSQLTEST_VARDIR/mysqld.1/data/public_key.pem
183183

184184
--echo # Ensure that server is ssl enabled
185-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
185+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
186186
--exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher'"
187187
#-----------------------------------------------------------------------------
188188

@@ -284,7 +284,7 @@ grant usage on *.* to wl7699_sha256 identified by 'abcd';
284284

285285
# Using SSL certificates
286286
--echo # Should be able to connect to server using generated SSL certificates.
287-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
287+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
288288
--exec $MYSQL -uwl7699_sha256 -pabcd --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher'"
289289
# Using RSA key pair
290290
--echo # Should be able to connect to server using RSA key pair.
@@ -350,7 +350,7 @@ show variables like 'sha256%';
350350

351351
--echo # 6.3 : SSL connection
352352
--echo # Should be able to connect to server using generated SSL certificates.
353-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
353+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
354354
--exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher'"
355355

356356

@@ -361,7 +361,7 @@ grant usage on *.* to wl7699_sha256 identified by 'abcd';
361361

362362
# Using SSL certificates
363363
--echo # Should be able to connect to server using generated SSL certificates.
364-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
364+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
365365
--exec $MYSQL -uwl7699_sha256 -pabcd --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher'"
366366
# Using RSA key pair
367367
--echo # Should be able to connect to server using RSA key pair.

mysql-test/suite/auth_sec/t/ssl_auto_detect.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let SEARCH_PATTERN= CA certificate .* is self signed.;
5353

5454
--echo # Try to establish SSL connection : This must succeed.
5555
connect (ssl_root_1,localhost,root,,,,,SSL);
56-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
56+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
5757
SHOW STATUS LIKE 'Ssl_cipher';
5858
SHOW VARIABLES LIKE 'have_ssl';
5959

@@ -67,7 +67,7 @@ connection default;
6767
disconnect ssl_root_1;
6868

6969
--echo # Connect using mysql client : This must succeed.
70-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
70+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
7171
--exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher';"
7272

7373

@@ -139,7 +139,7 @@ let SEARCH_PATTERN= CA certificate .* is self signed.;
139139
--source include/search_pattern.inc
140140

141141
--echo # Try creating SSL connection
142-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
142+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
143143
--exec $MYSQL -uroot --ssl-mode=REQUIRED -e "show status like 'Ssl_cipher';"
144144

145145

mysql-test/suite/auth_sec/t/tls.test

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,17 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`;
3232
let $MYSQL_SOCKET= `SELECT @@socket`;
3333
let $MYSQL_PORT= `SELECT @@port`;
3434

35-
let $cipher_default= DHE-RSA-AES256-SHA;
3635
let $tls_default= TLSv1.1;
3736
let $openssl= query_get_value("SHOW STATUS LIKE 'Rsa_public_key'", Variable_name, 1);
3837
if ($openssl == 'Rsa_public_key'){
39-
let $cipher_default= DHE-RSA-AES128-GCM-SHA256;
4038
let $tls_default= TLSv1.2;
4139
}
4240
--echo #T1: Default TLS connection
4341
--replace_result $tls_default TLS_VERSION
4442
--exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "SHOW STATUS like 'Ssl_version'"
4543

4644
--echo #T2: Default SSL cipher
47-
--replace_result $cipher_default SSL_CIPHER
45+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
4846
--exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "SHOW STATUS like 'Ssl_cipher'"
4947

5048
--echo #T3: Setting TLS version TLSv1.2 (for yassl TLSv1.1) from the client

mysql-test/t/mysql_ssl_default.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
--echo # verify that mysql default connect with ssl channel when using TCP/IP
1313
--echo # connection
14-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
14+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
1515
--exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "SHOW STATUS like 'Ssl_cipher'"
1616

1717
--echo # verify that mysql --ssl=0 connect with unencrypted channel
18-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
18+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
1919
--exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "SHOW STATUS like 'Ssl_cipher'" --ssl-mode=DISABLED
2020

2121
--echo # verify that mysql --ssl=1 connect with ssl channel
22-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
22+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
2323
--exec $MYSQL --host=127.0.0.1 -P $MASTER_MYPORT -e "SHOW STATUS like 'Ssl_cipher'" --ssl-mode=REQUIRED
2424

2525
CREATE USER u1@localhost IDENTIFIED BY 'secret' REQUIRE SSL;

mysql-test/t/openssl_1.test

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,21 @@ drop table if exists t1;
1616
create table t1(f1 int);
1717
insert into t1 values (5);
1818

19-
let $cipher_val= "DHE-RSA-AES256-SHA";
20-
let $shavars= query_get_value("SHOW STATUS LIKE 'Rsa_public_key'", Variable_name, 1);
21-
if ($shavars == 'Rsa_public_key'){
22-
let $cipher_val= "DHE-RSA-AES128-GCM-SHA256";
23-
}
19+
connect (con0,localhost,root,,,,,SSL);
20+
connection con0;
21+
let $cipher= query_get_value("SHOW STATUS like 'Ssl_cipher'", Value, 1);
22+
let $cipher_val= "$cipher";
23+
connection default;
24+
disconnect con0;
2425

2526
grant select on test.* to ssl_user1@localhost require SSL;
26-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
27+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
2728
-- eval grant select on test.* to ssl_user2@localhost require cipher $cipher_val
28-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
29+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
2930
-- eval grant select on test.* to ssl_user3@localhost require cipher $cipher_val AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client"
30-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
31+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
3132
-- eval grant select on test.* to ssl_user4@localhost require cipher $cipher_val AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"
32-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
33+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
3334
-- eval grant select on test.* to ssl_user5@localhost require cipher $cipher_val AND SUBJECT "xxx"
3435
flush privileges;
3536

@@ -43,31 +44,31 @@ connect (con5,localhost,ssl_user5,,,,,SSL);
4344

4445
connection con1;
4546
# Check ssl turned on
46-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
47+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
4748
SHOW STATUS LIKE 'Ssl_cipher';
4849
select * from t1;
4950
--error ER_TABLEACCESS_DENIED_ERROR
5051
delete from t1;
5152

5253
connection con2;
5354
# Check ssl turned on
54-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
55+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
5556
SHOW STATUS LIKE 'Ssl_cipher';
5657
select * from t1;
5758
--error ER_TABLEACCESS_DENIED_ERROR
5859
delete from t1;
5960

6061
connection con3;
6162
# Check ssl turned on
62-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
63+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
6364
SHOW STATUS LIKE 'Ssl_cipher';
6465
select * from t1;
6566
--error ER_TABLEACCESS_DENIED_ERROR
6667
delete from t1;
6768

6869
connection con4;
6970
# Check ssl turned on
70-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
71+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
7172
SHOW STATUS LIKE 'Ssl_cipher';
7273
select * from t1;
7374
--error ER_TABLEACCESS_DENIED_ERROR
@@ -145,7 +146,7 @@ drop table t1;
145146
# verification of servers certificate by setting both ca certificate
146147
# and ca path to NULL
147148
#
148-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
149+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
149150
--exec $MYSQL --ssl-mode=REQUIRED --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
150151
--echo End of 5.0 tests
151152

@@ -276,7 +277,7 @@ select 'is still running; no cipher request crashed the server' as result from d
276277
GRANT SELECT ON test.* TO bug42158@localhost REQUIRE X509;
277278
FLUSH PRIVILEGES;
278279
connect(con1,localhost,bug42158,,,,,SSL);
279-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
280+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
280281
SHOW STATUS LIKE 'Ssl_cipher';
281282
disconnect con1;
282283
connection default;

mysql-test/t/plugin_auth_sha256_tls.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--source include/have_ssl.inc
22

33
connect (ssl_con,localhost,root,,,,,SSL);
4-
--replace_result DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
4+
--replace_result ECDHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES128-GCM-SHA256 SSL_CIPHER DHE-RSA-AES256-SHA SSL_CIPHER
55
SHOW STATUS LIKE 'Ssl_cipher';
66

77
CREATE USER 'kristofer' IDENTIFIED WITH 'sha256_password';

0 commit comments

Comments
 (0)