diff options
-rw-r--r-- | plugin/eurephia-auth.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugin/eurephia-auth.c b/plugin/eurephia-auth.c index c93df1d..1488d9a 100644 --- a/plugin/eurephia-auth.c +++ b/plugin/eurephia-auth.c @@ -256,6 +256,7 @@ OPENVPN_EXPORT int openvpn_plugin_open_v3(const int apiversion, return OPENVPN_PLUGIN_FUNC_ERROR; } +#if OPENVPN_PLUGINv3_STRUCTVER > 1 // Check that OpenVPN uses OpenSSL if( arguments->ssl_api != SSLAPI_OPENSSL ) { arguments->callbacks->plugin_log(PLOG_ERR, "eurephia", @@ -263,6 +264,9 @@ OPENVPN_EXPORT int openvpn_plugin_open_v3(const int apiversion, "eurephia requires OpenSSL."); return OPENVPN_PLUGIN_FUNC_ERROR; } +#else +#warning OpenVPN must be compiled against OpenSSL for eurephia to function. You have been warned! +#endif // Define what will trigger eurephia ovpnret->type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_UP) @@ -319,8 +323,8 @@ OPENVPN_EXPORT int openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, if( type != OPENVPN_PLUGIN_UP ) { // Exctract certificate information from either environment variables - ci = parse_tlsid(GETENV_TLSID(ctx, envp, argv[1]), - GETENV_TLSDIGEST(ctx, envp, argv[1])); + ci = parse_tlsid(GETENV_TLSID(ctx, envp, atoi_nullsafe(argv[1])), + GETENV_TLSDIGEST(ctx, envp, atoi_nullsafe(argv[1]))); if( ci == NULL ) { eurephia_log(ctx, LOG_FATAL, 0, "Failed to extract certificate info"); return OPENVPN_PLUGIN_FUNC_ERROR; |