mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-04 23:28:08 +02:00
nm-import-openvpn: import 'tls-cipher' option
https://bugzilla.gnome.org/show_bug.cgi?id=763484 https://git.gnome.org/browse/network-manager-openvpn/commit/?id=d7a84afe1d1948c7990a08b18913e65550c222a0
This commit is contained in:
parent
367d13a7dd
commit
978328712b
1 changed files with 6 additions and 4 deletions
|
|
@ -111,6 +111,10 @@ function handle_generic(t, option, value)
|
|||
if not value[2] then io.stderr:write(string.format("Warning: ignoring invalid option '%s'\n", value[1])) return end
|
||||
t[option] = value[2]
|
||||
end
|
||||
function handle_generic_unquote(t, option, value)
|
||||
if not value[2] then io.stderr:write(string.format("Warning: ignoring invalid option '%s'\n", value[1])) return end
|
||||
t[option] = unquote(value[2])
|
||||
end
|
||||
function handle_number(t, option, value)
|
||||
if not value[2] then io.stderr:write(string.format("Warning: ignoring invalid option '%s'\n", value[1])) return end
|
||||
if not tonumber(value[2]) then
|
||||
|
|
@ -195,9 +199,6 @@ function handle_secret(t, option, value)
|
|||
t[option[2]] = value[3]
|
||||
g_switches[value[1]]= true
|
||||
end
|
||||
function handle_tls_remote(t, option, value)
|
||||
t[option] = unquote(value[2])
|
||||
end
|
||||
function handle_remote_cert_tls(t, option, value)
|
||||
if value[2] ~= "client" and value[2] ~= "server" then
|
||||
io.stderr:write(string.format("Warning: ignoring invalid option '%s'\n", value[1]))
|
||||
|
|
@ -254,12 +255,13 @@ vpn2nm = {
|
|||
["secret"] = { nm_opt={"static-key", "static-key-direction"}, func=handle_secret, tbl=g_vpn_data },
|
||||
["tls-auth"] = { nm_opt={"ta", "ta-dir"}, func=handle_secret, tbl=g_vpn_data },
|
||||
["tls-client"] = { nm_opt="client", func=set_bool, tbl={} },
|
||||
["tls-remote"] = { nm_opt="tls-remote", func=handle_tls_remote, tbl=g_vpn_data },
|
||||
["tls-remote"] = { nm_opt="tls-remote", func=handle_generic_unquote, tbl=g_vpn_data },
|
||||
["remote-cert-tls"] = { nm_opt="remote-cert-tls", func=handle_remote_cert_tls, tbl=g_vpn_data },
|
||||
["tun-mtu"] = { nm_opt="tunnel-mtu", func=handle_generic, tbl=g_vpn_data },
|
||||
["tun-ipv6"] = { nm_opt="tun-ipv6", func=handle_yes, tbl=g_vpn_data },
|
||||
["route"] = { nm_opt="routes", func=handle_routes, tbl=g_ip4_data },
|
||||
["max-routes"] = { nm_opt="max-routes", func=handle_number, tbl=g_vpn_data },
|
||||
["tls-cipher"] = { nm_opt="tls-cipher", func=handle_generic_unquote, tbl=g_vpn_data },
|
||||
}
|
||||
|
||||
------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue