Merge lp:~seb128/unity-control-center/bluetooth-ssp-signature into lp:unity-control-center

Proposed by Sebastien Bacher
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 12831
Merged at revision: 12831
Proposed branch: lp:~seb128/unity-control-center/bluetooth-ssp-signature
Merge into: lp:unity-control-center
Diff against target: 81 lines (+21/-12)
2 files modified
panels/bluetooth/gnome-bluetooth/lib/bluetooth-agent.c (+4/-4)
panels/bluetooth/gnome-bluetooth/wizard/main.c (+17/-8)
To merge this branch: bzr merge lp:~seb128/unity-control-center/bluetooth-ssp-signature
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Michael Terry Pending
Review via email: mp+271680@code.launchpad.net

Commit message

[bluetooth] restore the ssp pairing signature fix which was applied to our
gnome-bluetooth package but got discarded by error when updating ucc to the
new bluez version

Description of the change

[bluetooth] restore the ssp pairing signature fix which was applied to our
gnome-bluetooth package but got discarded by error when updating ucc to the
new bluez version

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Yes please! :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panels/bluetooth/gnome-bluetooth/lib/bluetooth-agent.c'
2--- panels/bluetooth/gnome-bluetooth/lib/bluetooth-agent.c 2015-03-03 11:08:17 +0000
3+++ panels/bluetooth/gnome-bluetooth/lib/bluetooth-agent.c 2015-09-18 16:47:30 +0000
4@@ -51,7 +51,7 @@
5 " <method name='DisplayPasskey'>"
6 " <arg type='o' name='device' direction='in'/>"
7 " <arg type='u' name='passkey' direction='in'/>"
8-" <arg type='y' name='entered' direction='in'/>"
9+" <arg type='q' name='entered' direction='in'/>"
10 " </method>"
11 " <method name='DisplayPinCode'>"
12 " <arg type='o' name='device' direction='in'/>"
13@@ -167,7 +167,7 @@
14 }
15
16 static gboolean bluetooth_agent_display_passkey(BluetoothAgent *agent,
17- const char *path, guint passkey, guint8 entered,
18+ const char *path, guint passkey, guint16 entered,
19 GDBusMethodInvocation *invocation)
20 {
21 BluetoothAgentPrivate *priv = BLUETOOTH_AGENT_GET_PRIVATE(agent);
22@@ -388,9 +388,9 @@
23 } else if (g_strcmp0 (method_name, "DisplayPasskey") == 0) {
24 char *path;
25 guint32 passkey;
26- guint8 entered;
27+ guint16 entered;
28
29- g_variant_get (parameters, "(ouy)", &path, &passkey, &entered);
30+ g_variant_get (parameters, "(ouq)", &path, &passkey, &entered);
31 bluetooth_agent_display_passkey (agent, path, passkey, entered, invocation);
32 g_free (path);
33 } else if (g_strcmp0 (method_name, "DisplayPinCode") == 0) {
34
35=== modified file 'panels/bluetooth/gnome-bluetooth/wizard/main.c'
36--- panels/bluetooth/gnome-bluetooth/wizard/main.c 2015-03-03 11:08:17 +0000
37+++ panels/bluetooth/gnome-bluetooth/wizard/main.c 2015-09-18 16:47:30 +0000
38@@ -442,7 +442,7 @@
39 guint entered,
40 gpointer user_data)
41 {
42- gchar *text, *done, *code;
43+ gchar *text, *done, *code, *label;
44
45 display_called = TRUE;
46 gtk_assistant_set_current_page (window_assistant, PAGE_SSP_SETUP);
47@@ -469,18 +469,27 @@
48
49 done = g_string_free (str, FALSE);
50 } else {
51- done = g_strdup ("");
52- }
53-
54- gtk_widget_show (label_pin_help);
55-
56- gtk_label_set_markup(GTK_LABEL(label_ssp_pin_help), _("Please enter the following PIN:"));
57- text = g_strdup_printf("%s%s", done, code + entered);
58+ done = g_strdup_printf("%s", code);
59+ }
60+
61+ gtk_widget_show (label_ssp_pin);
62+
63+ if (target_ui_behaviour == PAIRING_UI_KEYBOARD) {
64+ label = g_strdup_printf (_("Please enter the following PIN on '%s' and press “Enter” on the keyboard:"), target_name);
65+ text = g_strdup_printf("%s⏎", done);
66+ }
67+ else {
68+ label = g_strdup_printf (_("Please enter the following PIN on '%s':"), target_name);
69+ text = g_strdup_printf("%s", done);
70+ }
71+
72+ gtk_label_set_markup(GTK_LABEL(label_ssp_pin_help), label);
73 set_large_label (GTK_LABEL (label_ssp_pin), text);
74 g_free(text);
75
76 g_free(done);
77 g_free(code);
78+ g_free(label);
79
80 g_dbus_method_invocation_return_value (invocation, NULL);
81 }

Subscribers

People subscribed via source and target branches