summaryrefslogtreecommitdiff
path: root/include/mysql/plugin_password_validation.h.pp
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-05-13 21:57:24 +0200
committerSergei Golubchik <serg@mariadb.org>2015-05-15 18:12:01 +0200
commit2300fe2e0ed59e36046bb867cc7499bf4c3d7c27 (patch)
tree9adab44a30ef40e5cf1e1661220a9cf8079cb5b5 /include/mysql/plugin_password_validation.h.pp
parent632f2307f775d255bab948de2178feb85fcac970 (diff)
downloadmariadb-git-2300fe2e0ed59e36046bb867cc7499bf4c3d7c27.tar.gz
Identical key derivation code in XtraDB/InnoDB/Aria
* Extract it into the "encryption_scheme" service. * Make these engines to use the service, remove duplicate code. * Change MY_AES_xxx error codes, to return them safely from encryption_scheme_encrypt/decrypt without conflicting with ENCRYPTION_SCHEME_KEY_INVALID error
Diffstat (limited to 'include/mysql/plugin_password_validation.h.pp')
-rw-r--r--include/mysql/plugin_password_validation.h.pp37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/mysql/plugin_password_validation.h.pp b/include/mysql/plugin_password_validation.h.pp
index e7dcc44f07a..6b8a886dc25 100644
--- a/include/mysql/plugin_password_validation.h.pp
+++ b/include/mysql/plugin_password_validation.h.pp
@@ -213,6 +213,43 @@ struct encryption_service_st {
encrypt_decrypt_func encryption_decrypt_func;
};
extern struct encryption_service_st encryption_handler;
+#include <mysql/service_encryption_scheme.h>
+struct st_encryption_scheme_key {
+ unsigned int version;
+ unsigned char key[16];
+};
+struct st_encryption_scheme {
+ unsigned char iv[16];
+ struct st_encryption_scheme_key key[3];
+ unsigned int keyserver_requests;
+ unsigned int key_id;
+ unsigned int type;
+ void (*locker)(struct st_encryption_scheme *self, int release);
+};
+extern struct encryption_scheme_service_st {
+ int (*encryption_scheme_encrypt_func)
+ (const unsigned char* src, unsigned int slen,
+ unsigned char* dst, unsigned int* dlen,
+ struct st_encryption_scheme *scheme,
+ unsigned int key_version, unsigned int i32_1,
+ unsigned int i32_2, unsigned long long i64);
+ int (*encryption_scheme_decrypt_func)
+ (const unsigned char* src, unsigned int slen,
+ unsigned char* dst, unsigned int* dlen,
+ struct st_encryption_scheme *scheme,
+ unsigned int key_version, unsigned int i32_1,
+ unsigned int i32_2, unsigned long long i64);
+} *encryption_scheme_service;
+int encryption_scheme_encrypt(const unsigned char* src, unsigned int slen,
+ unsigned char* dst, unsigned int* dlen,
+ struct st_encryption_scheme *scheme,
+ unsigned int key_version, unsigned int i32_1,
+ unsigned int i32_2, unsigned long long i64);
+int encryption_scheme_decrypt(const unsigned char* src, unsigned int slen,
+ unsigned char* dst, unsigned int* dlen,
+ struct st_encryption_scheme *scheme,
+ unsigned int key_version, unsigned int i32_1,
+ unsigned int i32_2, unsigned long long i64);
struct st_mysql_xid {
long formatID;
long gtrid_length;