Commit graph

80 commits

Author SHA1 Message Date
Marko Mäkelä
b53b81e937 Merge 11.2 into 11.4 2024-10-03 14:32:14 +03:00
Marko Mäkelä
63913ce5af Merge 10.6 into 10.11 2024-10-03 10:55:08 +03:00
Marko Mäkelä
7e0afb1c73 Merge 10.5 into 10.6 2024-10-03 09:31:39 +03:00
Tony Chen
be164fc401 ssl_cipher parameter cannot configure TLSv1.3 and TLSv1.2 ciphers at the same time
SSL_CTX_set_ciphersuites() sets the TLSv1.3 cipher suites.

SSL_CTX_set_cipher_list() sets the ciphers for TLSv1.2 and below.

The current TLS configuration logic will not perform SSL_CTX_set_cipher_list()
to configure TLSv1.2 ciphers if the call to SSL_CTX_set_ciphersuites() was
successful. The call to SSL_CTX_set_ciphersuites() is successful if any TLSv1.3
cipher suite is passed into `--ssl-cipher`.

This is a potential security vulnerability because users trying to restrict
specific secure ciphers for TLSv1.3 and TLSv1.2, would unknowingly still have
the database support insecure TLSv1.2 ciphers.

For example:
If setting `--ssl_cipher=TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256`,
the database would still support all possible TLSv1.2 ciphers rather than only
ECDHE-RSA-AES128-GCM-SHA256.

The solution is to execute both SSL_CTX_set_ciphersuites() and
SSL_CTX_set_cipher_list() even if the first call succeeds.

This allows the configuration of exactly which TLSv1.3 and TLSv1.2 ciphers to
support.

Note that there is 1 behavior change with this. When specifying only TLSv1.3
ciphers to `--ssl-cipher`, the database will not support any TLSv1.2 cipher.
However, this does not impose a security risk and considering TLSv1.3 is the
modern protocol, this behavior should be fine.

All TLSv1.3 ciphers are still supported if only TLSv1.2 ciphers are specified
through `--ssl-cipher`.

All new code of the whole pull request, including one or several files that are
either new files or modified ones, are contributed under the BSD-new license. I
am contributing on behalf of my employer Amazon Web Services, Inc.
2024-09-26 11:50:20 +02:00
Oleksandr Byelkin
99b370e023 Merge branch '11.2' into 11.4 2024-05-21 19:38:51 +02:00
Sergei Golubchik
a6b2f820e0 Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
Sergei Golubchik
7b53672c63 Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
Sergei Golubchik
349ca2be74 mtr: remove innodb combinations
dead code for about 10 years
2024-05-05 21:37:08 +02:00
Sergei Golubchik
05a421eb36 cleanup: X509_check_host() in the internal client
X509_check_host() and X509_check_ip_asc() exist in all
supported SSL libraries

in OpenSSL >= 1.0.2 and in the bundled WolfSSL

And X509_free() handles NULL pointers all right.
2024-02-04 22:19:19 +01:00
Sergei Golubchik
4f9396b9f8 MDEV-31474 KDF() function
KDF(key_str, salt [, {info | iterations} [, kdf_name [, width ]]])

kdf_name is "hkdf" or "pbkdf2_hmac" (default).

width (in bits) can be any number divisible by 8,
by default it's taken from @@block_encryption_mode

iterations must be positive, and is 1000 by default

OpenSSL 1.0 doesn't support HKDF, so it'll return NULL.
This OpenSSL version is still used in SLES 12 and CentOS 7
2023-09-30 14:43:12 +02:00
Vladislav Vaintroub
74f2e6c85e MDEV-26713 Add test for mysql_install_db creating service, with i18 2021-12-15 19:13:57 +01:00
Vladislav Vaintroub
ba9d231b5a MDEV-26713 Set activeCodePage=UTF8 for windows programs
- Use corresponding entry in the manifest, as described in
https://docs.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page

