1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-09-18 06:47:43 +03:00
Commit Graph

2309 Commits

Author SHA1 Message Date
Sergei Golubchik
d9082c7244 restore manpages to allow builds w/o pandoc 2024-10-24 20:20:54 +02:00
Georg Richter
53243b8a7a Follow up of d4a8ca9209
Last commit was incomplete
2024-10-23 13:08:42 +02:00
Georg Richter
d4a8ca9209 CONC-690: Remove OFF option for WITH_SSL
Due to required cryptographic functions which are part of the TLS
libraries it is no longer possible to build MariaDB Connector/C
without crypto libraries.
2024-10-23 08:04:21 +02:00
Georg Richter
a66f3fc302 Merge branch '3.3' into 3.4 2024-10-22 13:50:24 +02:00
Georg Richter
6635e4bdd6 Fix for CONC-735
If a reconnect occurs, we need to check if mysql->options.host was
already set and pass NULL instead of the previous host name.
2024-10-22 13:26:50 +02:00
Kristian Nielsen
3b29ff9c91 MDEV-34859: Failed to initialise non-blocking API on OpenBSD arm64
Follow-up patch to fix copy-paste error that causes incorrect restore of
registers in my_context_continue which can cause crashes on arm64.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-10-20 17:11:23 +02:00
Sergei Golubchik
6c0e755edf fix compilation errors with -flto
declare plugin structures using their correct type.
Fixes errors like

./libmariadb/libmariadb/ma_client_plugin.c:86:39: error: type of ‘pvio_socket_client_plugin’ does not match original declaration [-Werror=lto-type-mismatch]
./libmariadb/plugins/pvio/pvio_socket.c:141:21: note: type ‘struct MARIADB_PVIO_PLUGIN’ should match type ‘struct st_mysql_client_plugin’

Approved by: Georg Richter <georg@mariadb.com>
2024-10-17 10:02:07 +02:00
Sergei Golubchik
61ef765c43 change plugin TYPE in the REGISTER_PLUGIN to something useful
it's currently unused
2024-10-17 10:00:31 +02:00
Sergei Golubchik
8ace383fa0 fix meaningless code in mariadb_time_to_string()
which was apparently supposed to print microseconds
2024-10-17 10:00:31 +02:00
Georg Richter
c37897b375 remove comment 2024-10-14 14:41:41 +02:00
Georg Richter
f595e6d1a6 Remove doxygen check
This was errnously copied from wrong testing branch.
2024-10-10 15:22:57 +02:00
Georg Richter
9e1155a159 Merge pull request #257 from knielsen/mdev34859_non_blocking_api_aarch64_boost_context
MDEV-34859: Failed to initialise non-blocking API
2024-10-08 14:58:55 +02:00
Georg Richter
d00de5f997 Travis fixes:
- Build x64 (for some unknown reason default windows build
  on travis is x86)
- Disable conc336
2024-10-02 10:23:40 +02:00
Georg Richter
997f0dee0e Fix install location of manpages 2024-10-01 17:05:24 +02:00
Georg Richter
6c597766a7 Documentation generation: Supress warnings
Don't show warnings for non existing documentation (non blocking
api) by default.
2024-09-30 13:45:58 +02:00
Georg Richter
89a9e956a0 CONC-733: Fix documentation (man pages) installation 2024-09-30 10:53:36 +02:00
Kristian Nielsen
da0a01367c Implement boost::context as a fallback for non-blocking API support
The non-blocking API has native (assembler) implementations for x86_64,
i386, and (with recent patch) aarch64; these implementations are the most
efficient. For other architectures, a fallback to ucontext is supported.

But ucontext is not the most efficient, and it is not available on all
platforms (it has been deprecated in POSIX). The boost::context library
provides an alternative fallback that is available on more architectures and
should be more efficient than ucontext (if still not quite as fast as the
native support).

This patch adds a CMake option -DWITH_BOOST_CONTEXT=ON that adds
boost::context as a dependency of libmariadb to provide a fallback on
non-natively supported architectures. Boost::context is preferred over
ucontext when both are available.

The option is off by default and must be explicitly enabled by the
user. This avoids introducing a C++ dependency (including dependency
on a C++ compiler and on libstdc++) unless explicitly requested by the
user (libmariadb is otherwise C-only).

Tested-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-09-27 15:33:43 +02:00
Kristian Nielsen
d2285fb830 MDEV-34859: Failed to initialise non-blocking API on OpenBSD arm64
Implement native my_context for arm64 (aarch64). This is more
efficient than ucontext, and also makes the non-blocking API available
on arm64 platforms that do not have ucontext such as OpenBSD.

Tested-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-09-27 15:32:43 +02:00
Georg Richter
4e83946ecb ed25519: Remove server/client definition
Since server and client have their own ed25519 ref10 implementation
in source tree definitions for server were removed.
2024-09-25 19:54:02 +02:00
Georg Richter
ef59082021 Build fix:
Build ref10 library with position_independent_code property.
2024-09-25 17:18:04 +02:00
Georg Richter
d358547dd0 TLS test fix:
We always need to set verification flag in tls test, to avoid
failing tests if Connector/C was built with option
DEFAULT_SSL_VERIFY_SERVER_CERT=OFF
2024-09-25 08:28:56 +02:00
Georg Richter
7cb4b05d99 Fix for CONC-732: Always set verification callback (OpenSSL)
If peer certificate verification was disabled, we also need
to set the verification callback function to avoid output
from OpenSSL's internal fallback function.
2024-09-25 08:08:39 +02:00
Kai Pastor
ac2447cb60 Fix ushort type check 2024-09-25 06:54:38 +02:00
Georg Richter
968b5f0aa2 Fix for CONC-731: wrong error message (incorrect fp)
- moved fingerprint verification to ma_tls.c
- don't verify cert again if fingerprint check
  succeeded.
