summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-05-11 14:21:44 +0200
committerSergei Golubchik <serg@mariadb.org>2015-05-13 14:27:17 +0200
commit6e4c22af7c16c3e743eb1ec60e10bdebe967d8f9 (patch)
treec1b84f6279fd1e70c5f5e1d9236506f72466cafe
parentacd992d4b7fafa40a1c7a85b64238829b831e0bf (diff)
downloadmariadb-git-6e4c22af7c16c3e743eb1ec60e10bdebe967d8f9.tar.gz
example encryption plugin supports key ids
show that two keys can be different if they have different ids or different versions.
-rw-r--r--plugin/example_key_management/example_key_management_plugin.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugin/example_key_management/example_key_management_plugin.cc b/plugin/example_key_management/example_key_management_plugin.cc
index 8bd6138364f..32fa135d33a 100644
--- a/plugin/example_key_management/example_key_management_plugin.cc
+++ b/plugin/example_key_management/example_key_management_plugin.cc
@@ -21,8 +21,6 @@
different pages in the same tablespace encrypted with different keys
and what the background re-encryption thread does.
- It does not support different key ids, for all ids the key will be the same.
-
THIS IS AN EXAMPLE ONLY! ENCRYPTION KEYS ARE HARD-CODED AND *NOT* SECRET!
DO NOT USE THIS PLUGIN IN PRODUCTION! EVER!
*/
@@ -71,7 +69,8 @@ get_key(unsigned int key_id, unsigned int version,
if (!dstbuf)
return 0;
- my_md5(dstbuf, (const char*)&version, sizeof(version));
+ my_md5_multi(dstbuf, (const char*)&key_id, sizeof(key_id),
+ (const char*)&version, sizeof(version), NULL);
return 0;
}