- If if ANSI codepage is UTF8 (i.e for Windows 1903 and later)
  Use UTF8 as default client charset
  Set console codepage(s) to UTF8, in case process is using console

- Allow some previously disabled MTR tests, that used Unicode for in "exec",
  for the recent Windows versions
2021-12-15 19:13:57 +01:00
Vladislav Vaintroub
0102732686 Revert "MDEV-26713 Windows - improve utf8 support for command line tools"
This reverts commit several commits pushed by mistake.
2021-11-19 09:46:57 +01:00
Vladislav Vaintroub
012d3cecb8 MDEV-26713 Windows - improve utf8 support for command line tools 2021-11-18 17:25:40 +01:00
Dmitry Shulga
429382c29f MDEV-26142: Fix failures of the tests main.features and sys_vars.stored_program_cache_func when they are run in PS mode
These tests produced different results in case they were run
with the option --ps-protocol.

These tests produced different result sets since a value of
Feature_subquery and handler_read_key status system variables
are updated one time more for ps-protocol (the first time it is updated
on Prepare phase and the second time on Execute phase of PS protocol)
So different result sets are expected for both tests. To make tests
successfully runnable both for case it is run with and without
the option --ps-protocol the new protocol combination [ps, nm]
and protocol specific result files have been added.

Moreover, the perl script mysql-test/mariadb-test-run.pl
has been updated to make the variable opt_ps_protocol visible
outside perl file containing this variable.
2021-07-15 16:27:31 +07:00
Daniel Black
6a3a046013 mtr: aix - no pool of threads 2021-07-02 17:17:19 +10:00
Daniel Black
2301093f8f MDEV-25894: support AIX as a platform in mtr
Parital backport of 48938c57c7
so platform dependent AIX tests can be done.
2021-07-02 17:17:19 +10:00
Vladislav Vaintroub
dbe3161b6d Remove WolfSSL workaround for old version.
We're already on 4.4.6
2021-06-09 15:44:55 +02:00
Sergei Golubchik
5b0df7433d WolfSSL fixes
remove Timeval workaround (not needed anymore).
add template workaround.
comments.
2020-05-08 12:49:53 +02:00
Vladislav Vaintroub
403dc759d0 Update WolfSSL
Fix WolfSSL build:

- Do not build with TLSv1.0,it stopped working,at least with SChannel client
- Disable a test that depends on TLSv1.0
- define FP_MAX_BITS always, to fix 32bit builds.
- Increase MAX_AES_CTX_SIZE, to fix build on Linux
2020-05-08 11:51:03 +02:00
Sergei Golubchik
c2db9397c7 MDEV-18565 Galera mtr-suite fails if galera library is not installed
revert/simplify f5390eea9a

remove galera-specific checks from mtr and the main suite
2020-04-27 09:22:36 +02:00
Sergei Golubchik
071feae319 MDEV-20170 main.tls_version and main.tls_version1 fail in buildbot on RHEL8
Instead of trying to detect MinProtocol=TLSv1.2 in all possible
sections of files in all possible locations where openssl is configured
to find its configuration in all possible distros (and these locations
are mutually different in Debian, Ubuntu, and RHEL, btw) - just make
mtr to instruct openssl not to read any config files at all.
2019-12-27 21:14:42 +01:00
Julius Goryavsky
c5bc0cedea MDEV-20185: Windows: Use of uninitialized value $bpath in string eq
The execution of mtr in the Windows environment fails due to
the fact that the new code from MDEV-18565 does not take into
account the need to add the ".exe" extension to the names of
executable files when searching for pre-requisites that are
needed to run SST scripts (especially when using mariabackup)
and when searching paths to some other Galera utilities.
This patch fixes this flaw.

