Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f00ac20b
Commit
f00ac20b
authored
May 24, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.6 into 10.7
parents
2577ff26
571a8f4a
Changes
47
Show whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
412 additions
and
110 deletions
+412
-110
cmake/ssl.cmake
cmake/ssl.cmake
+9
-1
debian/additions/mariadb-report
debian/additions/mariadb-report
+50
-20
debian/mariadb-test-data.lintian-overrides
debian/mariadb-test-data.lintian-overrides
+22
-0
include/mysql/service_my_crypt.h
include/mysql/service_my_crypt.h
+1
-1
include/ssl_compat.h
include/ssl_compat.h
+1
-2
man/mysql.1
man/mysql.1
+1
-1
man/mysql_client_test.1
man/mysql_client_test.1
+1
-1
man/mysql_convert_table_format.1
man/mysql_convert_table_format.1
+1
-1
man/mysql_find_rows.1
man/mysql_find_rows.1
+1
-1
man/mysql_fix_extensions.1
man/mysql_fix_extensions.1
+1
-1
man/mysql_install_db.1
man/mysql_install_db.1
+1
-1
man/mysql_ldb.1
man/mysql_ldb.1
+1
-1
man/mysql_plugin.1
man/mysql_plugin.1
+1
-1
man/mysql_secure_installation.1
man/mysql_secure_installation.1
+1
-1
man/mysql_setpermission.1
man/mysql_setpermission.1
+1
-1
man/mysql_tzinfo_to_sql.1
man/mysql_tzinfo_to_sql.1
+1
-1
man/mysql_upgrade.1
man/mysql_upgrade.1
+1
-1
man/mysql_waitpid.1
man/mysql_waitpid.1
+1
-1
man/mysqlaccess.1
man/mysqlaccess.1
+1
-1
man/mysqladmin.1
man/mysqladmin.1
+1
-1
man/mysqlbinlog.1
man/mysqlbinlog.1
+1
-1
man/mysqlcheck.1
man/mysqlcheck.1
+1
-1
man/mysqld.8
man/mysqld.8
+4
-0
man/mysqld_multi.1
man/mysqld_multi.1
+1
-1
man/mysqld_safe.1
man/mysqld_safe.1
+1
-1
man/mysqld_safe_helper.1
man/mysqld_safe_helper.1
+1
-1
man/mysqldump.1
man/mysqldump.1
+1
-1
man/mysqldumpslow.1
man/mysqldumpslow.1
+1
-1
man/mysqlhotcopy.1
man/mysqlhotcopy.1
+1
-1
man/mysqlimport.1
man/mysqlimport.1
+1
-1
man/mysqlshow.1
man/mysqlshow.1
+1
-1
man/mysqlslap.1
man/mysqlslap.1
+1
-1
man/mysqltest.1
man/mysqltest.1
+1
-1
mysql-test/lib/openssl.cnf
mysql-test/lib/openssl.cnf
+1
-1
mysql-test/main/multi_update.result
mysql-test/main/multi_update.result
+90
-0
mysql-test/main/multi_update.test
mysql-test/main/multi_update.test
+31
-0
mysql-test/main/partition_exchange.result
mysql-test/main/partition_exchange.result
+13
-0
mysql-test/main/partition_exchange.test
mysql-test/main/partition_exchange.test
+19
-0
mysql-test/main/ssl_cipher.result
mysql-test/main/ssl_cipher.result
+3
-3
mysql-test/main/ssl_cipher.test
mysql-test/main/ssl_cipher.test
+1
-1
mysql-test/main/ssl_timeout.result
mysql-test/main/ssl_timeout.result
+1
-1
mysql-test/main/ssl_timeout.test
mysql-test/main/ssl_timeout.test
+1
-1
mysys_ssl/my_crypt.cc
mysys_ssl/my_crypt.cc
+29
-17
mysys_ssl/my_md5.cc
mysys_ssl/my_md5.cc
+11
-0
sql/sql_partition_admin.cc
sql/sql_partition_admin.cc
+7
-2
sql/sql_update.cc
sql/sql_update.cc
+1
-2
unittest/mysys/aes-t.c
unittest/mysys/aes-t.c
+90
-31
No files found.
cmake/ssl.cmake
View file @
f00ac20b
...
...
@@ -118,7 +118,7 @@ MACRO (MYSQL_CHECK_SSL)
ENDIF
()
FIND_PACKAGE
(
OpenSSL
)
SET_PACKAGE_PROPERTIES
(
OpenSSL PROPERTIES TYPE RECOMMENDED
)
IF
(
OPENSSL_FOUND
AND OPENSSL_VERSION AND OPENSSL_VERSION VERSION_LESS
"3.0.0"
)
IF
(
OPENSSL_FOUND
)
SET
(
OPENSSL_LIBRARY
${
OPENSSL_SSL_LIBRARY
}
)
INCLUDE
(
CheckSymbolExists
)
SET
(
SSL_SOURCES
""
)
...
...
@@ -139,6 +139,13 @@ MACRO (MYSQL_CHECK_SSL)
SET
(
SSL_INTERNAL_INCLUDE_DIRS
""
)
SET
(
SSL_DEFINES
"-DHAVE_OPENSSL"
)
# Silence "deprecated in OpenSSL 3.0"
IF
((
NOT OPENSSL_VERSION
)
# 3.0 not determined by older cmake
OR
NOT
(
OPENSSL_VERSION VERSION_LESS
"3.0.0"
))
SET
(
SSL_DEFINES
"
${
SSL_DEFINES
}
-DOPENSSL_API_COMPAT=0x10100000L"
)
SET
(
CMAKE_REQUIRED_DEFINITIONS -DOPENSSL_API_COMPAT=0x10100000L
)
ENDIF
()
SET
(
CMAKE_REQUIRED_INCLUDES
${
OPENSSL_INCLUDE_DIR
}
)
SET
(
CMAKE_REQUIRED_LIBRARIES
${
SSL_LIBRARIES
}
)
SET
(
CMAKE_REQUIRED_INCLUDES
${
OPENSSL_INCLUDE_DIR
}
)
...
...
@@ -152,6 +159,7 @@ MACRO (MYSQL_CHECK_SSL)
HAVE_X509_check_host
)
SET
(
CMAKE_REQUIRED_INCLUDES
)
SET
(
CMAKE_REQUIRED_LIBRARIES
)
SET
(
CMAKE_REQUIRED_DEFINITIONS
)
ELSE
()
IF
(
WITH_SSL STREQUAL
"system"
)
MESSAGE
(
FATAL_ERROR
"Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support"
)
...
...
debian/additions/mariadb-report
View file @
f00ac20b
...
...
@@ -241,24 +241,54 @@ sub connect_to_MySQL
{
print
"
connect_to_MySQL
\n
"
if
$op
{
debug
};
if
(
my
@driverList
=
grep
{
/mariadb|mysql/i
}
DBI
->
available_drivers
())
{
my
$dsn
;
my
$driver
=
undef
;
if
(
grep
{
/mariadb/i
}
@driverList
)
{
$driver
=
"
DBI:MariaDB
";
}
elsif
(
grep
{
/mysql/i
}
@driverList
)
{
$driver
=
"
DBI:mysql
";
}
if
(
$mycnf
{'
socket
'}
&&
-
S
$mycnf
{'
socket
'})
{
$dsn
=
"
DBI:MariaDB:mariadb_socket=
$mycnf
{socket}
";
if
(
grep
{
/mariadb/i
}
@driverList
)
{
$dsn
=
$driver
.
"
:mariadb_socket=
$mycnf
{socket}
";
}
elsif
(
grep
{
/mysql/i
}
@driverList
)
{
$dsn
=
$driver
.
"
:mysql_socket=
$mycnf
{socket}
";
}
}
elsif
(
$mycnf
{'
host
'})
{
$dsn
=
"
DBI:MariaDB
:host=
$mycnf
{host}
"
.
(
$mycnf
{
port
}
?
"
;port=
$mycnf
{port}
"
:
"");
$dsn
=
$driver
.
"
:host=
$mycnf
{host}
"
.
(
$mycnf
{
port
}
?
"
;port=
$mycnf
{port}
"
:
"");
}
else
{
$dsn
=
"
DBI:MariaDB
:host=localhost
";
$dsn
=
$driver
.
"
:host=localhost
";
}
print
"
connect_to_MySQL: DBI DSN:
$dsn
\n
"
if
$op
{
debug
};
print
"
connect_to_MySQL: DBI DSN:
"
.
$dsn
.
"
\n
"
if
$op
{
debug
};
$dbh
=
DBI
->
connect
(
$dsn
,
$mycnf
{'
user
'},
$mycnf
{'
pass
'})
or
die
;
}
else
{
print
STDERR
"
Install Perl 5.x driver: DBD:mysql or DBD:MariaDB
\n
";
print
STDERR
"
currently installed Perl DBD drivers:
\n
";
foreach
my
$driver
(
DBI
->
available_drivers
())
{
print
STDERR
"
*
"
.
$driver
.
"
\n
";
}
print
STDERR
"
\n
";
die
("
Exit as no MariaDB DBI driver found!
\n
");
}
}
sub
collect_reports
...
...
debian/mariadb-test-data.lintian-overrides
View file @
f00ac20b
# These should be moved, see https://jira.mariadb.org/browse/MDEV-21654
arch-dependent-file-in-usr-share usr/share/mysql/mysql-test/suite/plugins/pam/pam_mariadb_mtr.so
arch-independent-package-contains-binary-or-object usr/share/mysql/mysql-test/suite/plugins/pam/pam_mariadb_mtr.so
# Intentional for test files
national-encoding usr/share/mysql/mysql-test/*
# Extra test documentation files that really need to be kept in context in test directory
package-contains-documentation-outside-usr-share-doc usr/share/mysql/mysql-test/*
# Intentional directory structure
repeated-path-segment auth_gssapi usr/share/mysql/mysql-test/plugin/auth_gssapi/auth_gssapi/
repeated-path-segment connect usr/share/mysql/mysql-test/plugin/connect/connect/
repeated-path-segment disks usr/share/mysql/mysql-test/plugin/disks/disks/
repeated-path-segment func_test usr/share/mysql/mysql-test/plugin/func_test/func_test/
repeated-path-segment metadata_lock_info usr/share/mysql/mysql-test/plugin/metadata_lock_info/metadata_lock_info/
repeated-path-segment mroonga usr/share/mysql/mysql-test/plugin/mroonga/mroonga/
repeated-path-segment mroonga usr/share/mysql/mysql-test/plugin/mroonga/mroonga/include/mroonga/
repeated-path-segment oqgraph usr/share/mysql/mysql-test/plugin/oqgraph/oqgraph/
repeated-path-segment query_response_time usr/share/mysql/mysql-test/plugin/query_response_time/query_response_time/
repeated-path-segment rocksdb usr/share/mysql/mysql-test/plugin/rocksdb/rocksdb/
repeated-path-segment sequence usr/share/mysql/mysql-test/plugin/sequence/sequence/
repeated-path-segment sphinx usr/share/mysql/mysql-test/plugin/sphinx/sphinx/
repeated-path-segment spider usr/share/mysql/mysql-test/plugin/spider/spider/
repeated-path-segment type_inet usr/share/mysql/mysql-test/plugin/type_inet/type_inet/
repeated-path-segment type_test usr/share/mysql/mysql-test/plugin/type_test/type_test/
repeated-path-segment user_variables usr/share/mysql/mysql-test/plugin/user_variables/user_variables/
repeated-path-segment wsrep_info usr/share/mysql/mysql-test/plugin/wsrep_info/wsrep_info/
include/mysql/service_my_crypt.h
View file @
f00ac20b
...
...
@@ -45,7 +45,7 @@ extern "C" {
/* The max key length of all supported algorithms */
#define MY_AES_MAX_KEY_LENGTH 32
#define MY_AES_CTX_SIZE 6
56
#define MY_AES_CTX_SIZE 6
72
enum
my_aes_mode
{
MY_AES_ECB
,
MY_AES_CBC
...
...
include/ssl_compat.h
View file @
f00ac20b
...
...
@@ -24,7 +24,7 @@
#define SSL_LIBRARY OpenSSL_version(OPENSSL_VERSION)
#define ERR_remove_state(X) ERR_clear_error()
#define EVP_CIPHER_CTX_SIZE 176
#define EVP_MD_CTX_SIZE
48
#define EVP_MD_CTX_SIZE
72
#undef EVP_MD_CTX_init
#define EVP_MD_CTX_init(X) do { memset((X), 0, EVP_MD_CTX_SIZE); EVP_MD_CTX_reset(X); } while(0)
#undef EVP_CIPHER_CTX_init
...
...
@@ -77,7 +77,6 @@
#define DH_set0_pqg(D,P,Q,G) ((D)->p= (P), (D)->g= (G))
#endif
#define EVP_CIPHER_CTX_buf_noconst(ctx) ((ctx)->buf)
#define EVP_CIPHER_CTX_encrypting(ctx) ((ctx)->encrypt)
#define EVP_CIPHER_CTX_SIZE sizeof(EVP_CIPHER_CTX)
...
...
man/mysql.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB
\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_client_test.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_CLIENT_
TEST" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-CLIENT-
TEST" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_convert_table_format.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_CONVERT_
TAB" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-CONVERT-
TAB" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_find_rows.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_FIND_
ROWS\F" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-FIND-
ROWS\F" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_fix_extensions.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_FIX_
EXTENSI" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-FIX-
EXTENSI" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_install_db.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_INSTALL_
DB\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-INSTALL-
DB\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_ldb.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_
LDB\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
LDB\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_plugin.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_
PLUGIN\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
PLUGIN\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
...
...
man/mysql_secure_installation.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_SECURE_
INST" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-SECURE-
INST" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_setpermission.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_
SETPERMISSI" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
SETPERMISSI" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_tzinfo_to_sql.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_TZINFO_TO_S" "1" "15 May 2020
" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-TZINFO-TO-S" "1" "22 April 2022
" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_upgrade.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_
UPGRADE\FR" "1" "20 July 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
UPGRADE\FR" "1" "20 July 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysql_waitpid.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL_
WAITPID\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
WAITPID\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqlaccess.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
ACCESS\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
ACCESS\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqladmin.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
ADMIN\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
ADMIN\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqlbinlog.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
BINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
BINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqlcheck.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
CHECK\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
CHECK\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqld.8
View file @
f00ac20b
'\" t
.\"
<<<<<<< HEAD
.TH "\FBMYSQLD\FR" "8" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
=======
.TH "\FBMARIADBD\FR" "8" "27 June 2019" "MariaDB 10\&.5" "MariaDB Database System"
>>>>>>> 10.5-MDEV-28376-mariadb-report
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqld_multi.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQLD_
MULTI\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
MULTI\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqld_safe.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQLD_
SAFE\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
SAFE\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqld_safe_helper.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQLD_SAFE_
HELPER\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-SAFE-
HELPER\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqldump.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
DUMP\FR" "1" "24 October 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
DUMP\FR" "1" "24 October 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqldumpslow.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
DUMPSLOW\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
DUMPSLOW\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqlhotcopy.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
HOTCOPY\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
HOTCOPY\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqlimport.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
IMPORT\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
IMPORT\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqlshow.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
SHOW\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
SHOW\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqlslap.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
SLAP\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
SLAP\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
man/mysqltest.1
View file @
f00ac20b
'\" t
.\"
.TH "\FBM
YSQL
TEST\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBM
ARIADB-
TEST\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
...
...
mysql-test/lib/openssl.cnf
View file @
f00ac20b
...
...
@@ -9,4 +9,4 @@ ssl_conf = ssl_section
system_default = system_default_section
[system_default_section]
CipherString = ALL:@SECLEVEL=
1
CipherString = ALL:@SECLEVEL=
0
mysql-test/main/multi_update.result
View file @
f00ac20b
...
...
@@ -1161,3 +1161,93 @@ ERROR 21000: Subquery returns more than 1 row
update t1 set a= (select 2 from t1 having (a = 3));
ERROR 21000: Subquery returns more than 1 row
drop tables t1;
#
# MDEV-28246 Optimizer uses all partitions during an update in MariaDB 10.6.x but not in 10.2.x
#
CREATE TABLE t1 (
part INT(1),
a INT(1),
b INT(1),
PRIMARY KEY (a,part),
INDEX b (b,part)
) PARTITION BY LIST (part) (
PARTITION Current VALUES IN (0),
PARTITION Relevant VALUES IN (1),
PARTITION Archive VALUES IN (2)
);
CREATE TABLE t2 LIKE t1;
INSERT INTO t1 (part,a,b) VALUES (0,0,0),(1,1,1),(2,2,2);
INSERT INTO t2 (part,a,b) VALUES (0,0,0),(1,1,1),(2,2,2);
# Expecting partition "Current"
EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=0 AND t1.part=0;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"partitions": ["Current"],
"access_type": "system",
"possible_keys": ["PRIMARY"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "t1",
"partitions": ["Current"],
"access_type": "system",
"possible_keys": ["PRIMARY"],
"rows": 1,
"filtered": 100
}
}
}
# Expecting partition "Relevant"
EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=2 WHERE t2.part=1 AND t1.part=1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"partitions": ["Relevant"],
"access_type": "system",
"possible_keys": ["PRIMARY"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "t1",
"partitions": ["Relevant"],
"access_type": "system",
"possible_keys": ["PRIMARY"],
"rows": 1,
"filtered": 100
}
}
}
# Expecting partition "Archive"
EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=2 AND t1.part=2;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"partitions": ["Archive"],
"access_type": "system",
"possible_keys": ["PRIMARY"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "t1",
"partitions": ["Archive"],
"access_type": "system",
"possible_keys": ["PRIMARY"],
"rows": 1,
"filtered": 100
}
}
}
DROP TABLES t1, t2;
mysql-test/main/multi_update.test
View file @
f00ac20b
...
...
@@ -1098,3 +1098,34 @@ select a from t1 where a= (select 2 from t1 having (a = 3));
--
error
ER_SUBQUERY_NO_1_ROW
update
t1
set
a
=
(
select
2
from
t1
having
(
a
=
3
));
drop
tables
t1
;
--
echo
#
--
echo
# MDEV-28246 Optimizer uses all partitions during an update in MariaDB 10.6.x but not in 10.2.x
--
echo
#
--
source
include
/
have_partition
.
inc
CREATE
TABLE
t1
(
part
INT
(
1
),
a
INT
(
1
),
b
INT
(
1
),
PRIMARY
KEY
(
a
,
part
),
INDEX
b
(
b
,
part
)
)
PARTITION
BY
LIST
(
part
)
(
PARTITION
Current
VALUES
IN
(
0
),
PARTITION
Relevant
VALUES
IN
(
1
),
PARTITION
Archive
VALUES
IN
(
2
)
);
CREATE
TABLE
t2
LIKE
t1
;
INSERT
INTO
t1
(
part
,
a
,
b
)
VALUES
(
0
,
0
,
0
),(
1
,
1
,
1
),(
2
,
2
,
2
);
INSERT
INTO
t2
(
part
,
a
,
b
)
VALUES
(
0
,
0
,
0
),(
1
,
1
,
1
),(
2
,
2
,
2
);
--
echo
# Expecting partition "Current"
EXPLAIN
FORMAT
=
JSON
UPDATE
t2
JOIN
t1
USING
(
a
)
SET
t2
.
part
=
3
WHERE
t2
.
part
=
0
AND
t1
.
part
=
0
;
--
echo
# Expecting partition "Relevant"
EXPLAIN
FORMAT
=
JSON
UPDATE
t2
JOIN
t1
USING
(
a
)
SET
t2
.
part
=
2
WHERE
t2
.
part
=
1
AND
t1
.
part
=
1
;
--
echo
# Expecting partition "Archive"
EXPLAIN
FORMAT
=
JSON
UPDATE
t2
JOIN
t1
USING
(
a
)
SET
t2
.
part
=
3
WHERE
t2
.
part
=
2
AND
t1
.
part
=
2
;
DROP
TABLES
t1
,
t2
;
mysql-test/main/partition_exchange.result
View file @
f00ac20b
...
...
@@ -1307,3 +1307,16 @@ CREATE TABLE t2 like t1;
ALTER TABLE t2 REMOVE PARTITIONING;
ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
DROP TABLE t1, t2;
#
# MDEV-14642 Assertion `table->s->db_create_options == part_table->s->db_create_options' failed in compare_table_with_partition
#
CREATE TABLE t1 (a INT) ROW_FORMAT=DYNAMIC PARTITION BY KEY(a) PARTITIONS 2;
CREATE TABLE t2 (a INT) ;
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2;
ERROR HY000: Tables have different definitions
DROP TABLE t1, t2;
CREATE TABLE t1 (a INT, PRIMARY KEY(a)) ENGINE=InnoDB PARTITION BY KEY(a) PARTITIONS 2;
CREATE TABLE t2 (a INT, PRIMARY KEY(a)) CHECKSUM=1, ENGINE=InnoDB;
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Tables have different definitions
DROP TABLE t1, t2;
mysql-test/main/partition_exchange.test
View file @
f00ac20b
...
...
@@ -537,4 +537,23 @@ ALTER TABLE t2 REMOVE PARTITIONING;
ALTER
TABLE
t1
EXCHANGE
PARTITION
pm
WITH
TABLE
t2
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# MDEV-14642 Assertion `table->s->db_create_options == part_table->s->db_create_options' failed in compare_table_with_partition
--
echo
#
CREATE
TABLE
t1
(
a
INT
)
ROW_FORMAT
=
DYNAMIC
PARTITION
BY
KEY
(
a
)
PARTITIONS
2
;
CREATE
TABLE
t2
(
a
INT
)
;
--
error
ER_TABLES_DIFFERENT_METADATA
ALTER
TABLE
t1
EXCHANGE
PARTITION
p1
WITH
TABLE
t2
;
# Cleanup
DROP
TABLE
t1
,
t2
;
CREATE
TABLE
t1
(
a
INT
,
PRIMARY
KEY
(
a
))
ENGINE
=
InnoDB
PARTITION
BY
KEY
(
a
)
PARTITIONS
2
;
CREATE
TABLE
t2
(
a
INT
,
PRIMARY
KEY
(
a
))
CHECKSUM
=
1
,
ENGINE
=
InnoDB
;
--
error
ER_TABLES_DIFFERENT_METADATA
ALTER
TABLE
t1
EXCHANGE
PARTITION
p0
WITH
TABLE
t2
;
# Cleanup
DROP
TABLE
t1
,
t2
;
--
disable_prepare_warnings
mysql-test/main/ssl_cipher.result
View file @
f00ac20b
...
...
@@ -61,8 +61,8 @@ connect ssl_con,localhost,root,,,,,SSL;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher AES128-SHA
S
HOW STATUS LIKE
'Ssl_cipher_list';
V
ariable_name Value
Ssl_cipher_list AES128-SHA
S
ELECT VARIABLE_VALUE like '%AES128-SHA%' FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME=
'Ssl_cipher_list';
V
ARIABLE_VALUE like '%AES128-SHA%'
1
disconnect ssl_con;
connection default;
mysql-test/main/ssl_cipher.test
View file @
f00ac20b
...
...
@@ -98,6 +98,6 @@ let $restart_parameters=--ssl-cipher=AES128-SHA;
source
include
/
restart_mysqld
.
inc
;
connect
(
ssl_con
,
localhost
,
root
,,,,,
SSL
);
SHOW
STATUS
LIKE
'Ssl_cipher'
;
S
HOW
STATUS
LIKE
'Ssl_cipher_list'
;
S
ELECT
VARIABLE_VALUE
like
'%AES128-SHA%'
FROM
INFORMATION_SCHEMA
.
SESSION_STATUS
WHERE
VARIABLE_NAME
=
'Ssl_cipher_list'
;
disconnect
ssl_con
;
connection
default
;
mysql-test/main/ssl_timeout.result
View file @
f00ac20b
...
...
@@ -5,6 +5,6 @@ SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS
have_ssl
1
SELECT SLEEP(600);
ERROR HY000: Lost connection to server during query
Got one of the listed errors
connection default;
disconnect ssl_con;
mysql-test/main/ssl_timeout.test
View file @
f00ac20b
...
...
@@ -10,7 +10,7 @@ connect (ssl_con,localhost,root,,,,,SSL read_timeout=5);
SELECT
(
VARIABLE_VALUE
<>
''
)
AS
have_ssl
FROM
INFORMATION_SCHEMA
.
SESSION_STATUS
WHERE
VARIABLE_NAME
=
'Ssl_cipher'
;
# --error CR_SERVER_LOST
--
error
2013
--
error
2013
,
2026
SELECT
SLEEP
(
600
);
connection
default
;
...
...
mysys_ssl/my_crypt.cc
View file @
f00ac20b
...
...
@@ -29,11 +29,7 @@
#include <ssl_compat.h>
#include <cstdint>
#ifdef HAVE_WOLFSSL
#define CTX_ALIGN 16
#else
#define CTX_ALIGN 0
#endif
class
MyCTX
{
...
...
@@ -100,8 +96,9 @@ class MyCTX_nopad : public MyCTX
{
public:
const
uchar
*
key
;
uint
klen
,
buf
_len
;
uint
klen
,
source_tail
_len
;
uchar
oiv
[
MY_AES_BLOCK_SIZE
];
uchar
source_tail
[
MY_AES_BLOCK_SIZE
];
MyCTX_nopad
()
:
MyCTX
()
{
}
~
MyCTX_nopad
()
{
}
...
...
@@ -112,7 +109,7 @@ class MyCTX_nopad : public MyCTX
compile_time_assert
(
MY_AES_CTX_SIZE
>=
sizeof
(
MyCTX_nopad
));
this
->
key
=
key
;
this
->
klen
=
klen
;
this
->
buf
_len
=
0
;
this
->
source_tail
_len
=
0
;
if
(
ivlen
)
memcpy
(
oiv
,
iv
,
ivlen
);
DBUG_ASSERT
(
ivlen
==
0
||
ivlen
==
sizeof
(
oiv
));
...
...
@@ -123,26 +120,41 @@ class MyCTX_nopad : public MyCTX
return
res
;
}
/** Update last partial source block, stored in source_tail array. */
void
update_source_tail
(
const
uchar
*
src
,
uint
slen
)
{
if
(
!
slen
)
return
;
uint
new_tail_len
=
(
source_tail_len
+
slen
)
%
MY_AES_BLOCK_SIZE
;
if
(
new_tail_len
)
{
if
(
slen
+
source_tail_len
<
MY_AES_BLOCK_SIZE
)
{
memcpy
(
source_tail
+
source_tail_len
,
src
,
slen
);
}
else
{
DBUG_ASSERT
(
slen
>
new_tail_len
);
memcpy
(
source_tail
,
src
+
slen
-
new_tail_len
,
new_tail_len
);
}
}
source_tail_len
=
new_tail_len
;
}
int
update
(
const
uchar
*
src
,
uint
slen
,
uchar
*
dst
,
uint
*
dlen
)
{
buf_len
+=
slen
;
update_source_tail
(
src
,
slen
)
;
return
MyCTX
::
update
(
src
,
slen
,
dst
,
dlen
);
}
int
finish
(
uchar
*
dst
,
uint
*
dlen
)
{
buf_len
%=
MY_AES_BLOCK_SIZE
;
if
(
buf_len
)
if
(
source_tail_len
)
{
uchar
*
buf
=
EVP_CIPHER_CTX_buf_noconst
(
ctx
);
/*
Not much we can do, block ciphers cannot encrypt data that aren't
a multiple of the block length. At least not without padding.
Let's do something CTR-like for the last partial block.
NOTE this assumes that there are only buf_len bytes in the buf.
If OpenSSL will change that, we'll need to change the implementation
of this class too.
*/
uchar
mask
[
MY_AES_BLOCK_SIZE
];
uint
mlen
;
...
...
@@ -154,10 +166,10 @@ class MyCTX_nopad : public MyCTX
return
rc
;
DBUG_ASSERT
(
mlen
==
sizeof
(
mask
));
for
(
uint
i
=
0
;
i
<
buf
_len
;
i
++
)
dst
[
i
]
=
buf
[
i
]
^
mask
[
i
];
for
(
uint
i
=
0
;
i
<
source_tail
_len
;
i
++
)
dst
[
i
]
=
source_tail
[
i
]
^
mask
[
i
];
}
*
dlen
=
buf
_len
;
*
dlen
=
source_tail
_len
;
return
MY_AES_OK
;
}
};
...
...
mysys_ssl/my_md5.cc
View file @
f00ac20b
...
...
@@ -52,12 +52,23 @@ static void md5_result(EVP_MD_CTX *context, uchar digest[MD5_HASH_SIZE])
static
void
md5_init
(
EVP_MD_CTX
*
context
)
{
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
EVP_MD
*
md5
;
EVP_MD_CTX_init
(
context
);
/* Ok to ignore FIPS: MD5 is not used for crypto here */
/* In OpenSSL 3.0.0+ it is a different EVP_MD provider */
md5
=
EVP_MD_fetch
(
NULL
,
"MD5"
,
"fips=no"
);
EVP_DigestInit_ex
(
context
,
md5
,
NULL
);
EVP_MD_free
(
md5
);
#else
EVP_MD_CTX_init
(
context
);
#ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW
/* Ok to ignore FIPS: MD5 is not used for crypto here */
/* In OpenSSL 1.1.1 the non FIPS allowed flag is context specific */
EVP_MD_CTX_set_flags
(
context
,
EVP_MD_CTX_FLAG_NON_FIPS_ALLOW
);
#endif
EVP_DigestInit_ex
(
context
,
EVP_md5
(),
NULL
);
#endif
}
static
void
md5_input
(
EVP_MD_CTX
*
context
,
const
uchar
*
buf
,
unsigned
len
)
...
...
sql/sql_partition_admin.cc
View file @
f00ac20b
...
...
@@ -258,8 +258,13 @@ bool compare_table_with_partition(THD *thd, TABLE *table, TABLE *part_table,
my_error
(
ER_TABLES_DIFFERENT_METADATA
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
DBUG_ASSERT
(
table
->
s
->
db_create_options
==
part_table
->
s
->
db_create_options
);
if
(
table
->
s
->
db_create_options
!=
part_table
->
s
->
db_create_options
)
{
my_error
(
ER_TABLES_DIFFERENT_METADATA
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
DBUG_ASSERT
(
table
->
s
->
db_options_in_use
==
part_table
->
s
->
db_options_in_use
);
...
...
sql/sql_update.cc
View file @
f00ac20b
...
...
@@ -2123,10 +2123,9 @@ int multi_update::prepare(List<Item> ¬_used_values,
if
(
!
tl
)
DBUG_RETURN
(
1
);
update
.
link_in_list
(
tl
,
&
tl
->
next_local
);
tl
->
shared
=
table_count
++
;
t
able_ref
->
shared
=
t
l
->
shared
=
table_count
++
;
table
->
no_keyread
=
1
;
table
->
covering_keys
.
clear_all
();
table
->
pos_in_table_list
=
tl
;
table
->
prepare_triggers_for_update_stmt_or_event
();
table
->
reset_default_fields
();
}
...
...
unittest/mysys/aes-t.c
View file @
f00ac20b
...
...
@@ -21,27 +21,96 @@
#include <string.h>
#include <ctype.h>
#define DO_TEST(mode, nopad, slen, fill, dlen, hash) \
SKIP_BLOCK_IF(mode == 0xDEADBEAF, nopad ? 4 : 5, #mode " not supported") \
{ \
memset(src, fill, src_len= slen); \
ok(my_aes_crypt(mode, nopad | ENCRYPTION_FLAG_ENCRYPT, \
src, src_len, dst, &dst_len, \
key, sizeof(key), iv, sizeof(iv)) == MY_AES_OK, \
"encrypt " #mode " %u %s", src_len, nopad ? "nopad" : "pad"); \
if (!nopad) \
ok (dst_len == my_aes_get_size(mode, src_len), "my_aes_get_size");\
my_md5(md5, (char*)dst, dst_len); \
ok(dst_len == dlen && memcmp(md5, hash, sizeof(md5)) == 0, "md5"); \
ok(my_aes_crypt(mode, nopad | ENCRYPTION_FLAG_DECRYPT, \
dst, dst_len, ddst, &ddst_len, \
key, sizeof(key), iv, sizeof(iv)) == MY_AES_OK, \
"decrypt " #mode " %u", dst_len); \
ok(ddst_len == src_len && memcmp(src, ddst, src_len) == 0, "memcmp"); \
/** Test streaming encryption, bytewise update.*/
static
int
aes_crypt_bytewise
(
enum
my_aes_mode
mode
,
int
flags
,
const
unsigned
char
*
src
,
unsigned
int
slen
,
unsigned
char
*
dst
,
unsigned
int
*
dlen
,
const
unsigned
char
*
key
,
unsigned
int
klen
,
const
unsigned
char
*
iv
,
unsigned
int
ivlen
)
{
/* Allocate context on odd address on stack, in order to
catch misalignment errors.*/
void
*
ctx
=
(
char
*
)
alloca
(
MY_AES_CTX_SIZE
+
1
)
+
1
;
int
res1
,
res2
;
uint
d1
=
0
,
d2
;
uint
i
;
if
((
res1
=
my_aes_crypt_init
(
ctx
,
mode
,
flags
,
key
,
klen
,
iv
,
ivlen
)))
return
res1
;
for
(
i
=
0
;
i
<
slen
;
i
++
)
{
uint
tmp_d1
=
0
;
res1
=
my_aes_crypt_update
(
ctx
,
src
+
i
,
1
,
dst
,
&
tmp_d1
);
if
(
res1
)
return
res1
;
d1
+=
tmp_d1
;
dst
+=
tmp_d1
;
}
res2
=
my_aes_crypt_finish
(
ctx
,
dst
,
&
d2
);
*
dlen
=
d1
+
d2
;
return
res1
?
res1
:
res2
;
}
#ifndef HAVE_EncryptAes128Ctr
const
uint
MY_AES_CTR
=
0xDEADBEAF
;
#endif
#ifndef HAVE_EncryptAes128Gcm
const
uint
MY_AES_GCM
=
0xDEADBEAF
;
#endif
#define MY_AES_UNSUPPORTED(x) (x == 0xDEADBEAF)
static
void
do_test
(
uint
mode
,
const
char
*
mode_str
,
int
nopad
,
uint
slen
,
char
fill
,
size_t
dlen
,
const
char
*
hash
)
{
uchar
key
[
16
]
=
{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
1
,
2
,
3
,
4
,
5
,
6
};
uchar
iv
[
16
]
=
{
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
};
uchar
src
[
1000
],
dst
[
1100
],
dst2
[
1100
],
ddst
[
1000
];
uchar
md5
[
MY_MD5_HASH_SIZE
];
uint
src_len
,
dst_len
,
dst_len2
,
ddst_len
;
int
result
;
if
(
MY_AES_UNSUPPORTED
(
mode
))
{
skip
(
nopad
?
7
:
6
,
"%s not supported"
,
mode_str
);
return
;
}
memset
(
src
,
fill
,
src_len
=
slen
);
result
=
my_aes_crypt
(
mode
,
nopad
|
ENCRYPTION_FLAG_ENCRYPT
,
src
,
src_len
,
dst
,
&
dst_len
,
key
,
sizeof
(
key
),
iv
,
sizeof
(
iv
));
ok
(
result
==
MY_AES_OK
,
"encrypt %s %u %s"
,
mode_str
,
src_len
,
nopad
?
"nopad"
:
"pad"
);
if
(
nopad
)
{
result
=
aes_crypt_bytewise
(
mode
,
nopad
|
ENCRYPTION_FLAG_ENCRYPT
,
src
,
src_len
,
dst2
,
&
dst_len2
,
key
,
sizeof
(
key
),
iv
,
sizeof
(
iv
));
ok
(
result
==
MY_AES_OK
,
"encrypt bytewise %s %u"
,
mode_str
,
src_len
);
/* Compare with non-bytewise encryption result*/
ok
(
dst_len
==
dst_len2
&&
memcmp
(
dst
,
dst2
,
dst_len
)
==
0
,
"memcmp bytewise %s %u"
,
mode_str
,
src_len
);
}
else
{
int
dst_len_real
=
my_aes_get_size
(
mode
,
src_len
);
ok
(
dst_len_real
=
dst_len
,
"my_aes_get_size"
);
}
my_md5
(
md5
,
(
char
*
)
dst
,
dst_len
);
ok
(
dst_len
==
dlen
,
"md5 len"
);
ok
(
memcmp
(
md5
,
hash
,
sizeof
(
md5
))
==
0
,
"md5"
);
result
=
my_aes_crypt
(
mode
,
nopad
|
ENCRYPTION_FLAG_DECRYPT
,
dst
,
dst_len
,
ddst
,
&
ddst_len
,
key
,
sizeof
(
key
),
iv
,
sizeof
(
iv
));
ok
(
result
==
MY_AES_OK
,
"decrypt %s %u"
,
mode_str
,
dst_len
);
ok
(
ddst_len
==
src_len
&&
memcmp
(
src
,
ddst
,
src_len
)
==
0
,
"memcmp"
);
}
#define DO_TEST_P(M,
S,F,D,H) DO_TEST(M,0,S,F,D,
H)
#define DO_TEST_N(M,
S,F,D,H) DO_TEST(M,ENCRYPTION_FLAG_NOPAD,S,F,D,
H)
#define DO_TEST_P(M,
S, F, D, H) do_test(M, #M, 0, S, F, D,
H)
#define DO_TEST_N(M,
S, F, D, H) do_test(M, #M, ENCRYPTION_FLAG_NOPAD, S, F, D,
H)
/* useful macro for debugging */
#define PRINT_MD5() \
...
...
@@ -53,25 +122,15 @@
printf("\"\n"); \
} while(0);
#ifndef HAVE_EncryptAes128Ctr
const
uint
MY_AES_CTR
=
0xDEADBEAF
;
#endif
#ifndef HAVE_EncryptAes128Gcm
const
uint
MY_AES_GCM
=
0xDEADBEAF
;
#endif
int
main
(
int
argc
__attribute__
((
unused
)),
char
*
argv
[])
{
uchar
key
[
16
]
=
{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
1
,
2
,
3
,
4
,
5
,
6
};
uchar
iv
[
16
]
=
{
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
};
uchar
src
[
1000
],
dst
[
1100
],
ddst
[
1000
];
uchar
md5
[
MY_MD5_HASH_SIZE
];
uint
src_len
,
dst_len
,
ddst_len
;
MY_INIT
(
argv
[
0
]);
plan
(
87
);
plan
(
122
);
DO_TEST_P
(
MY_AES_ECB
,
200
,
'.'
,
208
,
"
\xd8\x73\x8e\x3a\xbc\x66\x99\x13\x7f\x90\x23\x52\xee\x97\x6f\x9a
"
);
DO_TEST_P
(
MY_AES_ECB
,
128
,
'?'
,
144
,
"
\x19\x58\x33\x85\x4c\xaa\x7f\x06\xd1\xb2\xec\xd7\xb7\x6a\xa9\x5b
"
);
DO_TEST_P
(
MY_AES_CBC
,
159
,
'%'
,
160
,
"
\x4b\x03\x18\x3d\xf1\xa7\xcd\xa1\x46\xb3\xc6\x8a\x92\xc0\x0f\xc9
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment