1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
From f24d6e26f81e205769cecf0dae7e6cf90b23f9e9 Mon Sep 17 00:00:00 2001
Message-Id: <f24d6e26f81e205769cecf0dae7e6cf90b23f9e9.1334369310.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1334369310.git.paul.eggleton@linux.intel.com>
References: <cover.1334369310.git.paul.eggleton@linux.intel.com>
From: Paul Eggleton <paul.eggleton@linux.intel.com>
Date: Sat, 14 Apr 2012 02:37:55 +0100
Subject: [PATCH 5/6] Remove all handling of Passphrase property
Services no longer have a Passphrase property in ConnMan 0.79 -
credentials are handled entirely through the agent.
Upstream-Status: Submitted
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
common/connman-client.c | 51 -----------------------------------------------
common/connman-client.h | 4 ---
common/connman-dbus.c | 11 +---------
properties/advanced.h | 1 -
properties/wifi.c | 48 --------------------------------------------
5 files changed, 1 insertions(+), 114 deletions(-)
diff --git a/common/connman-client.c b/common/connman-client.c
index e4441ad..dec9867 100644
--- a/common/connman-client.c
+++ b/common/connman-client.c
@@ -112,7 +112,6 @@ static void connman_client_init(ConnmanClient *client)
G_TYPE_BOOLEAN, /* favorite */
G_TYPE_UINT, /* strength */
G_TYPE_STRING, /* security */
- G_TYPE_STRING, /* passphrase */
G_TYPE_STRING, /* method */
G_TYPE_STRING, /* address */
G_TYPE_STRING, /* netmask */
@@ -501,56 +500,6 @@ gchar *connman_client_get_security(ConnmanClient *client, const gchar *network)
return security;
}
-gchar *connman_client_get_passphrase(ConnmanClient *client, const gchar *network)
-{
- ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
- GtkTreeIter iter;
- gchar *passphrase;
-
- DBG("client %p", client);
-
- if (network == NULL)
- return NULL;
-
- if (connman_dbus_get_iter(priv->store, network, &iter) == FALSE)
- return NULL;
-
- gtk_tree_model_get(GTK_TREE_MODEL(priv->store), &iter,
- CONNMAN_COLUMN_PASSPHRASE, &passphrase, -1);
-
- return passphrase;
-}
-
-gboolean connman_client_set_passphrase(ConnmanClient *client, const gchar *network,
- const gchar *passphrase)
-{
- ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
- DBusGProxy *proxy;
- GValue value = { 0 };
- gboolean ret = FALSE;
-
- DBG("client %p", client);
-
- if (network == NULL)
- goto done;
-
- proxy = connman_dbus_get_proxy(priv->store, network);
- if (proxy == NULL)
- goto done;
-
- g_value_init(&value, G_TYPE_STRING);
- g_value_set_string(&value, passphrase);
-
- ret = connman_set_property(proxy, "Passphrase", &value, NULL);
-
- g_value_unset(&value);
-
- g_object_unref(proxy);
-
-done:
- return ret;
-}
-
void connman_client_set_callback(ConnmanClient *client,
ConnmanClientCallback callback, gpointer user_data)
{
diff --git a/common/connman-client.h b/common/connman-client.h
index 6fe772c..bb36a2f 100644
--- a/common/connman-client.h
+++ b/common/connman-client.h
@@ -77,9 +77,6 @@ void connman_client_disconnect(ConnmanClient *client, const gchar *network);
gchar *connman_client_get_security(ConnmanClient *client, const gchar *network);
void connman_client_connect_async(ConnmanClient *client, const gchar *network,
connman_connect_reply callback, gpointer userdata);
-gchar *connman_client_get_passphrase(ConnmanClient *client, const gchar *network);
-gboolean connman_client_set_passphrase(ConnmanClient *client, const gchar *network,
- const gchar *passphrase);
void connman_client_set_remember(ConnmanClient *client, const gchar *network,
gboolean remember);
@@ -108,7 +105,6 @@ enum {
CONNMAN_COLUMN_FAVORITE, /* G_TYPE_BOOLEAN */
CONNMAN_COLUMN_STRENGTH, /* G_TYPE_UINT */
CONNMAN_COLUMN_SECURITY, /* G_TYPE_STRING */
- CONNMAN_COLUMN_PASSPHRASE, /* G_TYPE_STRING */
CONNMAN_COLUMN_METHOD, /* G_TYPE_STRING */
CONNMAN_COLUMN_ADDRESS, /* G_TYPE_STRING */
CONNMAN_COLUMN_NETMASK, /* G_TYPE_STRING */
diff --git a/common/connman-dbus.c b/common/connman-dbus.c
index 4eb77b6..f46a750 100644
--- a/common/connman-dbus.c
+++ b/common/connman-dbus.c
@@ -389,11 +389,6 @@ static void service_changed(DBusGProxy *proxy, const char *property,
gtk_tree_store_set(store, &iter,
CONNMAN_COLUMN_SECURITY, security,
-1);
- } else if (g_str_equal(property, "PassPhrase") == TRUE) {
- const char *passphrase = value ? g_value_get_string(value) : NULL;
- gtk_tree_store_set(store, &iter,
- CONNMAN_COLUMN_PASSPHRASE, passphrase,
- -1);
} else if (g_str_equal(property, "Strength") == TRUE) {
guint strength = g_value_get_uchar(value);
gtk_tree_store_set(store, &iter,
@@ -406,7 +401,7 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
{
GtkTreeStore *store = user_data;
GValue *value;
- const gchar *name, *icon, *passphrase, *security, *state;
+ const gchar *name, *icon, *security, *state;
guint type, strength;
gboolean favorite;
GtkTreeIter iter;
@@ -439,9 +434,6 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
value = g_hash_table_lookup(hash, "Security");
security = value ? g_strjoinv(" ", g_value_get_boxed(value)) : NULL;
- value = g_hash_table_lookup(hash, "PassPhrase");
- passphrase = value ? g_value_get_string(value) : NULL;
-
DBG("name %s type %d icon %s", name, type, icon);
value = g_hash_table_lookup(hash, "IPv4.Configuration");
@@ -499,7 +491,6 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
CONNMAN_COLUMN_STATE, state,
CONNMAN_COLUMN_FAVORITE, favorite,
CONNMAN_COLUMN_SECURITY, security,
- CONNMAN_COLUMN_PASSPHRASE, passphrase,
CONNMAN_COLUMN_STRENGTH, strength,
CONNMAN_COLUMN_METHOD, method,
CONNMAN_COLUMN_ADDRESS, addr,
diff --git a/properties/advanced.h b/properties/advanced.h
index d8f4117..553a15e 100644
--- a/properties/advanced.h
+++ b/properties/advanced.h
@@ -53,7 +53,6 @@ struct config_data {
GtkWidget *name;
GtkWidget *security;
GtkWidget *strength;
- GtkWidget *passphrase;
GtkWidget *connect_info;
GtkWidget *connect;
GtkWidget *disconnect;
diff --git a/properties/wifi.c b/properties/wifi.c
index 038d35a..bd325ef 100644
--- a/properties/wifi.c
+++ b/properties/wifi.c
@@ -57,17 +57,6 @@ static void connect_callback(GtkWidget *editable, gpointer user_data)
gboolean ret;
gint active;
- if (data->wifi.passphrase) {
- char *passphrase;
- passphrase = (gchar *)gtk_entry_get_text(GTK_ENTRY(data->wifi.passphrase));
- ret = connman_client_set_passphrase(data->client, data->device,
- passphrase);
-
- if (ret == FALSE) {
- return;
- }
- }
-
active = gtk_combo_box_get_active(GTK_COMBO_BOX(data->policy.config));
data->ipv4_config.method = active ? "manual" : "dhcp";
data->ipv4_config.address = active ? gtk_entry_get_text(GTK_ENTRY(data->ipv4.entry[0])) : NULL;
@@ -250,22 +239,11 @@ static void wifi_ipconfig(GtkWidget *table, struct config_data *data, GtkTreeIte
G_CALLBACK(changed_callback), data);
}
-static void toggled_callback(GtkWidget *button, gpointer user_data)
-{
- GtkWidget *entry = user_data;
- gboolean mode;
-
- mode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
-
- gtk_entry_set_visibility(GTK_ENTRY(entry), mode);
-}
-
void add_wifi_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_data *data)
{
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
- GtkWidget *entry;
GtkWidget *button;
const char *name, *security, *icon, *state;
@@ -308,32 +286,6 @@ void add_wifi_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_data
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
data->wifi.security = label;
- label = gtk_label_new(_("Passphrase:"));
- gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 2, 3);
-
- if (g_str_equal(security, "none") != TRUE &&
- g_str_equal(security, "unknown") != TRUE) {
- entry = gtk_entry_new();
- gtk_entry_set_max_length (GTK_ENTRY (entry), 64);
- gtk_table_attach_defaults(GTK_TABLE(table), entry, 2, 4, 2, 3);
- gtk_entry_set_visibility(GTK_ENTRY(entry), 0);
- data->wifi.passphrase = entry;
-
- button = gtk_check_button_new_with_label(_("Show input"));
- gtk_table_attach_defaults(GTK_TABLE(table), button, 4, 5, 2, 3);
-
- g_signal_connect(G_OBJECT(button), "toggled",
- G_CALLBACK(toggled_callback), entry);
-
-
- } else {
- label = gtk_label_new(_("none"));
- gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 4, 2, 3);
- gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- data->wifi.passphrase = NULL;
- }
-
label = gtk_label_new(_(""));
gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 8, 9);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
--
1.7.5.4
|