Also adding paths to the PATH environment variable is now
done with the correct delimiter character.
2019-08-19 23:56:11 +02:00
Julius Goryavsky
f5390eea9a MDEV-18565: Galera mtr-suite fails if galera library is not installed
Currently, running mtr with an incorrect (for example, new or
obsolete) version of wsrep_provider (for example, with the 26
version of libgalera_smm.so) leads to the failure of tests in
several suites with vague error diagnostics.

As for the galera_3nodes suite, the mtr also does not effectively
check all the prerequisites after merge with MDEV-18426 fixes.
For example, tests that using mariabackup do not check for presence
of ss and socat/nc. This is due to improper handling of relative
paths in mtr scripts.

In addition, some tests in different suites can be run without
setting the environment variables such as MTR_GALERA_TFMT, XBSTREAM,
and so on.

To eliminate all these issues, this patch makes the following changes:

1. Added auxiliary wsrep_mtr_check utility (which located in the
mysql-test/lib/My/SafeProcess subdirectory), which compares the
versions of the wsrep API that used by the server and by the wsrep
provider library, and it does this comparison safely, without
accessing the API if the versions do not match.

2. All checks related to the presence of mariabackup and utilities
that necessary for its operation transferred from the local directories
of different mtr suites (from the suite.pm files) to the main suite.pm
file. This not only reduces the amount of code and eliminates duplication
of identical code fragments, but also avoids problems due to the inability
of mtr to consider relative paths to include files when checking skip
combinations.

3. Setting the values of auxiliary environment variables that
are necessary for Galera, SST scripts and mariabackup (to work
properly) is moved to the main mysql-test-run.pl script, so as
not to duplicate this code in different suites, and to avoid
partial corrections of the same errors for different suites
(while other suites remain uncorrected).

4. Fixed duplication of the have_file_key_management.inc and
have_filekeymanagement.inc files between different suites,
these checks are also transferred to the top level.

5. Added garbd presence check and garbd path variable.

https://jira.mariadb.org/browse/MDEV-18565
2019-07-17 12:57:38 +02:00
Sergei Golubchik
3acf741051 fix suite.pm to not garble $_ 2019-07-02 21:27:12 +02:00
Sergei Golubchik
e46b87aaed enable TLSv1.0 in WolfSSL 2019-07-02 14:27:31 +02:00
Sergei Golubchik
e79b9005f1 don't run tls_version test if TLSv1.1 is disabled
in /etc/ssl/openssl.cnf

as it happens to be on the buster builder
2019-07-02 14:27:31 +02:00
Sergei Golubchik
4bfb19d407 cleanup: mtr suite.pm ssl checks 2019-07-02 14:27:31 +02:00
Vladislav Vaintroub
5e4b657dd4 MDEV-18531 : Use WolfSSL instead of YaSSL as "bundled" SSL/encryption library
- Add new submodule for WolfSSL
- Build and use wolfssl and wolfcrypt instead of yassl/taocrypt
- Use HAVE_WOLFSSL instead of HAVE_YASSL
- Increase MY_AES_CTX_SIZE, to avoid compile time asserts in my_crypt.cc
(sizeof(EVP_CIPHER_CTX) is larger on WolfSSL)
2019-05-22 13:48:25 +02:00
Oleksandr Byelkin
c51f85f882 Merge branch '10.2' into 10.3 2019-05-12 17:20:23 +02:00
Oleksandr Byelkin
8cbb14ef5d Merge branch '10.1' into 10.2 2019-05-04 17:04:55 +02:00
Vladislav Vaintroub
e116f11f0a MDEV-18131 MariaDB does not verify IP addresses from subject alternative
names

Added a call to X509_check_ip_asc() in case server_hostname represents
an IP address.
2019-04-28 12:49:59 +02:00
Sergei Golubchik
3b1b665fcb Merge branch '10.2' into 10.3 2019-01-25 20:35:40 +01:00
Sergei Golubchik
74f184aff2 Fix tests not to fail with OpenSSL 1.1.1 with TLSv1.3 2019-01-25 19:57:37 +01:00
Marko Mäkelä
df563e0c03 Merge 10.2 into 10.3
main.derived_cond_pushdown: Move all 10.3 tests to the end,
trim trailing white space, and add an "End of 10.3 tests" marker.
Add --sorted_result to tests where the ordering is not deterministic.

