GNOME Bugzilla – Bug 651251
Bluetooth passkey not formatted correctly
Last modified: 2012-06-06 16:13:44 UTC
The SSP passkey should be prepended with zeros to have the exact 6-digit length. I have no idea if something like that would work: - this.addBody(_("Please confirm whether the PIN '%s' matches the one on the device.").format(pin)); + this.addBody(_("Please confirm whether the PIN '%06d' matches the one on the device.").pin); See: http://git.gnome.org/browse/gnome-bluetooth/commit/?id=a9a5b6f82e0623ff9828278a21b900226c2ec9ae
And in PinNotification.prototype, we need to ensure that the OK button is only enabled if 6 digits were typed in the entry.
(In reply to comment #0) > I have no idea if something like that would work: > - this.addBody(_("Please confirm whether the PIN '%s' matches the one on the > device.").format(pin)); > + this.addBody(_("Please confirm whether the PIN '%06d' matches the one on the > device.").pin); Yes, see http://git.gnome.org/browse/gnome-shell/commit?id=a84e2e33072f684.
+ this.addBody(_("Please confirm whether the PIN '%06d' matches the one on the device.").format(pin)); then.
Yeah, I assumed the ().pin was a typo on your part ...
(In reply to comment #4) > Yeah, I assumed the ().pin was a typo on your part ... Nope, I thought format() was only for int->string conversion. I stand corrected :)
Created attachment 214268 [details] [review] bluetooth: zero-pad PIN Bluetooth PINs always consist of 6 digits, so make sure to add leading zeros as necessary. Obvious patch for issue #1
Created attachment 214274 [details] [review] messageTray: Allow to make notification buttons insensitive The availability of a notification action may depend on conditions, so add a method to control the sensitivity of buttons which have been added with addButton().
Created attachment 214275 [details] [review] bluetooth: Enforce a PIN length of 6 digits Bluetooth PINs are required to have 6 digits, so enforce that condition by making the PIN request notification's confirm button insensitive unless the entered PIN has the correct length.
Review of attachment 214268 [details] [review]: Looks good.
Review of attachment 214274 [details] [review]: Looks good.
Review of attachment 214275 [details] [review]: Looks good, I just don't like the name of the function. ::: js/ui/status/bluetooth.js @@ +488,3 @@ }, + _canActivateOk: function() { I'd call this "_canActiveOkButton" just "ok" somehow sounds odd.
Attachment 214268 [details] pushed as 76616dc - bluetooth: zero-pad PIN Attachment 214274 [details] pushed as 6190d6c - messageTray: Allow to make notification buttons insensitive Attachment 214275 [details] pushed as 48d6eb1 - bluetooth: Enforce a PIN length of 6 digits (In reply to comment #11) > + _canActivateOk: function() { > > I'd call this "_canActiveOkButton" just "ok" somehow sounds odd. I reckon you mean "canActiv*at*eOkButton" - pushed with that change.
(In reply to comment #12) > Attachment 214268 [details] pushed as 76616dc - bluetooth: zero-pad PIN > Attachment 214274 [details] pushed as 6190d6c - messageTray: Allow to make notification > buttons insensitive > Attachment 214275 [details] pushed as 48d6eb1 - bluetooth: Enforce a PIN length of 6 > digits > > (In reply to comment #11) > > + _canActivateOk: function() { > > > > I'd call this "_canActiveOkButton" just "ok" somehow sounds odd. > > I reckon you mean "canActiv*at*eOkButton" - pushed with that change. err... yeah ;)
(In reply to comment #8) > Created an attachment (id=214275) [details] [review] > bluetooth: Enforce a PIN length of 6 digits > > Bluetooth PINs are required to have 6 digits, so enforce that > condition by making the PIN request notification's confirm > button insensitive unless the entered PIN has the correct length. I may be an idiot, but ... where is this requirement defined? And will this patch affect /all/ Bluetooth pairings? I clearly remember having paired devices using both numeric and alphanumeric PINs of varying lengths, and even have a device with a hardcoded 4-digit PIN.
(In reply to comment #14) > (In reply to comment #8) > > Created an attachment (id=214275) [details] [review] [details] [review] > > bluetooth: Enforce a PIN length of 6 digits > > > > Bluetooth PINs are required to have 6 digits, so enforce that > > condition by making the PIN request notification's confirm > > button insensitive unless the entered PIN has the correct length. > > I may be an idiot, but ... where is this requirement defined? In the Bluetooth specs, for SimplePairing passkeys. See: http://en.wikipedia.org/wiki/Bluetooth#Pairing_mechanisms