From 0bd29ba4fab5a4c75ea93f71983381433b90b35c Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 23 Mar 2021 21:00:42 +0100 Subject: [PATCH 1/3] MDEV-25232 CMake Deprecation Warning Compatibility with CMake < 2.8.12 ...will be removed from a future version of CMake. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29ebbf69..498eca0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the LGPL libmariadb project. -CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR) INCLUDE(CheckFunctionExists) IF(COMMAND CMAKE_POLICY) SET(NEW_POLICIES CMP0003 CMP0022 CMP0023 CMP0077 CMP0069 CMP0075) From 9244281d6bee84b3bce0362352f7545f377f2305 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Thu, 29 Apr 2021 10:59:25 +0200 Subject: [PATCH 2/3] Fix for CONC-490: If CLIENT_CONNECT_WITH_DB flag was specified without a database name, we need to unset this flag to prevent breaking connection handshake. --- plugins/auth/my_auth.c | 4 ++++ unittest/libmariadb/connection.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/plugins/auth/my_auth.c b/plugins/auth/my_auth.c index ea33e0cd..4e17ef7d 100644 --- a/plugins/auth/my_auth.c +++ b/plugins/auth/my_auth.c @@ -231,6 +231,10 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio, #endif /* HAVE_TLS && !EMBEDDED_LIBRARY*/ if (mpvio->db) mysql->client_flag|= CLIENT_CONNECT_WITH_DB; + else + /* See CONC-490: If no database was specified, we need + to unset CLIENT_CONNECT_WITH_DB flag */ + mysql->client_flag&= ~CLIENT_CONNECT_WITH_DB; /* if server doesn't support SSL and verification of server certificate was set to mandatory, we need to return an error */ diff --git a/unittest/libmariadb/connection.c b/unittest/libmariadb/connection.c index 70d347ce..0da10cbe 100644 --- a/unittest/libmariadb/connection.c +++ b/unittest/libmariadb/connection.c @@ -1892,7 +1892,22 @@ static int test_gtid(MYSQL *mysql) return OK; } +static int test_conc490(MYSQL *my __attribute__((unused))) +{ + MYSQL *mysql= mysql_init(NULL); + + if (!my_test_connect(mysql, hostname, username, + password, NULL, port, socketname, CLIENT_CONNECT_WITH_DB)) + { + diag("error: %s\n", mysql_error(mysql)); + return FAIL; + } + mysql_close(mysql); + return OK; +} + struct my_tests_st my_tests[] = { + {"test_conc490", test_conc490, TEST_CONNECTION_NONE, 0, NULL, NULL}, {"test_gtid", test_gtid, TEST_CONNECTION_DEFAULT, 0, NULL, NULL}, {"test_conc496", test_conc496, TEST_CONNECTION_DEFAULT, 0, NULL, NULL}, {"test_default_auth", test_default_auth, TEST_CONNECTION_NONE, 0, NULL, NULL}, From 180c543704d627a50a52aaf60e24ca14e0ec4686 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Mon, 3 May 2021 13:58:17 +0200 Subject: [PATCH 3/3] Fix for CONC-548: Symbol conflict with libsodium To avoid conflicts (and possible crashes) by duplicate symbols the function crypto_sign was renamed to ma_crypto_sign. Kudos to Peter van Dijk for reporting this issue. --- plugins/auth/ed25519.c | 2 +- plugins/auth/ref10/crypto_sign.h | 2 +- plugins/auth/ref10/sign.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/auth/ed25519.c b/plugins/auth/ed25519.c index ed36ab09..918b8bad 100644 --- a/plugins/auth/ed25519.c +++ b/plugins/auth/ed25519.c @@ -108,7 +108,7 @@ static int auth_ed25519_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) return CR_SERVER_HANDSHAKE_ERR; /* Sign nonce: the crypto_sign function is part of ref10 */ - crypto_sign(signature, packet, NONCE_BYTES, (unsigned char*)mysql->passwd, strlen(mysql->passwd)); + ma_crypto_sign(signature, packet, NONCE_BYTES, (unsigned char*)mysql->passwd, strlen(mysql->passwd)); /* send signature to server */ if (vio->write_packet(vio, signature, CRYPTO_BYTES)) diff --git a/plugins/auth/ref10/crypto_sign.h b/plugins/auth/ref10/crypto_sign.h index e12a8c71..5f9b3437 100644 --- a/plugins/auth/ref10/crypto_sign.h +++ b/plugins/auth/ref10/crypto_sign.h @@ -2,7 +2,7 @@ int crypto_sign_keypair( unsigned char *pk, unsigned char *pw, unsigned long long pwlen ); -int crypto_sign( +int ma_crypto_sign( unsigned char *sm, const unsigned char *m, unsigned long long mlen, const unsigned char *pw, unsigned long long pwlen diff --git a/plugins/auth/ref10/sign.c b/plugins/auth/ref10/sign.c index 0cf1edd1..b4153201 100644 --- a/plugins/auth/ref10/sign.c +++ b/plugins/auth/ref10/sign.c @@ -4,7 +4,7 @@ #include "ge.h" #include "sc.h" -int crypto_sign( +int ma_crypto_sign( unsigned char *sm, const unsigned char *m,unsigned long long mlen, const unsigned char *pw,unsigned long long pwlen