main.win_percentile: Add --sorted_result to tests where the
ordering is no longer deterministic.
2018-11-06 09:40:39 +02:00
Marko Mäkelä
32062cc61c Merge 10.1 into 10.2 2018-11-06 08:41:48 +02:00
Sergei Golubchik
a6e0000494 Merge branch '10.0' into 10.1 2018-10-31 10:53:22 +01:00
Marko Mäkelä
6ced789186 MDEV-12023 Assertion failure sym_node->table != NULL on startup
row_drop_table_for_mysql(): Avoid accessing non-existing dictionary tables.

dict_create_or_check_foreign_constraint_tables(): Add debug instrumentation
for creating and dropping a table before the creation of any non-core
dictionary tables.

trx_purge_add_update_undo_to_history(): Adjust a debug assertion, so that
it will not fail due to the test instrumentation.
2018-10-30 13:29:19 +02:00
Marko Mäkelä
c6ba758d1d Merge 10.2 into 10.3 2018-04-23 09:49:58 +03:00
Marko Mäkelä
ea94717983 Merge 10.1 into 10.2 2018-04-21 11:58:32 +03:00
Sergei Golubchik
3e12e39fb3 skip innodb-table-online,crypt tests if no encryption plugin 2018-04-13 22:47:01 +02:00
Michael Widenius
a7abddeffa Create 'main' test directory and move 't' and 'r' there 2018-03-29 13:59:44 +03:00
Sergei Golubchik
b1818dccf7 Merge branch '10.2' into 10.3 2018-03-28 17:31:57 +02:00
Sergei Golubchik
c764bc0a78 Merge branch '10.1' into 10.2 2018-03-25 13:02:52 +02:00
Sergei Golubchik
4092f90655 MDEV-15409 make sure every sst script is tested in buildbot
galera SST tests have a debug part, but we don't want to limit them
to fulltest2 builder. So, add support for test files that
have a debug part:

* add maybe_debug.inc and maybe_debug.combinations
* 'debug' combination is run when debug is available
* 'release' combination is run otherwise
* test wraps debug parts in if($with_debug) { ... }
* and creates ,debug.rdiff for debug results
2018-03-23 00:55:20 +01:00
Marko Mäkelä
2a3fe45dd2 Remove XtraDB
The XtraDB storage engine was already replaced by InnoDB
and disabled in MariaDB Server 10.2. Let us remove it altogether
to avoid dragging dead code around.

Replace some references to XtraDB with references to InnoDB.

rpl_get_position_info(): Remove.

Remove the mysql-test-run --suite=percona, because it only contains
tests specific to XtraDB, many of which were disabled already in
earlier MariaDB versions.
2017-06-21 13:44:16 +03:00
Marko Mäkelä
14c6f00a9f Merge 10.1 into 10.2
Also, include fixes by Vladislav Vaintroub to the
aws_key_management plugin. The AWS C++ SDK specifically depends on
OPENSSL_LIBRARIES, not generic SSL_LIBRARIES (such as YaSSL).
2017-05-06 14:36:46 +03:00
Sergei Golubchik
1b27c25473 MDEV-10594 SSL hostname verification fails for SubjectAltNames
use X509_check_host for OpenSSL 1.0.2+
This adds:
* support for subjectAltNames
* wildcards
* sub-domain matching
2017-04-27 19:12:44 +02:00
Sergei Golubchik
b8dfedd747 the mysql-test combination is 'innodb' not 'xtradb' 2016-12-12 20:27:20 +01:00
Sergei Golubchik
0bae1957dd simplify the ipv6 check 2016-10-04 16:25:12 +02:00