MCPcopy Create free account
hub / github.com/MariaDB/server / initialize_encryption_plugin

Function initialize_encryption_plugin

sql/encryption.cc:62–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60} /* extern "C" */
61
62int initialize_encryption_plugin(void *plugin_)
63{
64 st_plugin_int *plugin= static_cast<st_plugin_int *>(plugin_);
65 if (encryption_manager)
66 return 1;
67
68 vio_check_ssl_init();
69
70 if (plugin->plugin->init && plugin->plugin->init(plugin))
71 {
72 sql_print_error("Plugin '%s' init function returned error.",
73 plugin->name.str);
74 return 1;
75 }
76
77 encryption_manager= plugin_lock(NULL, plugin_int_to_ref(plugin));
78 st_mariadb_encryption *handle=
79 (struct st_mariadb_encryption*) plugin->plugin->info;
80
81 /*
82 Compiler on Spark doesn't like the '?' operator here as it
83 believes the (uint (*)...) implies the C++ call model.
84 */
85 if (handle->crypt_ctx_size)
86 encryption_handler.encryption_ctx_size_func= handle->crypt_ctx_size;
87 else
88 encryption_handler.encryption_ctx_size_func= ctx_size;
89
90 encryption_handler.encryption_ctx_init_func=
91 handle->crypt_ctx_init ? handle->crypt_ctx_init : ctx_init;
92
93 encryption_handler.encryption_ctx_update_func=
94 handle->crypt_ctx_update ? handle->crypt_ctx_update : my_aes_crypt_update;
95
96 encryption_handler.encryption_ctx_finish_func=
97 handle->crypt_ctx_finish ? handle->crypt_ctx_finish : my_aes_crypt_finish;
98
99 encryption_handler.encryption_encrypted_length_func=
100 handle->encrypted_length ? handle->encrypted_length : get_length;
101
102 encryption_handler.encryption_key_get_func=
103 handle->get_key;
104
105 encryption_handler.encryption_key_get_latest_version_func=
106 handle->get_latest_key_version; // must be the last
107
108 return 0;
109}
110
111int finalize_encryption_plugin(void *plugin_)
112{

Callers

nothing calls this directly

Calls 4

vio_check_ssl_initFunction · 0.85
plugin_lockFunction · 0.85
sql_print_errorFunction · 0.70
initMethod · 0.45

Tested by

no test coverage detected