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
051851b9
Commit
051851b9
authored
Mar 06, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base64 service
parent
70a2efde
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
193 additions
and
7 deletions
+193
-7
include/mysql/plugin_audit.h.pp
include/mysql/plugin_audit.h.pp
+16
-0
include/mysql/plugin_auth.h.pp
include/mysql/plugin_auth.h.pp
+16
-0
include/mysql/plugin_encryption.h.pp
include/mysql/plugin_encryption.h.pp
+16
-0
include/mysql/plugin_ftparser.h.pp
include/mysql/plugin_ftparser.h.pp
+16
-0
include/mysql/plugin_password_validation.h.pp
include/mysql/plugin_password_validation.h.pp
+16
-0
include/mysql/service_base64.h
include/mysql/service_base64.h
+82
-0
include/mysql/services.h
include/mysql/services.h
+1
-0
include/service_versions.h
include/service_versions.h
+1
-0
libservices/CMakeLists.txt
libservices/CMakeLists.txt
+1
-0
libservices/base64_service.c
libservices/base64_service.c
+18
-0
mysys/base64.c
mysys/base64.c
+0
-1
plugin/feedback/utils.cc
plugin/feedback/utils.cc
+0
-2
sql/item_strfunc.cc
sql/item_strfunc.cc
+0
-1
sql/log_event.cc
sql/log_event.cc
+0
-1
sql/sql_binlog.cc
sql/sql_binlog.cc
+0
-1
sql/sql_plugin_services.ic
sql/sql_plugin_services.ic
+10
-0
unittest/mysys/base64-t.c
unittest/mysys/base64-t.c
+0
-1
No files found.
include/mysql/plugin_audit.h.pp
View file @
051851b9
...
...
@@ -176,6 +176,22 @@ size_t my_md5_context_size();
void
my_md5_init
(
void
*
context
);
void
my_md5_input
(
void
*
context
,
const
unsigned
char
*
buf
,
size_t
len
);
void
my_md5_result
(
void
*
context
,
unsigned
char
*
digest
);
extern
struct
base64_service_st
{
int
(
*
base64_needed_encoded_length_ptr
)(
int
length_of_data
);
int
(
*
base64_encode_max_arg_length_ptr
)(
void
);
int
(
*
base64_needed_decoded_length_ptr
)(
int
length_of_encoded_data
);
int
(
*
base64_decode_max_arg_length_ptr
)();
int
(
*
base64_encode_ptr
)(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
(
*
base64_decode_ptr
)(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
}
*
base64_service
;
int
base64_needed_encoded_length
(
int
length_of_data
);
int
base64_encode_max_arg_length
(
void
);
int
base64_needed_decoded_length
(
int
length_of_encoded_data
);
int
base64_decode_max_arg_length
();
int
base64_encode
(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
base64_decode
(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
typedef
struct
logger_handle_st
LOGGER_HANDLE
;
extern
struct
logger_service_st
{
void
(
*
logger_init_mutexes
)();
...
...
include/mysql/plugin_auth.h.pp
View file @
051851b9
...
...
@@ -176,6 +176,22 @@ size_t my_md5_context_size();
void
my_md5_init
(
void
*
context
);
void
my_md5_input
(
void
*
context
,
const
unsigned
char
*
buf
,
size_t
len
);
void
my_md5_result
(
void
*
context
,
unsigned
char
*
digest
);
extern
struct
base64_service_st
{
int
(
*
base64_needed_encoded_length_ptr
)(
int
length_of_data
);
int
(
*
base64_encode_max_arg_length_ptr
)(
void
);
int
(
*
base64_needed_decoded_length_ptr
)(
int
length_of_encoded_data
);
int
(
*
base64_decode_max_arg_length_ptr
)();
int
(
*
base64_encode_ptr
)(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
(
*
base64_decode_ptr
)(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
}
*
base64_service
;
int
base64_needed_encoded_length
(
int
length_of_data
);
int
base64_encode_max_arg_length
(
void
);
int
base64_needed_decoded_length
(
int
length_of_encoded_data
);
int
base64_decode_max_arg_length
();
int
base64_encode
(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
base64_decode
(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
typedef
struct
logger_handle_st
LOGGER_HANDLE
;
extern
struct
logger_service_st
{
void
(
*
logger_init_mutexes
)();
...
...
include/mysql/plugin_encryption.h.pp
View file @
051851b9
...
...
@@ -176,6 +176,22 @@ size_t my_md5_context_size();
void
my_md5_init
(
void
*
context
);
void
my_md5_input
(
void
*
context
,
const
unsigned
char
*
buf
,
size_t
len
);
void
my_md5_result
(
void
*
context
,
unsigned
char
*
digest
);
extern
struct
base64_service_st
{
int
(
*
base64_needed_encoded_length_ptr
)(
int
length_of_data
);
int
(
*
base64_encode_max_arg_length_ptr
)(
void
);
int
(
*
base64_needed_decoded_length_ptr
)(
int
length_of_encoded_data
);
int
(
*
base64_decode_max_arg_length_ptr
)();
int
(
*
base64_encode_ptr
)(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
(
*
base64_decode_ptr
)(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
}
*
base64_service
;
int
base64_needed_encoded_length
(
int
length_of_data
);
int
base64_encode_max_arg_length
(
void
);
int
base64_needed_decoded_length
(
int
length_of_encoded_data
);
int
base64_decode_max_arg_length
();
int
base64_encode
(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
base64_decode
(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
typedef
struct
logger_handle_st
LOGGER_HANDLE
;
extern
struct
logger_service_st
{
void
(
*
logger_init_mutexes
)();
...
...
include/mysql/plugin_ftparser.h.pp
View file @
051851b9
...
...
@@ -176,6 +176,22 @@ size_t my_md5_context_size();
void
my_md5_init
(
void
*
context
);
void
my_md5_input
(
void
*
context
,
const
unsigned
char
*
buf
,
size_t
len
);
void
my_md5_result
(
void
*
context
,
unsigned
char
*
digest
);
extern
struct
base64_service_st
{
int
(
*
base64_needed_encoded_length_ptr
)(
int
length_of_data
);
int
(
*
base64_encode_max_arg_length_ptr
)(
void
);
int
(
*
base64_needed_decoded_length_ptr
)(
int
length_of_encoded_data
);
int
(
*
base64_decode_max_arg_length_ptr
)();
int
(
*
base64_encode_ptr
)(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
(
*
base64_decode_ptr
)(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
}
*
base64_service
;
int
base64_needed_encoded_length
(
int
length_of_data
);
int
base64_encode_max_arg_length
(
void
);
int
base64_needed_decoded_length
(
int
length_of_encoded_data
);
int
base64_decode_max_arg_length
();
int
base64_encode
(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
base64_decode
(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
typedef
struct
logger_handle_st
LOGGER_HANDLE
;
extern
struct
logger_service_st
{
void
(
*
logger_init_mutexes
)();
...
...
include/mysql/plugin_password_validation.h.pp
View file @
051851b9
...
...
@@ -176,6 +176,22 @@ size_t my_md5_context_size();
void
my_md5_init
(
void
*
context
);
void
my_md5_input
(
void
*
context
,
const
unsigned
char
*
buf
,
size_t
len
);
void
my_md5_result
(
void
*
context
,
unsigned
char
*
digest
);
extern
struct
base64_service_st
{
int
(
*
base64_needed_encoded_length_ptr
)(
int
length_of_data
);
int
(
*
base64_encode_max_arg_length_ptr
)(
void
);
int
(
*
base64_needed_decoded_length_ptr
)(
int
length_of_encoded_data
);
int
(
*
base64_decode_max_arg_length_ptr
)();
int
(
*
base64_encode_ptr
)(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
(
*
base64_decode_ptr
)(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
}
*
base64_service
;
int
base64_needed_encoded_length
(
int
length_of_data
);
int
base64_encode_max_arg_length
(
void
);
int
base64_needed_decoded_length
(
int
length_of_encoded_data
);
int
base64_decode_max_arg_length
();
int
base64_encode
(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
base64_decode
(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
typedef
struct
logger_handle_st
LOGGER_HANDLE
;
extern
struct
logger_service_st
{
void
(
*
logger_init_mutexes
)();
...
...
include/base64.h
→
include/
mysql/service_
base64.h
View file @
051851b9
/* Copyright (c) 2003-2006 MySQL AB
Use is subject to license terms
#ifndef MYSQL_SERVICE_BASE64_INCLUDED
/* Copyright (c) 2017, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -12,51 +12,71 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St
reet, Fifth Floor, Boston, MA 02110-1301,
USA */
Foundation, Inc., 51 Franklin St
, Fifth Floor, Boston, MA 02110-1301
USA */
#ifndef __BASE64_H_INCLUDED__
#define __BASE64_H_INCLUDED__
/**
@file
my base64 service
Functions for base64 en- and decoding
*/
#ifdef __cplusplus
extern
"C"
{
#endif
/*
Calculate how much memory needed for dst of base64_encode()
*/
#ifndef MYSQL_ABI_CHECK
#include <stdlib.h>
#endif
/* Allow multuple chunks 'AAA= AA== AA==', binlog uses this */
#define MY_BASE64_DECODE_ALLOW_MULTIPLE_CHUNKS 1
extern
struct
base64_service_st
{
int
(
*
base64_needed_encoded_length_ptr
)(
int
length_of_data
);
int
(
*
base64_encode_max_arg_length_ptr
)(
void
);
int
(
*
base64_needed_decoded_length_ptr
)(
int
length_of_encoded_data
);
int
(
*
base64_decode_max_arg_length_ptr
)();
int
(
*
base64_encode_ptr
)(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
int
(
*
base64_decode_ptr
)(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
}
*
base64_service
;
#ifdef MYSQL_DYNAMIC_PLUGIN
#define base64_needed_encoded_length(A) base64_service->base64_needed_encoded_length_ptr(A)
#define base64_encode_max_arg_length() base64_service->base64_encode_max_arg_length_ptr()
#define base64_needed_decoded_length(A) base64_service->base64_needed_decoded_length_ptr(A)
#define base64_decode_max_arg_length() base64_service->base64_decode_max_arg_length_ptr()
#define base64_encode(A,B,C) base64_service->base64_encode_ptr(A,B,C)
#define base64_decode(A,B,C,D,E) base64_service->base64_decode_ptr(A,B,C,D,E)
#else
/* Calculate how much memory needed for dst of base64_encode() */
int
base64_needed_encoded_length
(
int
length_of_data
);
/*
Maximum length base64_encode_needed_length() can accept with no overflow.
*/
/* Maximum length base64_encode_needed_length() can accept with no overflow. */
int
base64_encode_max_arg_length
(
void
);
/*
Calculate how much memory needed for dst of base64_decode()
*/
/* Calculate how much memory needed for dst of base64_decode() */
int
base64_needed_decoded_length
(
int
length_of_encoded_data
);
/*
Maximum length base64_decode_needed_length() can accept with no overflow.
*/
/* Maximum length base64_decode_needed_length() can accept with no overflow. */
int
base64_decode_max_arg_length
();
/*
Encode data as a base64 string
*/
/* Encode data as a base64 string */
int
base64_encode
(
const
void
*
src
,
size_t
src_len
,
char
*
dst
);
/*
Decode a base64 string into data
*/
/* Decode a base64 string into data */
int
base64_decode
(
const
char
*
src
,
size_t
src_len
,
void
*
dst
,
const
char
**
end_ptr
,
int
flags
);
/* Allow multuple chunks 'AAA= AA== AA==', binlog uses this */
#define MY_BASE64_DECODE_ALLOW_MULTIPLE_CHUNKS 1
#endif
#ifdef __cplusplus
}
#endif
#endif
/* !__BASE64_H_INCLUDED__ */
#define MYSQL_SERVICE_BASE64_INCLUDED
#endif
include/mysql/services.h
View file @
051851b9
...
...
@@ -29,6 +29,7 @@ extern "C" {
#include <mysql/service_sha2.h>
#include <mysql/service_sha1.h>
#include <mysql/service_md5.h>
#include <mysql/service_base64.h>
#include <mysql/service_logger.h>
#include <mysql/service_thd_autoinc.h>
#include <mysql/service_thd_error_context.h>
...
...
include/service_versions.h
View file @
051851b9
...
...
@@ -33,6 +33,7 @@
#define VERSION_my_md5 0x0100
#define VERSION_wsrep 0x0201
#define VERSION_logger 0x0100
#define VERSION_base64 0x0100
#define VERSION_thd_autoinc 0x0100
#define VERSION_thd_error_context 0x0100
#define VERSION_thd_specifics 0x0100
...
...
libservices/CMakeLists.txt
View file @
051851b9
...
...
@@ -28,6 +28,7 @@ SET(MYSQLSERVICES_SOURCES
my_sha2_service.c
my_sha1_service.c
my_md5_service.c
base64_service.c
wsrep_service.c
encryption_service.c
encryption_scheme_service.c
...
...
libservices/base64_service.c
0 → 100644
View file @
051851b9
/* Copyright (c) 2017 MariaDB
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <service_versions.h>
SERVICE_VERSION
base64_service
=
(
void
*
)
VERSION_base64
;
mysys/base64.c
View file @
051851b9
...
...
@@ -17,7 +17,6 @@
#include <my_global.h>
#include <m_string.h>
/* strchr() */
#include <m_ctype.h>
/* my_isspace() */
#include <base64.h>
#ifndef MAIN
...
...
plugin/feedback/utils.cc
View file @
051851b9
...
...
@@ -19,8 +19,6 @@
#include <unistd.h>
#endif
#include <base64.h>
#if defined (_WIN32)
#define HAVE_SYS_UTSNAME_H
...
...
sql/item_strfunc.cc
View file @
051851b9
...
...
@@ -48,7 +48,6 @@
#include "password.h" // my_make_scrambled_password,
// my_make_scrambled_password_323
#include <m_ctype.h>
#include <base64.h>
#include <my_md5.h>
#include <zlib.h>
C_MODE_START
...
...
sql/log_event.cc
View file @
051851b9
...
...
@@ -46,7 +46,6 @@
#include "wsrep_mysqld.h"
#endif
/* MYSQL_CLIENT */
#include <base64.h>
#include <my_bitmap.h>
#include "rpl_utility.h"
#include "rpl_constants.h"
...
...
sql/sql_binlog.cc
View file @
051851b9
...
...
@@ -20,7 +20,6 @@
#include "sql_parse.h" // check_global_access
#include "sql_acl.h" // *_ACL
#include "rpl_rli.h"
#include "base64.h"
#include "slave.h" // apply_event_and_update_pos
#include "log_event.h" // Format_description_log_event,
// EVENT_LEN_OFFSET,
...
...
sql/sql_plugin_services.ic
View file @
051851b9
...
...
@@ -119,6 +119,15 @@ static struct thd_autoinc_service_st thd_autoinc_handler= {
thd_get_autoinc
};
static struct base64_service_st base64_handler= {
base64_needed_encoded_length,
base64_encode_max_arg_length,
base64_needed_decoded_length,
base64_decode_max_arg_length,
base64_encode,
base64_decode
};
static struct thd_error_context_service_st thd_error_conext_handler= {
thd_get_error_message,
thd_get_error_number,
...
...
@@ -195,6 +204,7 @@ static struct st_service_ref list_of_services[]=
{ "my_sha1_service", VERSION_my_sha1, &my_sha1_handler},
{ "my_md5_service", VERSION_my_md5, &my_md5_handler},
{ "logger_service", VERSION_logger, &logger_service_handler },
{ "base64_service", VERSION_base64, &base64_handler },
{ "thd_autoinc_service", VERSION_thd_autoinc, &thd_autoinc_handler },
{ "wsrep_service", VERSION_wsrep, &wsrep_handler },
{ "encryption_service", VERSION_encryption, &encryption_handler },
...
...
unittest/mysys/base64-t.c
View file @
051851b9
...
...
@@ -16,7 +16,6 @@
#include <my_global.h>
#include <my_sys.h>
#include <base64.h>
#include <tap.h>
#include <string.h>
...
...
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