diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-01 18:15:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-01 18:15:00 +0000 |
commit | a2a2e32c02643a0cec111511220227703fda1cd5 (patch) | |
tree | 69cc2b631234c2a8e026b9cd4d72676c61c594df /libmariadb/include | |
parent | Releasing progress-linux version 1:10.11.8-1~progress7.99u1. (diff) | |
download | mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.tar.xz mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.zip |
Merging upstream version 1:11.4.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libmariadb/include')
-rw-r--r-- | libmariadb/include/errmsg.h | 3 | ||||
-rw-r--r-- | libmariadb/include/ma_common.h | 16 | ||||
-rw-r--r-- | libmariadb/include/ma_config.h.in | 1 | ||||
-rw-r--r-- | libmariadb/include/ma_crypt.h | 24 | ||||
-rw-r--r-- | libmariadb/include/ma_tls.h | 7 | ||||
-rw-r--r-- | libmariadb/include/mariadb_com.h | 10 | ||||
-rw-r--r-- | libmariadb/include/mariadb_rpl.h | 5 | ||||
-rw-r--r-- | libmariadb/include/mariadb_stmt.h | 8 | ||||
-rw-r--r-- | libmariadb/include/mysql.h | 30 | ||||
-rw-r--r-- | libmariadb/include/mysql/client_plugin.h | 3 |
10 files changed, 73 insertions, 34 deletions
diff --git a/libmariadb/include/errmsg.h b/libmariadb/include/errmsg.h index f22db164..0e6d24e0 100644 --- a/libmariadb/include/errmsg.h +++ b/libmariadb/include/errmsg.h @@ -115,10 +115,11 @@ extern const char *mariadb_client_errors[]; /* Error messages */ #define CR_BINLOG_INVALID_FILE 5022 #define CR_BINLOG_SEMI_SYNC_ERROR 5023 #define CR_INVALID_CLIENT_FLAG 5024 +#define CR_STMT_NO_RESULT 5025 /* Always last, if you add new error codes please update the value for CR_MARIADB_LAST_ERROR */ -#define CR_MARIADB_LAST_ERROR CR_INVALID_CLIENT_FLAG +#define CR_MARIADB_LAST_ERROR CR_STMT_NO_RESULT #endif diff --git a/libmariadb/include/ma_common.h b/libmariadb/include/ma_common.h index 1ac0cb68..dfa96621 100644 --- a/libmariadb/include/ma_common.h +++ b/libmariadb/include/ma_common.h @@ -73,6 +73,7 @@ struct st_mysql_options_extension { unsigned int tls_cipher_strength; char *tls_version; my_bool read_only; + my_bool bulk_unit_results; char *connection_handler; my_bool (*set_option)(MYSQL *mysql, const char *config_option, const char *config_value); MA_HASHTBL userdata; @@ -86,7 +87,7 @@ struct st_mysql_options_extension { unsigned short rpl_port; void (*status_callback)(void *ptr, enum enum_mariadb_status_info type, ...); void *status_data; - my_bool tls_verify_server_cert; + my_bool tls_allow_invalid_server_cert; }; typedef struct st_connection_handler @@ -129,3 +130,16 @@ typedef struct st_mariadb_field_extension { MARIADB_CONST_STRING metadata[MARIADB_FIELD_ATTR_LAST+1]; /* 10.5 */ } MA_FIELD_EXTENSION; + +#if defined(HAVE_SCHANNEL) || defined(HAVE_GNUTLS) +#define reset_tls_self_signed_error(mysql) \ + do { \ + free((char*)mysql->net.tls_self_signed_error); \ + mysql->net.tls_self_signed_error= 0; \ + } while(0) +#else +#define reset_tls_self_signed_error(mysql) \ + do { \ + mysql->net.tls_self_signed_error= 0; \ + } while(0) +#endif diff --git a/libmariadb/include/ma_config.h.in b/libmariadb/include/ma_config.h.in index c5c758dc..4cabfef3 100644 --- a/libmariadb/include/ma_config.h.in +++ b/libmariadb/include/ma_config.h.in @@ -148,3 +148,4 @@ #define MARIADB_DEFAULT_CHARSET "@DEFAULT_CHARSET@" +#cmakedefine DEFAULT_SSL_VERIFY_SERVER_CERT 1 diff --git a/libmariadb/include/ma_crypt.h b/libmariadb/include/ma_crypt.h index 367488fa..b4d2a09f 100644 --- a/libmariadb/include/ma_crypt.h +++ b/libmariadb/include/ma_crypt.h @@ -17,34 +17,20 @@ 51 Franklin St., Fifth Floor, Boston, MA 02110, USA */ -#ifndef _ma_hash_h_ -#define _ma_hash_h_ +#ifndef _ma_crypt_h_ +#define _ma_crypt_h_ +#include <ma_hash.h> #include <stddef.h> #include <stdarg.h> /*! Hash algorithms */ -#define MA_HASH_MD5 1 -#define MA_HASH_SHA1 2 -#define MA_HASH_SHA224 3 -#define MA_HASH_SHA256 4 -#define MA_HASH_SHA384 5 -#define MA_HASH_SHA512 6 #define MA_HASH_RIPEMD160 7 #define MA_HASH_MAX 8 /*! Hash digest sizes */ -#define MA_MD5_HASH_SIZE 16 -#define MA_SHA1_HASH_SIZE 20 -#define MA_SHA224_HASH_SIZE 28 -#define MA_SHA256_HASH_SIZE 32 -#define MA_SHA384_HASH_SIZE 48 -#define MA_SHA512_HASH_SIZE 64 #define MA_RIPEMD160_HASH_SIZE 20 -#define MA_MAX_HASH_SIZE 64 -/** \typedef MRL hash context */ - #if defined(HAVE_WINCRYPT) typedef void MA_HASH_CTX; #elif defined(HAVE_OPENSSL) @@ -123,8 +109,6 @@ static inline size_t ma_hash_digest_size(unsigned int hash_alg) return MA_SHA384_HASH_SIZE; case MA_HASH_SHA512: return MA_SHA512_HASH_SIZE; - case MA_HASH_RIPEMD160: - return MA_RIPEMD160_HASH_SIZE; default: return 0; } @@ -152,4 +136,4 @@ static inline void ma_hash(unsigned int algorithm, ma_hash_free(ctx); } -#endif /* _ma_hash_h_ */ +#endif /* _ma_crypt_h_ */ diff --git a/libmariadb/include/ma_tls.h b/libmariadb/include/ma_tls.h index ec8bc239..6601f896 100644 --- a/libmariadb/include/ma_tls.h +++ b/libmariadb/include/ma_tls.h @@ -1,6 +1,8 @@ #ifndef _ma_tls_h_ #define _ma_tls_h_ +#include <ma_hash.h> + enum enum_pvio_tls_type { SSL_TYPE_DEFAULT=0, #ifdef _WIN32 @@ -25,6 +27,7 @@ typedef struct st_ma_pvio_tls { void *data; MARIADB_PVIO *pvio; void *ssl; + MARIADB_X509_INFO cert_info; } MARIADB_TLS; /* Function prototypes */ @@ -128,12 +131,14 @@ const char *ma_tls_get_cipher(MARIADB_TLS *ssl); returns SHA1 finger print of server certificate Parameter: MARIADB_TLS MariaDB SSL container + hash_type hash_type as defined in ma_hash.h fp buffer for fingerprint fp_len buffer length + Returns: actual size of finger print */ -unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, char *fp, unsigned int fp_len); +unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, uint hash_type, char *fp, unsigned int fp_len); /* ma_tls_get_protocol_version returns protocol version number in use diff --git a/libmariadb/include/mariadb_com.h b/libmariadb/include/mariadb_com.h index 01a13dab..6e7164a3 100644 --- a/libmariadb/include/mariadb_com.h +++ b/libmariadb/include/mariadb_com.h @@ -177,6 +177,8 @@ enum enum_server_command #define MARIADB_CLIENT_EXTENDED_METADATA (1ULL << 35) /* Do not resend metadata for prepared statements, since 10.6*/ #define MARIADB_CLIENT_CACHE_METADATA (1ULL << 36) +/* permit sending unit result-set for BULK commands */ +#define MARIADB_CLIENT_BULK_UNIT_RESULTS (1ULL << 37) #define IS_MARIADB_EXTENDED_SERVER(mysql)\ (!(mysql->server_capabilities & CLIENT_MYSQL)) @@ -184,7 +186,8 @@ enum enum_server_command #define MARIADB_CLIENT_SUPPORTED_FLAGS (MARIADB_CLIENT_PROGRESS |\ MARIADB_CLIENT_STMT_BULK_OPERATIONS|\ MARIADB_CLIENT_EXTENDED_METADATA|\ - MARIADB_CLIENT_CACHE_METADATA) + MARIADB_CLIENT_CACHE_METADATA|\ + MARIADB_CLIENT_BULK_UNIT_RESULTS) #define CLIENT_SUPPORTED_FLAGS (CLIENT_MYSQL |\ CLIENT_FOUND_ROWS |\ @@ -231,6 +234,9 @@ enum enum_server_command #define CLIENT_DEFAULT_FLAGS ((CLIENT_SUPPORTED_FLAGS & ~CLIENT_COMPRESS)\ & ~CLIENT_SSL) +#define CLIENT_DEFAULT_EXTENDED_FLAGS (MARIADB_CLIENT_SUPPORTED_FLAGS &\ + ~MARIADB_CLIENT_BULK_UNIT_RESULTS) + #define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ #define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ #define SERVER_MORE_RESULTS_EXIST 8 @@ -294,7 +300,7 @@ typedef struct st_net { my_bool unused_2; my_bool compress; my_bool unused_3; - void *unused_4; + const char *tls_self_signed_error; unsigned int last_errno; unsigned char error; my_bool unused_5; diff --git a/libmariadb/include/mariadb_rpl.h b/libmariadb/include/mariadb_rpl.h index ea0ca4db..f12fdfa1 100644 --- a/libmariadb/include/mariadb_rpl.h +++ b/libmariadb/include/mariadb_rpl.h @@ -501,10 +501,7 @@ struct st_mariadb_rpl_rows_event { }; struct st_mariadb_rpl_heartbeat_event { - uint32_t timestamp; - uint32_t next_position; - uint8_t type; - uint16_t flags; + MARIADB_STRING filename; }; struct st_mariadb_rpl_xa_prepare_log_event { diff --git a/libmariadb/include/mariadb_stmt.h b/libmariadb/include/mariadb_stmt.h index 531c2181..87ad4fa5 100644 --- a/libmariadb/include/mariadb_stmt.h +++ b/libmariadb/include/mariadb_stmt.h @@ -34,6 +34,12 @@ ((stmt)->mysql->extension->mariadb_server_capabilities & \ (MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32)))) +#define MARIADB_STMT_BULK_UNIT_RESULTS_SUPPORTED(stmt)\ + ((stmt)->mysql && \ + (!((stmt)->mysql->server_capabilities & CLIENT_MYSQL) &&\ + ((stmt)->mysql->extension->mariadb_client_flag & \ + (MARIADB_CLIENT_BULK_UNIT_RESULTS >> 32)))) + #define CLEAR_CLIENT_STMT_ERROR(a) \ do { \ (a)->last_errno= 0;\ @@ -88,7 +94,7 @@ enum enum_indicator_type bulk PS flags */ #define STMT_BULK_FLAG_CLIENT_SEND_TYPES 128 -#define STMT_BULK_FLAG_INSERT_ID_REQUEST 64 +#define STMT_BULK_FLAG_SEND_UNIT_RESULTS 64 typedef enum mysql_stmt_state { diff --git a/libmariadb/include/mysql.h b/libmariadb/include/mysql.h index 76b16830..1d30486a 100644 --- a/libmariadb/include/mysql.h +++ b/libmariadb/include/mysql.h @@ -33,6 +33,7 @@ extern "C" { #endif #include <stdarg.h> +#include <time.h> #if !defined (_global_h) && !defined (MY_GLOBAL_INCLUDED) /* If not standard header */ #include <sys/types.h> @@ -257,7 +258,8 @@ extern const char *SQLSTATE_UNKNOWN; MARIADB_OPT_RESTRICTED_AUTH, MARIADB_OPT_RPL_REGISTER_REPLICA, MARIADB_OPT_STATUS_CALLBACK, - MARIADB_OPT_SERVER_PLUGINS + MARIADB_OPT_SERVER_PLUGINS, + MARIADB_OPT_BULK_UNIT_RESULTS }; enum mariadb_value { @@ -296,7 +298,8 @@ extern const char *SQLSTATE_UNKNOWN; MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES, MARIADB_CONNECTION_CLIENT_CAPABILITIES, MARIADB_CONNECTION_BYTES_READ, - MARIADB_CONNECTION_BYTES_SENT + MARIADB_CONNECTION_BYTES_SENT, + MARIADB_TLS_PEER_CERT_INFO, }; enum mysql_status { MYSQL_STATUS_READY, @@ -336,7 +339,7 @@ struct st_mysql_options { enum mysql_option methods_to_use; char *bind_address; my_bool secure_auth; - my_bool report_data_truncation; + my_bool report_data_truncation; /* function pointers for local infile support */ int (*local_infile_init)(void **, const char *, void *); int (*local_infile_read)(void *, char *, unsigned int); @@ -480,6 +483,27 @@ struct st_mysql_client_plugin MYSQL_CLIENT_PLUGIN_HEADER }; +enum mariadb_tls_verification { + MARIADB_VERIFY_NONE = 0, + MARIADB_VERIFY_PIPE, + MARIADB_VERIFY_UNIXSOCKET, + MARIADB_VERIFY_LOCALHOST, + MARIADB_VERIFY_FINGERPRINT, + MARIADB_VERIFY_PEER_CERT +}; + +typedef struct +{ + int version; + char *issuer; + char *subject; + char fingerprint[65]; + struct tm not_before; + struct tm not_after; + enum mariadb_tls_verification verify_mode; +} MARIADB_X509_INFO; + + struct st_mysql_client_plugin * mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, int argc, ...); diff --git a/libmariadb/include/mysql/client_plugin.h b/libmariadb/include/mysql/client_plugin.h index 667074ce..aa7e5363 100644 --- a/libmariadb/include/mysql/client_plugin.h +++ b/libmariadb/include/mysql/client_plugin.h @@ -43,7 +43,7 @@ #define MYSQL_CLIENT_PLUGIN_RESERVED2 1 #define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2 /* authentication */ -#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0100 +#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0101 #define MYSQL_CLIENT_MAX_PLUGINS 3 /* Connector/C specific plugin types */ @@ -128,6 +128,7 @@ struct st_mysql_client_plugin_AUTHENTICATION { MYSQL_CLIENT_PLUGIN_HEADER int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); + int (*hash_password_bin)(struct st_mysql *mysql, unsigned char *hash, size_t *hash_length); }; /******** trace plugin *******/ |