[Commits] 97037da: Replace static usage of AES_CTR with current encryption algorithm.

Jan Lindström jan.lindstrom at mariadb.com
Tue Mar 17 11:00:01 EET 2015


revision-id: 97037da7161a5a6bff3753a465a4af37496c9ca5
parent(s): a3e68b4a558e1dd0ff61e497316cb6a32d3de410
committer: Jan Lindström
branch nick: 10.1-innodb
timestamp: 2015-03-17 10:59:25 +0200
message:

Replace static usage of AES_CTR with current encryption algorithm.

---
 .../example_key_management_plugin.cc                           | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/plugin/example_key_management_plugin/example_key_management_plugin.cc b/plugin/example_key_management_plugin/example_key_management_plugin.cc
index f590fbb..580e9ea 100644
--- a/plugin/example_key_management_plugin/example_key_management_plugin.cc
+++ b/plugin/example_key_management_plugin/example_key_management_plugin.cc
@@ -6,6 +6,7 @@
 #include <mysql/plugin_encryption_key_management.h>
 #include <my_md5.h>
 #include <my_rnd.h>
+#include "sql_class.h"
 
 /* rotate key randomly between 45 and 90 seconds */
 #define KEY_ROTATION_MIN 45
@@ -80,7 +81,14 @@ static int example_key_management_plugin_init(void *p)
   my_rnd_init(&seed, time(0), 0);
   get_latest_key_version();
 
-  my_aes_init_dynamic_encrypt(MY_AES_ALGORITHM_CTR);
+  if (current_aes_dynamic_method == MY_AES_ALGORITHM_NONE)
+  {
+    sql_print_error("No encryption method choosen with --encryption-algorithm. "
+                    "example_key_management_plugin disabled");
+    return 1;
+  }
+
+  my_aes_init_dynamic_encrypt(current_aes_dynamic_method);
 
   pthread_mutex_init(&mutex, NULL);
 


More information about the commits mailing list