summaryrefslogtreecommitdiffhomepage
path: root/svr-session.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2019-05-15 21:59:45 +0800
committerMatt Johnston <matt@ucc.asn.au>2019-05-15 21:59:45 +0800
commitfa116e983b4931010e1082dd5c8bf38bbc77718c (patch)
tree6e4e2d4e1fb756895cf5ea17bfa0f0493ffd49f3 /svr-session.c
parent8c6aaf8d361e95ba3d9b371b86abaae1fd0e436f (diff)
Rename EPKA -> Plugin
Diffstat (limited to 'svr-session.c')
-rw-r--r--svr-session.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/svr-session.c b/svr-session.c
index 3ea7589..47f36b5 100644
--- a/svr-session.c
+++ b/svr-session.c
@@ -89,15 +89,15 @@ svr_session_cleanup(void) {
m_free(svr_ses.childpids);
svr_ses.childpidsize = 0;
-#if DROPBEAR_EPKA
- if (svr_ses.epka_plugin_handle != NULL) {
- if (svr_ses.epka_instance) {
- svr_ses.epka_instance->delete_plugin(svr_ses.epka_instance);
- svr_ses.epka_instance = NULL;
+#if DROPBEAR_PLUGIN
+ if (svr_ses.plugin_handle != NULL) {
+ if (svr_ses.plugin_instance) {
+ svr_ses.plugin_instance->delete_plugin(svr_ses.plugin_instance);
+ svr_ses.plugin_instance = NULL;
}
- dlclose(svr_ses.epka_plugin_handle);
- svr_ses.epka_plugin_handle = NULL;
+ dlclose(svr_ses.plugin_handle);
+ svr_ses.plugin_handle = NULL;
}
#endif
}
@@ -122,10 +122,10 @@ void svr_session(int sock, int childpipe) {
m_free(host);
m_free(port);
-#if DROPBEAR_EPKA
- /* Initializes the EPKA Plugin */
- svr_ses.epka_plugin_handle = NULL;
- svr_ses.epka_instance = NULL;
+#if DROPBEAR_PLUGIN
+ /* Initializes the PLUGIN Plugin */
+ svr_ses.plugin_handle = NULL;
+ svr_ses.plugin_instance = NULL;
if (svr_opts.pubkey_plugin) {
#if DEBUG_TRACE
const int verbose = debug_trace;
@@ -135,33 +135,33 @@ void svr_session(int sock, int childpipe) {
PubkeyExtPlugin_newFn pluginConstructor;
/* RTLD_NOW: fails if not all the symbols are resolved now. Better fail now than at run-time */
- svr_ses.epka_plugin_handle = dlopen(svr_opts.pubkey_plugin, RTLD_NOW);
- if (svr_ses.epka_plugin_handle == NULL) {
+ svr_ses.plugin_handle = dlopen(svr_opts.pubkey_plugin, RTLD_NOW);
+ if (svr_ses.plugin_handle == NULL) {
dropbear_exit("failed to load external pubkey plugin '%s': %s", svr_opts.pubkey_plugin, dlerror());
}
- pluginConstructor = (PubkeyExtPlugin_newFn)dlsym(svr_ses.epka_plugin_handle, DROPBEAR_PUBKEY_PLUGIN_FNNAME_NEW);
+ pluginConstructor = (PubkeyExtPlugin_newFn)dlsym(svr_ses.plugin_handle, DROPBEAR_PUBKEY_PLUGIN_FNNAME_NEW);
if (!pluginConstructor) {
dropbear_exit("plugin constructor method not found in external pubkey plugin");
}
/* Create an instance of the plugin */
- svr_ses.epka_instance = pluginConstructor(verbose, svr_opts.pubkey_plugin_options, svr_ses.addrstring);
- if (svr_ses.epka_instance == NULL) {
+ svr_ses.plugin_instance = pluginConstructor(verbose, svr_opts.pubkey_plugin_options, svr_ses.addrstring);
+ if (svr_ses.plugin_instance == NULL) {
dropbear_exit("external plugin initialization failed");
}
/* Check if the plugin is compatible */
- if ( (svr_ses.epka_instance->api_version[0] != DROPBEAR_EPKA_VERSION_MAJOR) ||
- (svr_ses.epka_instance->api_version[1] < DROPBEAR_EPKA_VERSION_MINOR) ) {
+ if ( (svr_ses.plugin_instance->api_version[0] != DROPBEAR_PLUGIN_VERSION_MAJOR) ||
+ (svr_ses.plugin_instance->api_version[1] < DROPBEAR_PLUGIN_VERSION_MINOR) ) {
dropbear_exit("plugin version check failed: "
"Dropbear=%d.%d, plugin=%d.%d",
- DROPBEAR_EPKA_VERSION_MAJOR, DROPBEAR_EPKA_VERSION_MINOR,
- svr_ses.epka_instance->api_version[0], svr_ses.epka_instance->api_version[1]);
+ DROPBEAR_PLUGIN_VERSION_MAJOR, DROPBEAR_PLUGIN_VERSION_MINOR,
+ svr_ses.plugin_instance->api_version[0], svr_ses.plugin_instance->api_version[1]);
}
- if (svr_ses.epka_instance->api_version[1] > DROPBEAR_EPKA_VERSION_MINOR) {
+ if (svr_ses.plugin_instance->api_version[1] > DROPBEAR_PLUGIN_VERSION_MINOR) {
dropbear_log(LOG_WARNING, "plugin API newer than dropbear API: "
"Dropbear=%d.%d, plugin=%d.%d",
- DROPBEAR_EPKA_VERSION_MAJOR, DROPBEAR_EPKA_VERSION_MINOR,
- svr_ses.epka_instance->api_version[0], svr_ses.epka_instance->api_version[1]);
+ DROPBEAR_PLUGIN_VERSION_MAJOR, DROPBEAR_PLUGIN_VERSION_MINOR,
+ svr_ses.plugin_instance->api_version[0], svr_ses.plugin_instance->api_version[1]);
}
dropbear_log(LOG_INFO, "successfully loaded and initialized pubkey plugin '%s'", svr_opts.pubkey_plugin);
}
@@ -209,11 +209,11 @@ void svr_dropbear_exit(int exitcode, const char* format, va_list param) {
char fullmsg[300];
int i;
-#if DROPBEAR_EPKA
- if ((ses.epka_session != NULL)) {
- svr_ses.epka_instance->delete_session(ses.epka_session);
+#if DROPBEAR_PLUGIN
+ if ((ses.plugin_session != NULL)) {
+ svr_ses.plugin_instance->delete_session(ses.plugin_session);
}
- ses.epka_session = NULL;
+ ses.plugin_session = NULL;
#endif
/* Render the formatted exit message */