|
39 | 39 | #include "nm-ppp-status.h" |
40 | 40 | #include "nm-l2tp-pppd-service-dbus.h" |
41 | 41 | #include "nm-utils/nm-shared-utils.h" |
| 42 | +#include "nm-utils/nm-secret-utils.h" |
42 | 43 | #include "nm-utils/nm-vpn-plugin-macros.h" |
43 | 44 | #include "shared/utils.h" |
44 | 45 | #include "nm-l2tp-crypto-nss.h" |
@@ -183,6 +184,8 @@ static const ValidProperty valid_properties[] = { |
183 | 184 | { NM_L2TP_KEY_IPSEC_ENABLE, G_TYPE_BOOLEAN, FALSE }, |
184 | 185 | { NM_L2TP_KEY_IPSEC_REMOTE_ID, G_TYPE_STRING, FALSE }, |
185 | 186 | { NM_L2TP_KEY_IPSEC_GATEWAY_ID, G_TYPE_STRING, FALSE }, |
| 187 | + /* For legacy purposes, the PSK can also be specified as a non-secret */ |
| 188 | + { NM_L2TP_KEY_IPSEC_PSK, G_TYPE_STRING, FALSE }, |
186 | 189 | { NM_L2TP_KEY_IPSEC_IKE, G_TYPE_STRING, FALSE }, |
187 | 190 | { NM_L2TP_KEY_IPSEC_ESP, G_TYPE_STRING, FALSE }, |
188 | 191 | { NM_L2TP_KEY_IPSEC_IKELIFETIME, G_TYPE_UINT, FALSE }, |
@@ -747,7 +750,7 @@ nm_l2tp_config_write (NML2tpPlugin *plugin, |
747 | 750 | } |
748 | 751 | } |
749 | 752 |
|
750 | | - value = nm_setting_vpn_get_secret (s_vpn, NM_L2TP_KEY_IPSEC_PSK); |
| 753 | + value = nm_setting_vpn_get_secret_or_legacy_data_item (s_vpn, NM_L2TP_KEY_IPSEC_PSK); |
751 | 754 | if (!value) value=""; |
752 | 755 |
|
753 | 756 | if (g_str_has_prefix (value, "0s")) { |
@@ -1966,7 +1969,7 @@ real_need_secrets (NMVpnServicePlugin *plugin, |
1966 | 1969 | need_secrets = TRUE; |
1967 | 1970 |
|
1968 | 1971 | /* Don't need the PSK if we already have one */ |
1969 | | - if (need_secrets && nm_setting_vpn_get_secret (NM_SETTING_VPN (s_vpn), NM_L2TP_KEY_IPSEC_PSK)) { |
| 1972 | + if (need_secrets && nm_setting_vpn_get_secret_or_legacy_data_item (NM_SETTING_VPN (s_vpn), NM_L2TP_KEY_IPSEC_PSK)) { |
1970 | 1973 | need_secrets = FALSE; |
1971 | 1974 | } |
1972 | 1975 | } |
|
0 commit comments