Hi,
Thanks for the patch exporting base64_encode/decode
A quick question/comment though: quoting from your sample base64.c
On Fri, May 5, 2017 at 5:46 PM, David Sommerseth <dav...@openvpn.net> wrote:
> + /* Which callbacks to intercept. */
> + ret->type_mask =
> + OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_TLS_VERIFY)
> + |OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT_V2);
> +
> + /* we don't need a plug-in context in this example, but OpenVPN
> expects "something" */
> + ret->handle = calloc(1, 1);
>
While this looks right[*], in openvpn-plugin.h (lines 344-370) the handle
in the _return struct
is defined as openvpn_plugin_handle_t * where that type itself is void *,
making handle void **.
Also the comment accompanying "struct openvpn_plugin_args_open_return"
indicates
*handle should be set to the pointer to the context but that cant be right.
The compiler will not warn about void * and void ** mismatches, so ignoring
the definition and
saving the context pointer in ret->handle works, but the declaration of
handle in the return struct
should be simply openvpn_plugin_handle_t without the *. The same comment
also refers to
*type_mask instead of type_mask.which is not right either.
.
Am I missing something?
Selva
[*] By the way, this being an example, it may be best to show the correct
type by casting the
return value of calloc to (openvpn_plugin_handle_t)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel