1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-10 01:02:57 +03:00
Commit Graph

77 Commits

Author SHA1 Message Date
Georg Richter
e633858c9e Merge pull request #261 from markus456/3.3-zstd-compression-level
Add configurable zstd compression level
2024-12-09 22:22:08 +01:00
Georg Richter
136d295d02 Merge branch '3.1' into 3.3 2024-12-09 19:32:13 +01:00
Georg Richter
554893c269 CONC-711: Ubsan and ASAN fixes
- fixed write functions in my_auth.c
- fixed misalignment error when obtaining data via
  option MARIADB_OPT_USERDATA (mysql_get_optionv).
2024-12-09 19:28:10 +01:00
Markus Mäkelä
a2213b89d4 Add MYSQL_OPT_ZSTD_COMPRESSION_LEVEL
The compression level was always hard-coded to 3.
2024-11-07 06:51:57 +02:00
Markus Mäkelä
721103eba1 Fix zstd compression level bytes
The MySQL protocol documentation as well as the comments in code state
that the compression level is stored in one byte. The code, however,
used four bytes.
2024-11-07 06:49:41 +02:00
Sergei Golubchik
f6e99af056 Revert "self-signed certificate verification", it's 3.4 feature
This reverts 395641549ac7..536d9e2b9e5b, in particular:

8dffd56936 MDEV-31857 enable MYSQL_OPT_SSL_VERIFY_SERVER_CERT by default
a99570c118 MDEV-31855 SSL cert validation protocol extension
9aa15e72a7 TLS fingerprint

and related commits
2024-02-19 11:16:26 +01:00
Sergei Golubchik
8dffd56936 MDEV-31857 enable MYSQL_OPT_SSL_VERIFY_SERVER_CERT by default
because the default value of every option is 0
(option and option.extension are bzero-ed to reset),
tls_verify_server_cert was renamed to tls_allow_invalid_server_cert
with the default value of 0, "do not allow".

API didn't change, it's still MYSQL_OPT_SSL_VERIFY_SERVER_CERT
2024-02-04 22:17:25 +01:00
Sergei Golubchik
fcef411ecb MDEV-31855 hash_password_bin for native_password and ed25519 2024-02-04 22:17:25 +01:00
Sergei Golubchik
79a746f290 unix socket and named pipes are secure
as in --require-secure-transport
2024-02-04 22:17:25 +01:00
Sergei Golubchik
a99570c118 MDEV-31855 SSL cert validation protocol extension
* extend the client auth plugin API with a new callback
* relax the plugin version check to allow load a plugin with the
  same major version, even if the minor versions differ
* implement the protocol extension:
  - don't abort at once if the certificate is self signed and
    no CA was explicitly specified
  - allow it if it passes fingerprint check
  - allow it if plugin has hash_password_bin callback, password was
    non-empty and the control hash matches server's
2024-02-04 22:17:25 +01:00
Georg Richter
4f5950b4b6 Merge branch '3.1' into 3.3 2023-10-21 19:46:00 +02:00
Georg Richter
8320f0d54d Fix error on 32-bit systems
Problem was introduced with fix for CONC-668.
2023-10-21 19:43:42 +02:00
Georg Richter
26b2eddbf4 Merge branch '3.1' into 3.3 2023-10-20 06:53:07 +02:00
Georg Richter
35cd69beb4 Fix for CONC-672:
To avoid a false positive GCC warning about possible string
truncation strncpy was replaced by memcpy.
2023-10-20 06:44:38 +02:00
Georg Richter
3a255ee3ea Merge branch '3.1' into 3.3 2023-07-24 11:07:05 +02:00
Georg Richter
45feebb99d Remove server certification verification
Since the server certification option is used by client
only, there is no need to have this flag in server and or
client capabilities. The server itself validates client
certificate depending on the user definition.
2023-07-13 09:30:33 +02:00
Georg Richter
aa614a8beb Merge branch '3.1' into 3.3 2023-04-05 09:28:40 +02:00
Georg Richter
5a94570b39 Fix for CONC-635: Disable TLS/SSL for named pipe/shared mem
Since the server doesn't support secure connections for
shared memory and named pipe connections but indicates
this capability by setting the CLIENT_SSL flag, we unset
this flag in case the connection uses shared memory
or named pipe.
2023-04-05 09:01:25 +02:00
Georg Richter
14df82cdf3 Fix for CONC-634:
Don't switch to compressed protocol if it's not supported by server.
2023-02-11 14:45:44 +01:00
Georg Richter
3f7719c74d Typo fixes (from PR #200) 2022-06-27 13:23:35 +02:00
Georg Richter
c08063a265 Removed bundled ZStandard compression library.
The ZStandard compression plugin will be build only if the
ZStandard libraries and include files are installed on the
builder.
2022-02-04 14:53:42 +01:00
Georg Richter
770cf2286a CONC-575: Support for MySQL zstd compression
ZSTD compression is now supported for connections
to a MySQL Server 8.0.

Compression algorithms are supported via compression
plugins, which can be found in plugins/compress.
2022-01-25 05:02:33 +01:00
Sergei Golubchik
b2db9b91e7 MDEV-27304 SHOW ... result columns are right-aligned
with --version=xxx the server doesn't send 5.5.5- version prefix,
so C/C doesn't detect the server as MariaDB (look for "is_maria"),
but it still sends MARIADB_CLIENT_EXTENDED_METADATA to the server.
This causes the server to send extended metadata, but C/C doesn't expect
it (is_maria is false) and parses the packet incorrectly.

As a fix, backport from 3.2 the code that makes C/C to announce
only those client capabilities that are supported by the server.
2021-12-24 21:09:00 +01:00
Georg Richter
52934a1c08 Merge branch '3.2' into 3.3 2021-10-08 10:26:06 +02:00
Georg Richter
2933a1ca75 Merge branch '3.1' into 3.2 2021-10-05 15:19:59 +02:00
Georg Richter
9c02505474 Fixed for MDEV-26761:
If mariadb_stmt_execute_direct fails, we need to set the number
of parameters (obtained by response packet of mysql_stmt_prepare)
back to the number of prebinded parameters to avoid memory
overrun.

This fix also includes several adress-sanitizer bugs in unit tests
of Connector/C.
2021-10-05 14:50:32 +02:00
Georg Richter
7e0be5a919 CONC-544: restrict authentication plugins
Added new option MARIADB_OPT_RESTRICTED_AUTH (and corresponding
"restricted-auth" option for configuration files) which specifies
on or more comma spearated authentication plugins which are allowed
for authenication.

If the server asks for an authentication plugin not listed in this
option the connect attempt will fail with error CR_PLUGIN_NOT_ALLOWED.
2021-09-14 06:24:56 +02:00
Georg Richter
01ada4b85f Merge branch '3.1' into 3.2 2021-05-03 14:01:37 +02:00
Georg Richter
9244281d6b 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.
2021-04-29 10:59:25 +02:00
Georg Richter
79b1091821 Merge branch '3.1' into 3.2 2020-10-21 13:22:37 +02:00
Georg Richter
7a7c5ada34 CONC-508:
Added support for passwords > 255 characters.
The new capability flag CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA
now indicates that the client can send passwords > 255 characters:
2020-10-21 12:44:41 +02:00
Vladislav Vaintroub
6a763b9000 MDEV-19237 - do not resend prepared statement metadata unnecessarily
fix warnings
2020-10-20 14:58:37 +02:00
Georg Richter
b2966c05e4 Revert "MDEV-19237 - do not resend prepared statement metadata unnecessarily":
This reverts commit ed4d747510.
2020-10-20 14:57:22 +02:00
Vladislav Vaintroub
ed4d747510 MDEV-19237 - do not resend prepared statement metadata unnecessarily
fix warnings
2020-10-15 22:25:09 +02:00
Georg Richter
01859950cf Revert "Fix for CONC-494:"
This reverts commit 8581cafad4.
2020-09-09 12:19:27 +02:00
Georg Richter
8581cafad4 Fix for CONC-494:
Install all symlinks for shared and static libraries in
component Development instead of SharedLibraries.
2020-09-09 10:24:55 +02:00
Georg Richter
37a4fd1d6d Workaround for CONC-469
If no default authentication plugin was specified and the server sends preferred
authentication method in server hello package client now uses servers preferred
authentication method instead of using mysql_native_password. If no default
authentication plugin was specified and the server didn't send an
authenticatoin method client uses the default mysql_native_password plugin.
2020-05-25 11:50:04 +02:00
Oleksandr Byelkin
328580aab1 Because the function strncpy() will not ensure that the destination
string will be terminated by the NUL character, it is best to do that
externally in the caller. This code was originally introduced in
commit beb9d5ea89.
(patch by Marko)
2020-03-11 08:12:53 +01:00
Georg Richter
1218ffac1a Fix for CONC-452 and CONC-453:
Various coverity scan fixes, including CONC-452 and CONC-453.
Special thanks to Lukas Javorsky for fixing numerous covscan
issues (This patch includes part of his pull request #126).

Coverity scan build was using the following cmake parameters:
-WITH_EXTERNAL_ZLIB=ON -DWITH_UNIT_TESTS=OFF.

CWE-416 (use after free) in dtoa.c (from netlib) is still open.
2020-02-14 09:52:21 +01:00
Georg Richter
b5bd0e5818 Merge commit '77d051e89d0b342333d951e66e53f2aea43f6e36' into 3.1 2019-07-16 17:33:00 +02:00
Georg Richter
dc0f66f006 Post fix for CONC-345: removed semicolon 2019-07-05 14:09:00 +02:00
Georg Richter
0f4891359a Fix for CONC-345: heap-use-after-free in client_mpvio_read_packet
Kudos to Kentoku Shiba
2019-07-05 11:42:12 +02:00
Georg Richter
af47d1beab Merge branch '3.0' into 3.1 2019-03-03 14:03:20 +01:00
Sergei Golubchik
beb9d5ea89 MDEV-11340 Allow multiple alternative authentication methods for the same user
continue the authentication if the auth plugin is not found,
perhaps the next plugin in the chain will work.
2019-02-04 16:07:05 +01:00
Sergei Golubchik
1e4b08bd29 MDEV-11340 Allow multiple alternative authentication methods for the same user
expect multiple plugin restarts within a single authentication
2019-02-04 16:06:47 +01:00
Georg Richter
1788e000d2 Fix for CONC-332:
mysql_change_user doesn't reset server status

Fixed my_auth.c, after successful connect the server status package information (including session change information) must be updated.
2018-07-27 07:17:27 +02:00
Georg Richter
a0d4b422bd Fix for CONC-345: heap-use-after free in client_mpvio_read_packet
We need to check if pkt_len is > 0 before the buffer content will be checked.
2018-07-03 11:17:46 +02:00
Georg Richter
638f2aa8dd Revert "Fix for CONC-332:"
This reverts commit 0c29fdbbb3.
The fix breaks kill test in mtr (Windows).
2018-05-18 12:24:56 +02:00
Georg Richter
0c29fdbbb3 Fix for CONC-332:
After calling mysql_real_connect or mysql_change_user the server_status was
not updated, since run_plugin_auth didn't read the entire OK packet.
2018-05-17 07:10:15 +02:00
luz.paz
b2e6ed0295 Fixes misc. typos
found via `codespell -q 3`
2018-04-13 07:30:23 +02:00