[packages] add openvpn-polarssl, experimental small OpenVPN Git build using PolarSSL...
[openwrt/svn-archive/archive.git] / net / openvpn-polarssl / patches / 300-fix-plugin_call-with-ssl.patch
1 --- a/init.c
2 +++ b/init.c
3 @@ -1337,7 +1337,11 @@ do_route (const struct options *options,
4
5 if (plugin_defined (plugins, OPENVPN_PLUGIN_ROUTE_UP))
6 {
7 - if (plugin_call (plugins, OPENVPN_PLUGIN_ROUTE_UP, NULL, NULL, es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
8 + if (plugin_call (plugins, OPENVPN_PLUGIN_ROUTE_UP, NULL, NULL, es
9 +#ifdef USE_SSL
10 + , -1, NULL
11 +#endif
12 + ) != OPENVPN_PLUGIN_FUNC_SUCCESS)
13 msg (M_WARN, "WARNING: route-up plugin call failed");
14 }
15
16 --- a/misc.c
17 +++ b/misc.c
18 @@ -213,7 +213,11 @@ run_up_down (const char *command,
19 ifconfig_local, ifconfig_remote,
20 context);
21
22 - if (plugin_call (plugins, plugin_type, &argv, NULL, es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
23 + if (plugin_call (plugins, plugin_type, &argv, NULL, es
24 +#ifdef USE_SSL
25 + , -1, NULL
26 +#endif
27 + ) != OPENVPN_PLUGIN_FUNC_SUCCESS)
28 msg (M_FATAL, "ERROR: up/down plugin call failed");
29
30 argv_reset (&argv);
31 --- a/multi.c
32 +++ b/multi.c
33 @@ -91,7 +91,11 @@ learn_address_script (const struct multi
34 mroute_addr_print (addr, &gc));
35 if (mi)
36 argv_printf_cat (&argv, "%s", tls_common_name (mi->context.c2.tls_multi, false));
37 - if (plugin_call (plugins, OPENVPN_PLUGIN_LEARN_ADDRESS, &argv, NULL, es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
38 + if (plugin_call (plugins, OPENVPN_PLUGIN_LEARN_ADDRESS, &argv, NULL, es
39 +#ifdef USE_SSL
40 + , -1, NULL
41 +#endif
42 + ) != OPENVPN_PLUGIN_FUNC_SUCCESS)
43 {
44 msg (M_WARN, "WARNING: learn-address plugin call failed");
45 ret = false;
46 @@ -476,7 +480,11 @@ multi_client_disconnect_script (struct m
47
48 if (plugin_defined (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_DISCONNECT))
49 {
50 - if (plugin_call (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_DISCONNECT, NULL, NULL, mi->context.c2.es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
51 + if (plugin_call (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_DISCONNECT, NULL, NULL, mi->context.c2.es
52 +#ifdef USE_SSL
53 + , -1, NULL
54 +#endif
55 + ) != OPENVPN_PLUGIN_FUNC_SUCCESS)
56 msg (M_WARN, "WARNING: client-disconnect plugin call failed");
57 }
58
59 --- a/socket.c
60 +++ b/socket.c
61 @@ -2117,7 +2117,11 @@ link_socket_connection_initiated (const
62 {
63 struct argv argv = argv_new ();
64 ipchange_fmt (false, &argv, info, &gc);
65 - if (plugin_call (info->plugins, OPENVPN_PLUGIN_IPCHANGE, &argv, NULL, es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
66 + if (plugin_call (info->plugins, OPENVPN_PLUGIN_IPCHANGE, &argv, NULL, es
67 +#ifdef USE_SSL
68 + , -1, NULL
69 +#endif
70 + ) != OPENVPN_PLUGIN_FUNC_SUCCESS)
71 msg (M_WARN, "WARNING: ipchange plugin call failed");
72 argv_reset (&argv);
73 }
74 --- a/ssl.c
75 +++ b/ssl.c
76 @@ -1939,7 +1939,11 @@ key_method_2_read (struct buffer *buf, s
77 */
78 if (ks->authenticated && plugin_defined (session->opt->plugins, OPENVPN_PLUGIN_TLS_FINAL))
79 {
80 - if (plugin_call (session->opt->plugins, OPENVPN_PLUGIN_TLS_FINAL, NULL, NULL, session->opt->es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
81 + if (plugin_call (session->opt->plugins, OPENVPN_PLUGIN_TLS_FINAL, NULL, NULL, session->opt->es
82 +#ifdef USE_SSL
83 + , -1, NULL
84 +#endif
85 + ) != OPENVPN_PLUGIN_FUNC_SUCCESS)
86 ks->authenticated = false;
87 }
88
89 --- a/pf.c
90 +++ b/pf.c
91 @@ -563,7 +563,11 @@ pf_init_context (struct context *c)
92 if( pf_file ) {
93 setenv_str (c->c2.es, "pf_file", pf_file);
94
95 - if (plugin_call (c->plugins, OPENVPN_PLUGIN_ENABLE_PF, NULL, NULL, c->c2.es) == OPENVPN_PLUGIN_FUNC_SUCCESS)
96 + if (plugin_call (c->plugins, OPENVPN_PLUGIN_ENABLE_PF, NULL, NULL, c->c2.es
97 +#ifdef USE_SSL
98 + , -1, NULL
99 +#endif
100 + ) == OPENVPN_PLUGIN_FUNC_SUCCESS)
101 {
102 event_timeout_init (&c->c2.pf.reload, 1, now);
103 c->c2.pf.filename = string_alloc (pf_file, NULL);
104 --- a/ssl_verify.c
105 +++ b/ssl_verify.c
106 @@ -1029,7 +1029,11 @@ verify_user_pass_plugin (struct tls_sess
107 #endif
108
109 /* call command */
110 - retval = plugin_call (session->opt->plugins, OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY, NULL, NULL, session->opt->es);
111 + retval = plugin_call (session->opt->plugins, OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY, NULL, NULL, session->opt->es
112 +#ifdef USE_SSL
113 + , -1, NULL
114 +#endif
115 + );
116
117 #ifdef PLUGIN_DEF_AUTH
118 /* purge auth control filename (and file itself) for non-deferred returns */