Skip to content

Commit 1ac4aeb

Browse files
committed
MDEV-35581 On servers linked against WolfSSL SSL_Cipher and SSL_cipher_list are always the same
emulate OpenSSL behavior in WolfSSL: * use wolfSSL_get_cipher_list(i) for SSL_get_cipher_list(ctx, i), not wolfSSL_get_cipher_list_ex(ctx, i), which returns only the cipher used in the current connection.
1 parent 0d20ed9 commit 1ac4aeb

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

include/ssl_compat.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
#define ERR_remove_state(x) do {} while(0)
5858
#undef SSL_get_cipher
5959
#define SSL_get_cipher(ssl) (SSL_version(ssl) == TLS1_3_VERSION ? wolfSSL_get_cipher(ssl) : wolfSSL_get_cipher_name(ssl))
60+
#undef SSL_get_cipher_list
61+
#define SSL_get_cipher_list(ctx,i) wolfSSL_get_cipher_list(i)
6062
#elif defined (HAVE_ERR_remove_thread_state)
6163
#define ERR_remove_state(X) ERR_remove_thread_state(NULL)
6264
#endif /* HAVE_ERR_remove_thread_state */

mysql-test/main/ssl.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,11 +2188,20 @@ drop table t1;
21882188
SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
21892189
have_ssl
21902190
1
2191+
#
2192+
# MDEV-7697 Client reports ERROR 2006 (MySQL server has gone away) or ERROR 2013 (Lost connection to server during query) while executing AES* functions under SSL
2193+
#
21912194
select aes_decrypt('MySQL','adf');
21922195
aes_decrypt('MySQL','adf')
21932196
NULL
21942197
select 'still connected?';
21952198
still connected?
21962199
still connected?
2200+
#
2201+
# MDEV-35581 On servers linked against WolfSSL SSL_Cipher and SSL_cipher_list are always the same
2202+
#
2203+
select variable_value like '%:%' from information_schema.session_status where variable_name='ssl_cipher_list';
2204+
variable_value like '%:%'
2205+
1
21972206
connection default;
21982207
disconnect ssl_con;

mysql-test/main/ssl.test

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ SHOW STATUS LIKE 'Ssl_server_not_after';
2929
# Check ssl turned on
3030
SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
3131

32-
#
33-
# MDEV-7697 Client reports ERROR 2006 (MySQL server has gone away) or ERROR 2013 (Lost connection to server during query) while executing AES* functions under SSL
34-
#
32+
--echo #
33+
--echo # MDEV-7697 Client reports ERROR 2006 (MySQL server has gone away) or ERROR 2013 (Lost connection to server during query) while executing AES* functions under SSL
34+
--echo #
3535
select aes_decrypt('MySQL','adf');
3636
select 'still connected?';
3737

38+
--echo #
39+
--echo # MDEV-35581 On servers linked against WolfSSL SSL_Cipher and SSL_cipher_list are always the same
40+
--echo #
41+
select variable_value like '%:%' from information_schema.session_status where variable_name='ssl_cipher_list';
42+
3843
connection default;
3944
disconnect ssl_con;
4045

0 commit comments

Comments
 (0)