From: Patrik Flykt <[email protected]>
Connman OpenVPN
OpenVPN.TLSAuth --tls-auth <file> [<direction>]
OpenVPN.TLSAuthDir optional <direction> argument to '--tls-auth'
Since 'OpenVPN.TLSAuthDir' contains the optional <direction> argument for
'OpenVPN.TLSAuth', handle them separately by setting the openvpn command
line argument to NULL.
---
plugins/openvpn.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/plugins/openvpn.c b/plugins/openvpn.c
index c3e7bcd..0349bdf 100644
--- a/plugins/openvpn.c
+++ b/plugins/openvpn.c
@@ -62,6 +62,8 @@ struct {
{ "OpenVPN.AskPass", "--askpass", 1 },
{ "OpenVPN.AuthNoCache", "--auth-nocache", 0 },
{ "OpenVPN.TLSRemote", "--tls-remote", 1 },
+ { "OpenVPN.TLSAuth", NULL, 1 },
+ { "OpenVPN.TLSAuthDir", NULL, 1 },
{ "OpenVPN.Cipher", "--cipher", 1 },
{ "OpenVPN.Auth", "--auth", 1 },
{ "OpenVPN.CompLZO", "--comp-lzo", 0 },
@@ -206,6 +208,9 @@ static int task_append_config_data(struct connman_provider
*provider,
int i;
for (i = 0; i < (int)ARRAY_SIZE(ov_options); i++) {
+ if (ov_options[i].ov_opt == NULL)
+ continue;
+
option = connman_provider_get_string(provider,
ov_options[i].cm_opt);
if (option == NULL)
@@ -235,6 +240,16 @@ static int ov_connect(struct connman_provider *provider,
task_append_config_data(provider, task);
+ option = connman_provider_get_string(provider, "OpenVPN.TLSAuth");
+ if (option != NULL) {
+ const char *tls_authdir_opt;
+
+ tls_authdir_opt = connman_provider_get_string(provider,
+ "TLSAuthDir");
+ connman_task_add_argument(task, "--tls-auth", option,
+ tls_authdir_opt, NULL);
+ }
+
connman_task_add_argument(task, "--syslog", NULL);
connman_task_add_argument(task, "--script-security", "2");
--
1.7.10.4
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman