[NetworkManager-libreswan/4-add-prefix-_key-to-the-libreswan-key-defines] all: add "_KEY" to the prefix of the libreswan key defines
- From: Francesco Giudici <fgiudici src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [NetworkManager-libreswan/4-add-prefix-_key-to-the-libreswan-key-defines] all: add "_KEY" to the prefix of the libreswan key defines
- Date: Wed, 12 Sep 2018 11:54:36 +0000 (UTC)
commit 94bc845704bee481ad6c9379b1a674489e306c36
Author: Francesco Giudici <fgiudici redhat com>
Date: Mon Sep 3 17:46:23 2018 +0200
all: add "_KEY" to the prefix of the libreswan key defines
https://gitlab.gnome.org/GNOME/NetworkManager-libreswan/issues/4
https://gitlab.gnome.org/GNOME/NetworkManager-libreswan/merge_requests/6
auth-dialog/main.c | 28 +++++------
properties/nm-libreswan-editor-plugin.c | 18 +++----
properties/nm-libreswan-editor.c | 74 ++++++++++++++--------------
shared/nm-service-defines.h | 54 ++++++++++-----------
shared/utils.c | 36 +++++++-------
shared/utils.h | 2 +-
src/nm-libreswan-service.c | 86 ++++++++++++++++-----------------
7 files changed, 149 insertions(+), 149 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 8ad4825..d02f2b9 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -177,7 +177,7 @@ eui_finish (const char *vpn_name,
if (need_password || existing_password || retry) {
show = (need_password && !existing_password) || retry;
keyfile_add_entry_info (keyfile,
- NM_LIBRESWAN_XAUTH_PASSWORD,
+ NM_LIBRESWAN_KEY_XAUTH_PASSWORD,
existing_password ? existing_password : "",
_("Password:"),
TRUE,
@@ -187,7 +187,7 @@ eui_finish (const char *vpn_name,
if (need_group_password || existing_group_password || retry) {
show = (need_group_password && !existing_group_password) || retry;
keyfile_add_entry_info (keyfile,
- NM_LIBRESWAN_PSK_VALUE,
+ NM_LIBRESWAN_KEY_PSK_VALUE,
existing_group_password ? existing_group_password : "",
_("Group Password:"),
TRUE,
@@ -288,9 +288,9 @@ std_finish (const char *vpn_name,
{
/* Send the passwords back to our parent */
if (password)
- printf ("%s\n%s\n", NM_LIBRESWAN_XAUTH_PASSWORD, password);
+ printf ("%s\n%s\n", NM_LIBRESWAN_KEY_XAUTH_PASSWORD, password);
if (group_password)
- printf ("%s\n%s\n", NM_LIBRESWAN_PSK_VALUE, group_password);
+ printf ("%s\n%s\n", NM_LIBRESWAN_KEY_PSK_VALUE, group_password);
printf ("\n\n");
/* for good measure, flush stdout since Kansas is going Bye-Bye */
@@ -342,20 +342,20 @@ get_existing_passwords (GHashTable *vpn_data,
g_return_if_fail (out_group_password != NULL);
if (need_password) {
- upw_flags = get_pw_flags (existing_secrets, NM_LIBRESWAN_XAUTH_PASSWORD,
NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES);
+ upw_flags = get_pw_flags (existing_secrets, NM_LIBRESWAN_KEY_XAUTH_PASSWORD,
NM_LIBRESWAN_KEY_XAUTH_PASSWORD_INPUT_MODES);
if (!(upw_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED)) {
- *out_password = g_strdup (g_hash_table_lookup (existing_secrets,
NM_LIBRESWAN_XAUTH_PASSWORD));
+ *out_password = g_strdup (g_hash_table_lookup (existing_secrets,
NM_LIBRESWAN_KEY_XAUTH_PASSWORD));
if (!*out_password)
- *out_password = keyring_lookup_secret (vpn_uuid, NM_LIBRESWAN_XAUTH_PASSWORD);
+ *out_password = keyring_lookup_secret (vpn_uuid,
NM_LIBRESWAN_KEY_XAUTH_PASSWORD);
}
}
if (need_group_password) {
- gpw_flags = get_pw_flags (existing_secrets, NM_LIBRESWAN_PSK_VALUE,
NM_LIBRESWAN_PSK_INPUT_MODES);
+ gpw_flags = get_pw_flags (existing_secrets, NM_LIBRESWAN_KEY_PSK_VALUE,
NM_LIBRESWAN_KEY_PSK_INPUT_MODES);
if (!(gpw_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED)) {
- *out_group_password = g_strdup (g_hash_table_lookup (existing_secrets,
NM_LIBRESWAN_PSK_VALUE));
+ *out_group_password = g_strdup (g_hash_table_lookup (existing_secrets,
NM_LIBRESWAN_KEY_PSK_VALUE));
if (!*out_group_password)
- *out_group_password = keyring_lookup_secret (vpn_uuid,
NM_LIBRESWAN_PSK_VALUE);
+ *out_group_password = keyring_lookup_secret (vpn_uuid,
NM_LIBRESWAN_KEY_PSK_VALUE);
}
}
}
@@ -377,21 +377,21 @@ get_passwords_required (GHashTable *data,
for (iter = hints; iter && *iter; iter++) {
if (!prompt && g_str_has_prefix (*iter, VPN_MSG_TAG))
prompt = g_strdup (*iter + strlen (VPN_MSG_TAG));
- else if (strcmp (*iter, NM_LIBRESWAN_XAUTH_PASSWORD) == 0)
+ else if (strcmp (*iter, NM_LIBRESWAN_KEY_XAUTH_PASSWORD) == 0)
*out_need_password = TRUE;
- else if (strcmp (*iter, NM_LIBRESWAN_PSK_VALUE) == 0)
+ else if (strcmp (*iter, NM_LIBRESWAN_KEY_PSK_VALUE) == 0)
*out_need_group_password = TRUE;
}
return prompt;
}
/* User password (XAuth password) */
- flags = get_pw_flags (data, NM_LIBRESWAN_XAUTH_PASSWORD, NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES);
+ flags = get_pw_flags (data, NM_LIBRESWAN_KEY_XAUTH_PASSWORD,
NM_LIBRESWAN_KEY_XAUTH_PASSWORD_INPUT_MODES);
if (!(flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED))
*out_need_password = TRUE;
/* Group password (IPsec secret) */
- flags = get_pw_flags (data, NM_LIBRESWAN_PSK_VALUE, NM_LIBRESWAN_PSK_INPUT_MODES);
+ flags = get_pw_flags (data, NM_LIBRESWAN_KEY_PSK_VALUE, NM_LIBRESWAN_KEY_PSK_INPUT_MODES);
if (!(flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED))
*out_need_group_password = TRUE;
diff --git a/properties/nm-libreswan-editor-plugin.c b/properties/nm-libreswan-editor-plugin.c
index 3dd7c80..77f4418 100644
--- a/properties/nm-libreswan-editor-plugin.c
+++ b/properties/nm-libreswan-editor-plugin.c
@@ -102,25 +102,25 @@ import_from_file (NMVpnEditorPlugin *self,
g_object_set (s_con, NM_SETTING_CONNECTION_ID, &str[5], NULL);
}
else if (g_str_has_prefix (str, "leftid=@"))
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_LEFTID, &str[8]);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTID, &str[8]);
else if (g_str_has_prefix (str, "leftxauthusername="))
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_LEFTXAUTHUSER, &str[18]);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTXAUTHUSER, &str[18]);
else if (g_str_has_prefix (str, "right="))
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_RIGHT, &str[6]);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_RIGHT, &str[6]);
else if (g_str_has_prefix (str, "ike=") && strcmp (str, "ike=aes-sha1"))
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_IKE, &str[4]);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_IKE, &str[4]);
else if (g_str_has_prefix (str, "esp=") && strcmp (str, "esp=aes-sha1;modp1024"))
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_ESP, &str[4]);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_ESP, &str[4]);
else if (g_str_has_prefix (str, "cisco-unity=yes"))
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_VENDOR, "Cisco");
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_VENDOR, "Cisco");
else if (g_str_has_prefix (str, "ikelifetime="))
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_IKELIFETIME,
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_IKELIFETIME,
&str[12]);
else if (g_str_has_prefix (str, "salifetime="))
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_SALIFETIME,
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_SALIFETIME,
&str[11]);
else if (g_str_has_prefix (str, "rightsubnet="))
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_REMOTENETWORK,
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_REMOTENETWORK,
&str[12]);
else {
/* unknown tokens are silently ignored. */
diff --git a/properties/nm-libreswan-editor.c b/properties/nm-libreswan-editor.c
index 51b5198..8c91e50 100644
--- a/properties/nm-libreswan-editor.c
+++ b/properties/nm-libreswan-editor.c
@@ -73,7 +73,7 @@ check_validity (LibreswanEditor *self, GError **error)
g_set_error (error,
NMV_EDITOR_PLUGIN_ERROR,
NMV_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
- NM_LIBRESWAN_RIGHT);
+ NM_LIBRESWAN_KEY_RIGHT);
return FALSE;
}
@@ -87,7 +87,7 @@ check_validity (LibreswanEditor *self, GError **error)
g_set_error (error,
NMV_EDITOR_PLUGIN_ERROR,
NMV_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
- NM_LIBRESWAN_LEFTCERT);
+ NM_LIBRESWAN_KEY_LEFTCERT);
return FALSE;
}
}
@@ -262,7 +262,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_RIGHT);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_RIGHT);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -272,7 +272,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- ikev2 = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_IKEV2);
+ ikev2 = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_IKEV2);
if (NM_IN_STRSET (ikev2,
NM_LIBRESWAN_IKEV2_YES,
NM_LIBRESWAN_IKEV2_PROPOSE,
@@ -289,7 +289,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTID);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTID);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -301,30 +301,30 @@ init_editor_plugin (LibreswanEditor *self,
setup_password_widget (self,
"user_password_entry",
s_vpn,
- NM_LIBRESWAN_XAUTH_PASSWORD,
+ NM_LIBRESWAN_KEY_XAUTH_PASSWORD,
new_connection);
setup_password_widget (self,
"group_password_entry",
s_vpn,
- NM_LIBRESWAN_PSK_VALUE,
+ NM_LIBRESWAN_KEY_PSK_VALUE,
new_connection);
init_password_icon (self,
s_vpn,
- NM_LIBRESWAN_XAUTH_PASSWORD,
- NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES,
+ NM_LIBRESWAN_KEY_XAUTH_PASSWORD,
+ NM_LIBRESWAN_KEY_XAUTH_PASSWORD_INPUT_MODES,
"user_password_entry");
init_password_icon (self,
s_vpn,
- NM_LIBRESWAN_PSK_VALUE,
- NM_LIBRESWAN_PSK_INPUT_MODES,
+ NM_LIBRESWAN_KEY_PSK_VALUE,
+ NM_LIBRESWAN_KEY_PSK_INPUT_MODES,
"group_password_entry");
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_entry"));
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTXAUTHUSER);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTXAUTHUSER);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -334,7 +334,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTCERT);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTCERT);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -344,7 +344,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_RIGHTID);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_RIGHTID);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -355,7 +355,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_IKE);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_IKE);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -366,7 +366,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_ESP);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_ESP);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -378,7 +378,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_IKELIFETIME);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_IKELIFETIME);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -391,7 +391,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_SALIFETIME);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_SALIFETIME);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -402,7 +402,7 @@ init_editor_plugin (LibreswanEditor *self,
g_return_val_if_fail (widget != NULL, FALSE);
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
- value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_DOMAIN);
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_DOMAIN);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -421,7 +421,7 @@ init_editor_plugin (LibreswanEditor *self,
gtk_size_group_add_widget (priv->group, GTK_WIDGET (widget));
if (s_vpn) {
value = nm_setting_vpn_get_data_item (s_vpn,
- NM_LIBRESWAN_REMOTENETWORK);
+ NM_LIBRESWAN_KEY_REMOTENETWORK);
if (value && *value)
gtk_entry_set_text (GTK_ENTRY (widget), value);
}
@@ -500,31 +500,31 @@ update_connection (NMVpnEditor *iface,
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "gateway_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_RIGHT, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_RIGHT, str);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "type_combo"));
contype = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
switch (contype) {
case TYPE_IKEV2_CERT:
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_IKEV2, NM_LIBRESWAN_IKEV2_INSIST);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_IKEV2, NM_LIBRESWAN_IKEV2_INSIST);
/* Certificate name */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "cert_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_LEFTCERT, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTCERT, str);
/* Remote ID */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "remoteid_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_RIGHTID, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_RIGHTID, str);
/* For now just enforce retrieving the local id from the certificate.
* We will allow to change this when we will refactore the "advanced"
* section and will expose the "leftid" parameter there.
*/
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_LEFTID, "%fromcert");
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTID, "%fromcert");
break;
@@ -533,24 +533,24 @@ update_connection (NMVpnEditor *iface,
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "group_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_LEFTID, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTID, str);
/* User name*/
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_LEFTXAUTHUSER, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTXAUTHUSER, str);
save_one_password (s_vpn,
priv->builder,
"user_password_entry",
- NM_LIBRESWAN_XAUTH_PASSWORD,
- NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES);
+ NM_LIBRESWAN_KEY_XAUTH_PASSWORD,
+ NM_LIBRESWAN_KEY_XAUTH_PASSWORD_INPUT_MODES);
save_one_password (s_vpn,
priv->builder,
"group_password_entry",
- NM_LIBRESWAN_PSK_VALUE,
- NM_LIBRESWAN_PSK_INPUT_MODES);
+ NM_LIBRESWAN_KEY_PSK_VALUE,
+ NM_LIBRESWAN_KEY_PSK_INPUT_MODES);
break;
default:
g_assert_not_reached ();
@@ -561,40 +561,40 @@ update_connection (NMVpnEditor *iface,
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "phase1_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_IKE, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_IKE, str);
/* Phase 2 Algorithms: esp */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "phase2_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_ESP, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_ESP, str);
/* Phase 1 Lifetime: ike */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
"phase1_lifetime_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_IKELIFETIME, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_IKELIFETIME, str);
/* Phase 2 Lifetime: sa */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
"phase2_lifetime_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_SALIFETIME, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_SALIFETIME, str);
/* Domain entry */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "domain_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_DOMAIN, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_DOMAIN, str);
/* Remote Network */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
"remote_network_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && *str)
- nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_REMOTENETWORK, str);
+ nm_setting_vpn_add_data_item (s_vpn, NM_LIBRESWAN_KEY_REMOTENETWORK, str);
nm_connection_add_setting (connection, NM_SETTING (s_vpn));
return TRUE;
diff --git a/shared/nm-service-defines.h b/shared/nm-service-defines.h
index bdfff74..06b6ff1 100644
--- a/shared/nm-service-defines.h
+++ b/shared/nm-service-defines.h
@@ -34,33 +34,33 @@
#define NM_LIBRESWAN_HELPER_PATH LIBEXECDIR"/nm-libreswan-service-helper"
-#define NM_LIBRESWAN_RIGHT "right"
-#define NM_LIBRESWAN_RIGHTID "rightid"
-#define NM_LIBRESWAN_RIGHTRSASIGKEY "rightrsasigkey"
-#define NM_LIBRESWAN_LEFT "left"
-#define NM_LIBRESWAN_LEFTID "leftid"
-#define NM_LIBRESWAN_LEFTRSASIGKEY "leftrsasigkey"
-#define NM_LIBRESWAN_LEFTCERT "leftcert"
-#define NM_LIBRESWAN_PSK_VALUE "pskvalue"
-#define NM_LIBRESWAN_PSK_INPUT_MODES "pskinputmodes"
-#define NM_LIBRESWAN_LEFTXAUTHUSER "leftxauthusername"
-#define NM_LIBRESWAN_XAUTH_PASSWORD "xauthpassword"
-#define NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES "xauthpasswordinputmodes"
-#define NM_LIBRESWAN_DOMAIN "Domain"
-#define NM_LIBRESWAN_DHGROUP "dhgroup"
-#define NM_LIBRESWAN_PFSGROUP "pfsgroup"
-#define NM_LIBRESWAN_DPDTIMEOUT "dpdtimeout"
-#define NM_LIBRESWAN_IKE "ike"
-#define NM_LIBRESWAN_ESP "esp"
-#define NM_LIBRESWAN_IKELIFETIME "ikelifetime"
-#define NM_LIBRESWAN_SALIFETIME "salifetime"
-#define NM_LIBRESWAN_VENDOR "vendor"
-#define NM_LIBRESWAN_REMOTENETWORK "rightsubnet"
-#define NM_LIBRESWAN_IKEV2 "ikev2"
-#define NM_LIBRESWAN_NARROWING "narrowing"
-#define NM_LIBRESWAN_REKEY "rekey"
-#define NM_LIBRESWAN_FRAGMENTATION "fragmentation"
-#define NM_LIBRESWAN_MOBIKE "mobike"
+#define NM_LIBRESWAN_KEY_RIGHT "right"
+#define NM_LIBRESWAN_KEY_RIGHTID "rightid"
+#define NM_LIBRESWAN_KEY_RIGHTRSASIGKEY "rightrsasigkey"
+#define NM_LIBRESWAN_KEY_LEFT "left"
+#define NM_LIBRESWAN_KEY_LEFTID "leftid"
+#define NM_LIBRESWAN_KEY_LEFTRSASIGKEY "leftrsasigkey"
+#define NM_LIBRESWAN_KEY_LEFTCERT "leftcert"
+#define NM_LIBRESWAN_KEY_PSK_VALUE "pskvalue"
+#define NM_LIBRESWAN_KEY_PSK_INPUT_MODES "pskinputmodes"
+#define NM_LIBRESWAN_KEY_LEFTXAUTHUSER "leftxauthusername"
+#define NM_LIBRESWAN_KEY_XAUTH_PASSWORD "xauthpassword"
+#define NM_LIBRESWAN_KEY_XAUTH_PASSWORD_INPUT_MODES "xauthpasswordinputmodes"
+#define NM_LIBRESWAN_KEY_DOMAIN "Domain"
+#define NM_LIBRESWAN_KEY_DHGROUP "dhgroup"
+#define NM_LIBRESWAN_KEY_PFSGROUP "pfsgroup"
+#define NM_LIBRESWAN_KEY_DPDTIMEOUT "dpdtimeout"
+#define NM_LIBRESWAN_KEY_IKE "ike"
+#define NM_LIBRESWAN_KEY_ESP "esp"
+#define NM_LIBRESWAN_KEY_IKELIFETIME "ikelifetime"
+#define NM_LIBRESWAN_KEY_SALIFETIME "salifetime"
+#define NM_LIBRESWAN_KEY_VENDOR "vendor"
+#define NM_LIBRESWAN_KEY_REMOTENETWORK "rightsubnet"
+#define NM_LIBRESWAN_KEY_IKEV2 "ikev2"
+#define NM_LIBRESWAN_KEY_NARROWING "narrowing"
+#define NM_LIBRESWAN_KEY_REKEY "rekey"
+#define NM_LIBRESWAN_KEY_FRAGMENTATION "fragmentation"
+#define NM_LIBRESWAN_KEY_MOBIKE "mobike"
#define NM_LIBRESWAN_IKEV2_NO "no"
#define NM_LIBRESWAN_IKEV2_NEVER "never"
diff --git a/shared/utils.c b/shared/utils.c
index 00eab35..74916b0 100644
--- a/shared/utils.c
+++ b/shared/utils.c
@@ -137,7 +137,7 @@ nm_libreswan_config_write (gint fd,
if (!ikev2)
ikev2 = NM_LIBRESWAN_IKEV2_NEVER;
- leftid = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTID);
+ leftid = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTID);
#define WRITE_CHECK_NEWLINE(fd, new_line, debug_write_fcn, error, ...) \
G_STMT_START { \
@@ -156,9 +156,9 @@ nm_libreswan_config_write (gint fd,
leftid);
}
- leftrsasigkey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTRSASIGKEY);
- rightrsasigkey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_RIGHTRSASIGKEY);
- leftcert = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTCERT);
+ leftrsasigkey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTRSASIGKEY);
+ rightrsasigkey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_RIGHTRSASIGKEY);
+ leftcert = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTCERT);
if (leftcert && strlen (leftcert)) {
WRITE_CHECK (fd, debug_write_fcn, error, " leftcert=%s", leftcert);
if (!leftrsasigkey)
@@ -175,7 +175,7 @@ nm_libreswan_config_write (gint fd,
WRITE_CHECK (fd, debug_write_fcn, error, " authby=secret");
}
- left = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFT);
+ left = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFT);
if (left && strlen (left))
WRITE_CHECK (fd, debug_write_fcn, error, " left=%s", left);
else
@@ -185,15 +185,15 @@ nm_libreswan_config_write (gint fd,
if (leftupdown_script)
WRITE_CHECK (fd, debug_write_fcn, error, " leftupdown=%s", leftupdown_script);
- WRITE_CHECK (fd, debug_write_fcn, error, " right=%s", nm_setting_vpn_get_data_item (s_vpn,
NM_LIBRESWAN_RIGHT));
- rightid = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_RIGHTID);
+ WRITE_CHECK (fd, debug_write_fcn, error, " right=%s", nm_setting_vpn_get_data_item (s_vpn,
NM_LIBRESWAN_KEY_RIGHT));
+ rightid = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_RIGHTID);
if (rightid && strlen (rightid))
WRITE_CHECK (fd, debug_write_fcn, error, " rightid=%s", rightid);
WRITE_CHECK (fd, debug_write_fcn, error, " rightmodecfgserver=yes");
WRITE_CHECK (fd, debug_write_fcn, error, " modecfgpull=yes");
remote_network = nm_setting_vpn_get_data_item (s_vpn,
- NM_LIBRESWAN_REMOTENETWORK);
+ NM_LIBRESWAN_KEY_REMOTENETWORK);
if (!remote_network || !strlen (remote_network))
WRITE_CHECK (fd, debug_write_fcn, error, " rightsubnet=0.0.0.0/0");
else
@@ -203,7 +203,7 @@ nm_libreswan_config_write (gint fd,
WRITE_CHECK (fd, debug_write_fcn, error, " leftxauthclient=yes");
default_username = nm_setting_vpn_get_user_name (s_vpn);
- props_username = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTXAUTHUSER);
+ props_username = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTXAUTHUSER);
if (props_username && strlen (props_username))
WRITE_CHECK (fd, debug_write_fcn, error, " leftxauthusername=%s", props_username);
else if (default_username && strlen (default_username))
@@ -214,7 +214,7 @@ nm_libreswan_config_write (gint fd,
}
- phase1_alg_str = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_IKE);
+ phase1_alg_str = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_IKE);
/* When the crypto is unspecified, let Libreswan use many sets of crypto
* proposals (just leave the property unset). An exception should be made
* for IKEv1 connections in aggressive mode: there the DH group in the crypto
@@ -228,47 +228,47 @@ nm_libreswan_config_write (gint fd,
else if (xauth_enabled && leftid)
WRITE_CHECK (fd, debug_write_fcn, error, " ike=aes256-sha1;modp1536");
- phase2_alg_str = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_ESP);
+ phase2_alg_str = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_ESP);
if (phase2_alg_str && strlen (phase2_alg_str))
WRITE_CHECK (fd, debug_write_fcn, error, " phase2alg=%s", phase2_alg_str);
else if (xauth_enabled && leftid)
WRITE_CHECK (fd, debug_write_fcn, error, " phase2alg=aes256-sha1");
phase1_lifetime_str = nm_setting_vpn_get_data_item (s_vpn,
- NM_LIBRESWAN_IKELIFETIME);
+ NM_LIBRESWAN_KEY_IKELIFETIME);
if (phase1_lifetime_str && strlen (phase1_lifetime_str))
WRITE_CHECK (fd, debug_write_fcn, error, " ikelifetime=%s", phase1_lifetime_str);
else if (!is_ikev2)
WRITE_CHECK (fd, debug_write_fcn, error, " ikelifetime=24h");
phase2_lifetime_str = nm_setting_vpn_get_data_item (s_vpn,
- NM_LIBRESWAN_SALIFETIME);
+ NM_LIBRESWAN_KEY_SALIFETIME);
if (phase2_lifetime_str && strlen (phase2_lifetime_str))
WRITE_CHECK (fd, debug_write_fcn, error, " salifetime=%s", phase2_lifetime_str);
else if (!is_ikev2)
WRITE_CHECK (fd, debug_write_fcn, error, " salifetime=24h");
- rekey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_REKEY);
+ rekey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_REKEY);
if (!rekey || !strlen (rekey)) {
WRITE_CHECK (fd, debug_write_fcn, error, " rekey=yes");
WRITE_CHECK (fd, debug_write_fcn, error, " keyingtries=1");
} else
WRITE_CHECK (fd, debug_write_fcn, error, " rekey=%s", rekey);
- if (!openswan && g_strcmp0 (nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_VENDOR), "Cisco") == 0)
+ if (!openswan && g_strcmp0 (nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_VENDOR), "Cisco")
== 0)
WRITE_CHECK (fd, debug_write_fcn, error, " cisco-unity=yes");
WRITE_CHECK (fd, debug_write_fcn, error, " ikev2=%s", ikev2);
- narrowing = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_NARROWING);
+ narrowing = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_NARROWING);
if (narrowing && strlen (narrowing))
WRITE_CHECK (fd, debug_write_fcn, error, " narrowing=%s", narrowing);
- fragmentation = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_FRAGMENTATION);
+ fragmentation = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_FRAGMENTATION);
if (fragmentation && strlen (fragmentation))
WRITE_CHECK (fd, debug_write_fcn, error, " fragmentation=%s", fragmentation);
- mobike = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_MOBIKE);
+ mobike = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_MOBIKE);
if (mobike && strlen (mobike))
WRITE_CHECK (fd, debug_write_fcn, error, " mobike=%s", mobike);
diff --git a/shared/utils.h b/shared/utils.h
index ca69b1f..b5d8f53 100644
--- a/shared/utils.h
+++ b/shared/utils.h
@@ -50,7 +50,7 @@ nm_libreswan_utils_setting_is_ikev2 (NMSettingVpn *s_vpn, const char **out_ikev2
{
const char *ikev2;
- ikev2 = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_IKEV2);
+ ikev2 = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_IKEV2);
if (ikev2 && strlen (ikev2) && out_ikev2)
*out_ikev2 = ikev2;
diff --git a/src/nm-libreswan-service.c b/src/nm-libreswan-service.c
index 5b2eced..b18cfdb 100644
--- a/src/nm-libreswan-service.c
+++ b/src/nm-libreswan-service.c
@@ -248,40 +248,40 @@ typedef struct {
} ValidProperty;
static ValidProperty valid_properties[] = {
- { NM_LIBRESWAN_RIGHT, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_RIGHTID, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_RIGHTRSASIGKEY, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_LEFT, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_LEFTID, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_LEFTXAUTHUSER, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_LEFTRSASIGKEY, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_LEFTCERT, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_DOMAIN, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_DHGROUP, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_PFSGROUP, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_DPDTIMEOUT, G_TYPE_INT, 0, 86400 },
- { NM_LIBRESWAN_IKE, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_ESP, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_IKELIFETIME, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_SALIFETIME, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_VENDOR, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_REMOTENETWORK, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_IKEV2, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_NARROWING, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_REKEY, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_FRAGMENTATION, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_MOBIKE, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_RIGHT, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_RIGHTID, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_RIGHTRSASIGKEY, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_LEFT, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_LEFTID, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_LEFTXAUTHUSER, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_LEFTRSASIGKEY, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_LEFTCERT, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_DOMAIN, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_DHGROUP, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_PFSGROUP, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_DPDTIMEOUT, G_TYPE_INT, 0, 86400 },
+ { NM_LIBRESWAN_KEY_IKE, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_ESP, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_IKELIFETIME, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_SALIFETIME, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_VENDOR, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_REMOTENETWORK, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_IKEV2, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_NARROWING, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_REKEY, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_FRAGMENTATION, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_MOBIKE, G_TYPE_STRING, 0, 0 },
/* Ignored option for internal use */
- { NM_LIBRESWAN_PSK_INPUT_MODES, G_TYPE_NONE, 0, 0 },
- { NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES, G_TYPE_NONE, 0, 0 },
- { NM_LIBRESWAN_PSK_VALUE "-flags", G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_XAUTH_PASSWORD "-flags", G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_PSK_INPUT_MODES, G_TYPE_NONE, 0, 0 },
+ { NM_LIBRESWAN_KEY_XAUTH_PASSWORD_INPUT_MODES, G_TYPE_NONE, 0, 0 },
+ { NM_LIBRESWAN_KEY_PSK_VALUE "-flags", G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_XAUTH_PASSWORD "-flags", G_TYPE_STRING, 0, 0 },
{ NULL, G_TYPE_NONE, 0, 0 }
};
static ValidProperty valid_secrets[] = {
- { NM_LIBRESWAN_PSK_VALUE, G_TYPE_STRING, 0, 0 },
- { NM_LIBRESWAN_XAUTH_PASSWORD, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_PSK_VALUE, G_TYPE_STRING, 0, 0 },
+ { NM_LIBRESWAN_KEY_XAUTH_PASSWORD, G_TYPE_STRING, 0, 0 },
{ NULL, G_TYPE_NONE, 0, 0 }
};
@@ -730,11 +730,11 @@ nm_libreswan_config_psk_write (NMSettingVpn *s_vpn,
gboolean success;
/* Check for ignored group password */
- pw_type = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_PSK_INPUT_MODES);
+ pw_type = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_PSK_INPUT_MODES);
if (pw_type && !strcmp (pw_type, NM_LIBRESWAN_PW_TYPE_UNUSED))
return TRUE;
- psk = nm_setting_vpn_get_secret (s_vpn, NM_LIBRESWAN_PSK_VALUE);
+ psk = nm_setting_vpn_get_secret (s_vpn, NM_LIBRESWAN_KEY_PSK_VALUE);
if (!psk)
return TRUE;
@@ -765,11 +765,11 @@ nm_libreswan_config_psk_write (NMSettingVpn *s_vpn,
return FALSE;
}
- leftid = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTID);
+ leftid = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTID);
if (leftid) {
success = write_config_option (fd, NULL, error, "@%s: PSK \"%s\"", leftid, psk);
} else {
- right = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_RIGHT);
+ right = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_RIGHT);
g_assert (right);
success = write_config_option (fd, NULL, error, "%s %%any: PSK \"%s\"", right, psk);
}
@@ -1459,7 +1459,7 @@ handle_auth (NMLibreswanPlugin *self, const char **out_message, const char **out
g_free (priv->password);
priv->password = NULL;
} else {
- *out_hint = NM_LIBRESWAN_XAUTH_PASSWORD;
+ *out_hint = NM_LIBRESWAN_KEY_XAUTH_PASSWORD;
*out_message = _("A password is required.");
}
@@ -1761,7 +1761,7 @@ _connect_common (NMVpnServicePlugin *plugin,
priv->xauth_enabled = !nm_libreswan_utils_setting_is_ikev2 (s_vpn, NULL);
if (priv->xauth_enabled)
- priv->password = g_strdup (nm_setting_vpn_get_secret (s_vpn, NM_LIBRESWAN_XAUTH_PASSWORD));
+ priv->password = g_strdup (nm_setting_vpn_get_secret (s_vpn,
NM_LIBRESWAN_KEY_XAUTH_PASSWORD));
/* Write the IPsec secret (group password); *SWAN always requires this and
* doesn't ask for it interactively.
@@ -1822,19 +1822,19 @@ real_need_secrets (NMVpnServicePlugin *plugin,
}
/* When leftcert is specified, rsasigkey are assumed to be '%cert' */
- leftcert = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTCERT);
+ leftcert = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTCERT);
if (leftcert)
goto xauth_check;
/* If authentication is done through rsasigkeys, only the public keys are required */
- leftrsasigkey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_LEFTRSASIGKEY);
- rightrsasigkey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_RIGHTRSASIGKEY);
+ leftrsasigkey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_LEFTRSASIGKEY);
+ rightrsasigkey = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_RIGHTRSASIGKEY);
if (leftrsasigkey && rightrsasigkey)
goto xauth_check;
- pw_type = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_PSK_INPUT_MODES);
+ pw_type = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_PSK_INPUT_MODES);
if (!pw_type || strcmp (pw_type, NM_LIBRESWAN_PW_TYPE_UNUSED)) {
- if (!nm_setting_vpn_get_secret (s_vpn, NM_LIBRESWAN_PSK_VALUE)) {
+ if (!nm_setting_vpn_get_secret (s_vpn, NM_LIBRESWAN_KEY_PSK_VALUE)) {
*setting_name = NM_SETTING_VPN_SETTING_NAME;
return TRUE;
}
@@ -1842,9 +1842,9 @@ real_need_secrets (NMVpnServicePlugin *plugin,
xauth_check:
if (!nm_libreswan_utils_setting_is_ikev2 (s_vpn, NULL)) {
- pw_type = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES);
+ pw_type = nm_setting_vpn_get_data_item (s_vpn, NM_LIBRESWAN_KEY_XAUTH_PASSWORD_INPUT_MODES);
if (!pw_type || strcmp (pw_type, NM_LIBRESWAN_PW_TYPE_UNUSED)) {
- if (!nm_setting_vpn_get_secret (s_vpn, NM_LIBRESWAN_XAUTH_PASSWORD)) {
+ if (!nm_setting_vpn_get_secret (s_vpn, NM_LIBRESWAN_KEY_XAUTH_PASSWORD)) {
*setting_name = NM_SETTING_VPN_SETTING_NAME;
return TRUE;
}
@@ -1877,7 +1877,7 @@ real_new_secrets (NMVpnServicePlugin *plugin,
_LOGD ("VPN received new secrets; sending to ipsec");
g_free (priv->password);
- priv->password = g_strdup (nm_setting_vpn_get_secret (s_vpn, NM_LIBRESWAN_XAUTH_PASSWORD));
+ priv->password = g_strdup (nm_setting_vpn_get_secret (s_vpn, NM_LIBRESWAN_KEY_XAUTH_PASSWORD));
g_warn_if_fail (priv->pending_auth);
if (!handle_auth (self, &message, &hints[0])) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]