Go to the documentation of this file.
31 #define PLUGIN_NAME "base64.c"
54 get_env(
const char *name,
const char *envp[])
59 const int namelen = strlen(name);
60 for (i = 0; envp[i]; ++i)
62 if (!strncmp(envp[i], name, namelen))
64 const char *cp = envp[i] + namelen;
106 printf(
"base64.c: ** ERROR ** Incompatible plug-in interface between this plug-in and OpenVPN\n");
116 ret->
handle = calloc(1, 1);
164 const char *clcert_cn =
get_env(
"X509_0_CN", envp);
178 char buf2[256] = {0};
184 r = strcmp(clcert_cn, buf2);
plugin_base64_decode_t plugin_base64_decode
int(* plugin_base64_encode_t)(const void *data, int size, char **str)
Export of openvpn_base64_encode() to be used inside plug-ins.
#define OPENVPN_PLUGIN_CLIENT_CONNECT_V2
plugin_base64_encode_t ovpn_base64_encode
Pointer to the openvpn_base64_encode () function.
OPENVPN_EXPORT void openvpn_plugin_close_v1(openvpn_plugin_handle_t handle)
This cleans up the last part of the plug-in, allows it to shut down cleanly and release the plug-in g...
Arguments used to transport variables to the plug-in.
Contains all state information for one tunnel.
#define OPENVPN_PLUGINv3_STRUCTVER
Defines version of the v3 plugin argument structs.
OPENVPN_EXPORT int openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[])
This function is called by OpenVPN each time the OpenVPN reaches a point where plug-in calls should h...
void(* plugin_log_t)(openvpn_plugin_log_flags_t flags, const char *plugin_name, const char *format,...) _ovpn_chk_fmt(3
#define OPENVPN_PLUGIN_MASK(x)
const char *const ovpn_version_patch
const unsigned int ovpn_version_major
#define OPENVPN_PLUGIN_FUNC_ERROR
plugin_vlog_t ovpn_vlog
Pointer to the OpenVPN vlog function.
int(* plugin_base64_decode_t)(const char *str, void *data, int size)
Export of openvpn_base64_decode() to be used inside plug-ins.
plugin_log_t ovpn_log
Pointer to the OpenVPN log function.
plugin_base64_encode_t plugin_base64_encode
void(*) typedef void(* plugin_vlog_t)(openvpn_plugin_log_flags_t flags, const char *plugin_name, const char *format, va_list arglist) _ovpn_chk_fmt(3
static const char * get_env(const char *name, const char *envp[])
Search the environment pointer for a specific env var name.
#define OPENVPN_PLUGIN_TLS_VERIFY
plugin_vlog_t plugin_vlog
const char * ovpn_version
Arguments used to transport variables from the plug-in back to the OpenVPN process.
openvpn_plugin_handle_t handle
#define OPENVPN_PLUGIN_FUNC_SUCCESS
plugin_base64_decode_t ovpn_base64_decode
Pointer to the openvpn_base64_decode () function.
OPENVPN_EXPORT int openvpn_plugin_open_v3(const int v3structver, struct openvpn_plugin_args_open_in const *args, struct openvpn_plugin_args_open_return *ret)
This function is called when OpenVPN loads the plug-in.
void * openvpn_plugin_handle_t
struct openvpn_plugin_callbacks * callbacks
const unsigned int ovpn_version_minor