diff options
author | Emil Renner Berthing <esmil@mailme.dk> | 2012-10-23 13:29:24 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-10-29 12:38:08 +0200 |
commit | 2b8ef6f34662ed024d5fa015442e113fccbd6663 (patch) | |
tree | 89b9e331ea570e94b794fa75fa02fda400f4b7fd /plugins | |
parent | 39e7dd43497a80f1637ae7de6887e77d7113d14c (diff) | |
download | connman-2b8ef6f34662ed024d5fa015442e113fccbd6663.tar.gz connman-2b8ef6f34662ed024d5fa015442e113fccbd6663.tar.bz2 connman-2b8ef6f34662ed024d5fa015442e113fccbd6663.zip |
openvpn: Support '--tls-auth <file>' with optional '<direction>' argument
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. The special handling is
identified by setting openvpn command line argument to NULL.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/openvpn.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/openvpn.c b/plugins/openvpn.c index c3e7bcd6..bac1671b 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,15 @@ 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) { + connman_task_add_argument(task, "--tls-auth", option); + option = connman_provider_get_string(provider, + "OpenVPN.TLSAuthDir"); + if (option != NULL) + connman_task_add_argument(task, option, NULL); + } + connman_task_add_argument(task, "--syslog", NULL); connman_task_add_argument(task, "--script-security", "2"); |