- Disable self signed check in fingerprint tests
  (Schannel only).
2024-09-24 12:08:42 +02:00
Georg Richter
39f2e12f9a TLS verification: Added support for envvar MARIADB_TLS_DISABLE_PEER_VERIFICATION
If the environment variable MARIADB_TLS_DISABLE_PEER_VERIFICATION is
set, we will skip verification of the peer certificate.
2024-09-21 17:47:44 +02:00
Georg Richter
b465742c38 Merge branch '3.3' into 3.4 2024-09-21 15:34:26 +02:00
Georg Richter
ae3854159a Merge branch '3.1' into 3.3 2024-09-21 15:33:49 +02:00
Georg Richter
9a40079349 Fix possible crash, if no default plugin was loaded. v3.1.25 2024-09-20 16:52:46 +02:00
Georg Richter
3973fb84bb Merge branch '3.3' into 3.4 2024-09-20 08:38:52 +02:00
Georg Richter
f705f346c7 Merge branch '3.1' into 3.3 2024-09-20 08:35:24 +02:00
Georg Richter
289eaf2ac3 Merge pull request #254 from grooverdan/3.1-CONC-730-undef-behaviour
CONC-730 Undefined behavior in the reference Ed25519 implementation
2024-09-20 08:32:21 +02:00
Sergei Golubchik
c4153aa833 CONC-730 Undefined behavior in the reference Ed25519 implementation
Apply the fix from MXS-4686 and MDEV-31379

Seems to originate from https://github.com/hyperledger/iroha-ed25519/pull/22
2024-09-18 17:20:58 +10:00
Georg Richter
a6fd09f1df OpenSSL timeout fix:
Since timeout was already set via setsockopt, we call wait_io_or_timeout()
with a very small timeout (5ms) to get a more precise errno, which is used
by OpenSSL's error function.
2024-09-17 10:58:25 +02:00
Georg Richter
2804ed910a Merge pull request #253 from mariadb-corporation/revert-250-wait_io_or_timeout-fixes
Revert "Fix usage of wait_io_or_timeout from TLS layers"
2024-09-17 10:45:00 +02:00
Georg Richter
21b12feaad Revert "Fix usage of wait_io_or_timeout from TLS layers" 2024-09-15 07:18:44 +02:00
Georg Richter
56178db1c5 Fix for CONC-726:
The callback function declaration for parameter callbacks should
be bool instead of bool * (typo).
2024-09-14 16:16:04 +02:00
Georg Richter
b45eaa7c9a Merge pull request #250 from azat-ch/wait_io_or_timeout-fixes
Fix usage of wait_io_or_timeout from TLS layers
2024-09-12 19:40:45 +02:00
Georg Richter
858a3e36b7 Fix typo (thanks to OttoK). 2024-09-12 18:44:51 +02:00
Georg Richter
cd81266f44 Fixed build of manpages
To build manpages run cmake with option -DWITH_DOCS=ON.
Creation of man pages requires Python3 and Docygen.

The bundled manpaes were removed from repository.
2024-09-12 14:21:10 +02:00
Georg Richter
e7b6adfbf9 Simplify tls_verification_callback 2024-09-10 07:19:12 +02:00
Georg Richter
78441a1b7d Travis fix (caused by previous merge) 2024-09-09 14:27:35 +02:00
Georg Richter
dfdf3f7557 CONC-712: Don't verify hostname on local connection
Hostname verification is skipped if the connection
is a local connection and is considered secure
(127.0.0.1, localhost, ::1).
2024-09-09 11:12:56 +02:00
Georg Richter
b481c0a494 CONC-724: Added TLS verification callback support
For testing purposes (the python3 dummy server can't handle
further communication after TLS handshake succeeded) support
for verification callback was added.

my_bool callback(MYSQL *mysql, unsigned int *flags, my_bool verified)

Parameter:
  - mysql     connection handle for current connection
  - flags     verification flags
  - verified  true if callback was called after verification,
              otherwise false

Return value:
  - False (0) to continue
  - True  (1) to abort tls connection

The callback function can be registered via
mysql_optionsv(mysql, MARIADB_OPT_TLS_VERIFICATION_CALLBACK, callback);
2024-09-09 10:36:45 +02:00
Georg Richter
375720dc1c GnuTLS fixes:
To behave like OpenSSL and Schannel, we need to check the hostname,
even if other checks failed before.
2024-09-06 10:58:57 +02:00
Georg Richter
b827743c27 Fix parsec build errors (posix) 2024-09-03 07:53:59 +02:00
Georg Richter
0b57bd225a Replaced _Thread_local by __thread
Following Wlad's suggestion we use __thread instead of
_Thread_local (see also server/include/my_compiler.h)
2024-09-03 07:33:57 +02:00
Georg Richter
80be17e99d Test fix: Fix paths for tls_server 2024-09-03 06:06:19 +02:00
Georg Richter
2cc31e8768 Disable TLSv1.0 test
New schannel implementation requires TLSv1.2 or TLSv1.3
2024-08-31 08:27:48 +02:00
Georg Richter
57f38cf87f Save the result of peer certificate verification
Since the MARIADB_TLS_VERIFY_TRUST flag might be cleared in my_auth,
we store the original result of peer certificate verification in
mysql->extension->tls_validation.
This value can be obtained via mariadb_get_infov API function
using option MARIADB_TLS_VERIFY_STATUS.
2024-08-31 07:53:46 +02:00
Georg Richter
4a157ffbb5 Merge branch '3.3' into 3.4 2024-08-31 07:37:31 +02:00