summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-03-26 14:01:39 +0100
committerSergei Golubchik <serg@mariadb.org>2015-04-08 10:58:47 +0200
commit5d8dbee97ba41fc36358cec94ae05e53a8bde0f8 (patch)
tree6a6d30d9fed99d3c30ccd8000b6812f6dd03c383 /plugin
parentc238e68d96cb61ff404ab8cf0e21898d832604a9 (diff)
downloadmariadb-git-5d8dbee97ba41fc36358cec94ae05e53a8bde0f8.tar.gz
remove get_iv() from the key management plugin API
now IVs are always handled internally
Diffstat (limited to 'plugin')
-rw-r--r--plugin/debug_key_management_plugin/debug_key_management_plugin.cc8
-rw-r--r--plugin/example_key_management_plugin/example_key_management_plugin.cc17
-rw-r--r--plugin/file_key_management_plugin/file_key_management_plugin.cc29
3 files changed, 3 insertions, 51 deletions
diff --git a/plugin/debug_key_management_plugin/debug_key_management_plugin.cc b/plugin/debug_key_management_plugin/debug_key_management_plugin.cc
index 98873687556..66c76523540 100644
--- a/plugin/debug_key_management_plugin/debug_key_management_plugin.cc
+++ b/plugin/debug_key_management_plugin/debug_key_management_plugin.cc
@@ -62,18 +62,12 @@ static unsigned int get_key_size(unsigned int ver)
return 16;
}
-static int get_iv(unsigned int ver, unsigned char* dstbuf, unsigned buflen)
-{
- return 0; // to be removed
-}
-
struct st_mariadb_encryption_key_management debug_key_management_plugin= {
MariaDB_ENCRYPTION_KEY_MANAGEMENT_INTERFACE_VERSION,
get_latest_key_version,
has_key,
get_key_size,
- get_key,
- get_iv
+ get_key
};
/*
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 62050eb48f2..6ccdfa5f4c5 100644
--- a/plugin/example_key_management_plugin/example_key_management_plugin.cc
+++ b/plugin/example_key_management_plugin/example_key_management_plugin.cc
@@ -86,20 +86,6 @@ static unsigned int get_key_size(unsigned int keyID)
return 16;
}
-static int get_iv(unsigned int keyID, unsigned char* dstbuf, unsigned buflen)
-{
- if (buflen < 16)
- {
- return CRYPT_BUFFER_TO_SMALL;
- }
-
- for (int i=0; i<16; i++)
- dstbuf[i] = 0;
-
- return CRYPT_KEY_OK;
-}
-
-
static int example_key_management_plugin_init(void *p)
{
/* init */
@@ -131,8 +117,7 @@ struct st_mariadb_encryption_key_management example_key_management_plugin= {
get_latest_key_version,
has_key_func,
get_key_size,
- get_key,
- get_iv
+ get_key
};
/*
diff --git a/plugin/file_key_management_plugin/file_key_management_plugin.cc b/plugin/file_key_management_plugin/file_key_management_plugin.cc
index 780aeb81f18..17e5dd089b5 100644
--- a/plugin/file_key_management_plugin/file_key_management_plugin.cc
+++ b/plugin/file_key_management_plugin/file_key_management_plugin.cc
@@ -204,32 +204,6 @@ static int get_key_from_key_file(unsigned int keyID, unsigned char* dstbuf,
}
}
-static int get_iv_from_key_file(unsigned int keyID, unsigned char* dstbuf,
- unsigned buflen)
-{
- keyentry* entry = KeySingleton::getInstance().getKeys((int)keyID);
-
- if (entry != NULL)
- {
- char* ivString = entry->iv;
- size_t iv_len = strlen(ivString)/2;
-
- if (buflen < iv_len)
- {
- return CRYPT_BUFFER_TO_SMALL;
- }
-
- my_aes_hex2uint(ivString, (unsigned char*)dstbuf, iv_len);
-
- return CRYPT_KEY_OK;
- }
- else
- {
- return CRYPT_KEY_UNKNOWN;
- }
-}
-
-
static int file_key_management_plugin_init(void *p)
{
/* init */
@@ -265,8 +239,7 @@ struct st_mariadb_encryption_key_management file_key_management_plugin= {
get_highest_key_used_in_key_file,
has_key_from_key_file,
get_key_size_from_key_file,
- get_key_from_key_file,
- get_iv_from_key_file
+ get_key_from_key_file
};
/*