2022-08-31 19:44:12

by Florian Leeber

[permalink] [raw]
Subject: [PATCH] plugins: Do not try to autopair with Nissan Connect devices

It seems that Nissan Connect carkits a) do not use 0000 but 1234 as
default code
but also b) the autopair plugin is not allowed to make a second attempt
to pair.
Let´s try to not use the autopairing at all for those devices.
---
 plugins/autopair.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/plugins/autopair.c b/plugins/autopair.c
index 0b09e89..6bf07e3 100644
--- a/plugins/autopair.c
+++ b/plugins/autopair.c
@@ -66,6 +66,9 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
        /* The iCade shouldn't use random PINs like normal keyboards */
        if (strstr(name, "iCade") != NULL)
                return 0;
+       /* Nissan Connect carkits use PIN 1234 but refuse a retry */
+       if (strstr(name, "NISSAN CONNECT") != NULL)
+               return 0;

        /* This is a class-based pincode guesser. Ignore devices with an
         * unknown class.
--
2.17.1


2022-08-31 20:00:50

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-08-31 20:39:17

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH] plugins: Do not try to autopair with Nissan Connect devices

Hi Florian,

On Wed, Aug 31, 2022 at 12:44 PM Florian Leeber <[email protected]> wrote:
>
> It seems that Nissan Connect carkits a) do not use 0000 but 1234 as
> default code
> but also b) the autopair plugin is not allowed to make a second attempt
> to pair.
> Let´s try to not use the autopairing at all for those devices.
> ---
> plugins/autopair.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/plugins/autopair.c b/plugins/autopair.c
> index 0b09e89..6bf07e3 100644
> --- a/plugins/autopair.c
> +++ b/plugins/autopair.c
> @@ -66,6 +66,9 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
> /* The iCade shouldn't use random PINs like normal keyboards */
> if (strstr(name, "iCade") != NULL)
> return 0;
> + /* Nissan Connect carkits use PIN 1234 but refuse a retry */
> + if (strstr(name, "NISSAN CONNECT") != NULL)
> + return 0;

Well this is already starting to grow which imo defeats the purpose of
hardcoding directly on the code so perhaps we could have a section
e.g. [Autopair] where one can enter device names that shall not use
defaults PINs, or may an entry where one can add its own specific PIN
sequence for a given device name including none:

[Autopair]
PIN=0000,1234
# The iCade shouldn't use random PINs like normal keyboards
iCade=
# Nissan Connect carkits use PIN 1234 but it refuses retries
NISSAN CONNECT=1234

With this the logic is check if there is an entry for the device name
and then use as PIN otherwise use the PIN entry (if not defined use
the current settings as default).

> /* This is a class-based pincode guesser. Ignore devices with an
> * unknown class.
> --
> 2.17.1
>


--
Luiz Augusto von Dentz

2022-09-01 10:52:47

by Bastien Nocera

[permalink] [raw]
Subject: Re: [PATCH] plugins: Do not try to autopair with Nissan Connect devices

On Wed, 2022-08-31 at 13:18 -0700, Luiz Augusto von Dentz wrote:
> Hi Florian,
>
> On Wed, Aug 31, 2022 at 12:44 PM Florian Leeber <[email protected]>
> wrote:
> >
> > It seems that Nissan Connect carkits a) do not use 0000 but 1234 as
> > default code
> > but also b) the autopair plugin is not allowed to make a second
> > attempt
> > to pair.
> > Let´s try to not use the autopairing at all for those devices.
> > ---
> >   plugins/autopair.c | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/plugins/autopair.c b/plugins/autopair.c
> > index 0b09e89..6bf07e3 100644
> > --- a/plugins/autopair.c
> > +++ b/plugins/autopair.c
> > @@ -66,6 +66,9 @@ static ssize_t autopair_pincb(struct btd_adapter
> > *adapter,
> >          /* The iCade shouldn't use random PINs like normal
> > keyboards */
> >          if (strstr(name, "iCade") != NULL)
> >                  return 0;
> > +       /* Nissan Connect carkits use PIN 1234 but refuse a retry
> > */
> > +       if (strstr(name, "NISSAN CONNECT") != NULL)
> > +               return 0;
>
> Well this is already starting to grow which imo defeats the purpose
> of
> hardcoding directly on the code so perhaps we could have a section
> e.g. [Autopair] where one can enter device names that shall not use
> defaults PINs, or may an entry where one can add its own specific PIN
> sequence for a given device name including none:
>
> [Autopair]
> PIN=0000,1234
> # The iCade shouldn't use random PINs like normal keyboards
> iCade=
> # Nissan Connect carkits use PIN 1234 but it refuses retries
> NISSAN CONNECT=1234
>
> With this the logic is check if there is an entry for the device name
> and then use as PIN otherwise use the PIN entry (if not defined use
> the current settings as default).

FWIW, gnome-bluetooth has its own database on top of bluez, which we
prefer to the code in bluez. I'd be happy getting rid of it.

Loads of devices that need pairing despite their class and Bluetooth
version, and devices that need special handling like the Navman GPS
that expects a non-numerical PIN.

The database:
https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/blob/master/lib/pin-code-database.xml
The code to parse it:
https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/blob/master/lib/pin.c

2022-09-01 18:32:53

by Florian Leeber

[permalink] [raw]
Subject: Re: [PATCH] plugins: Do not try to autopair with Nissan Connect devices

Am 01.09.2022 um 12:46 schrieb Bastien Nocera:
> On Wed, 2022-08-31 at 13:18 -0700, Luiz Augusto von Dentz wrote:
>> Hi Florian,
>>
>> On Wed, Aug 31, 2022 at 12:44 PM Florian Leeber <[email protected]>
>> wrote:
>> gs as default).
> FWIW, gnome-bluetooth has its own database on top of bluez, which we
> prefer to the code in bluez. I'd be happy getting rid of it.
>
> Loads of devices that need pairing despite their class and Bluetooth
> version, and devices that need special handling like the Navman GPS
> that expects a non-numerical PIN.
>
> The database:
> https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/blob/master/lib/pin-code-database.xml
> The code to parse it:
> https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/blob/master/lib/pin.c

Oh my, this escalated quickly ;) - tbh implementing this as a fully
fledged config-based feature might be over my head. I am not proficient
with the Bluez code at all, and my main work currently is being the OTA
release manager for Ubuntu Touch. I could only work on this with some
support to get the basics established.

Thanks for the hint with the database, we did not know about this.


2022-09-01 23:57:51

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH] plugins: Do not try to autopair with Nissan Connect devices

Hi Florian,

On Thu, Sep 1, 2022 at 11:10 AM Florian Leeber <[email protected]> wrote:
>
> Am 01.09.2022 um 12:46 schrieb Bastien Nocera:
> > On Wed, 2022-08-31 at 13:18 -0700, Luiz Augusto von Dentz wrote:
> >> Hi Florian,
> >>
> >> On Wed, Aug 31, 2022 at 12:44 PM Florian Leeber <[email protected]>
> >> wrote:
> >> gs as default).
> > FWIW, gnome-bluetooth has its own database on top of bluez, which we
> > prefer to the code in bluez. I'd be happy getting rid of it.
> >
> > Loads of devices that need pairing despite their class and Bluetooth
> > version, and devices that need special handling like the Navman GPS
> > that expects a non-numerical PIN.
> >
> > The database:
> > https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/blob/master/lib/pin-code-database.xml
> > The code to parse it:
> > https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/blob/master/lib/pin.c
>
> Oh my, this escalated quickly ;) - tbh implementing this as a fully
> fledged config-based feature might be over my head. I am not proficient
> with the Bluez code at all, and my main work currently is being the OTA
> release manager for Ubuntu Touch. I could only work on this with some
> support to get the basics established.
>
> Thanks for the hint with the database, we did not know about this.

Can't you solve the problem in the agent thought? Or does the current
logic make the pairing fail right away?

>


--
Luiz Augusto von Dentz

2022-09-02 19:40:38

by Florian Leeber

[permalink] [raw]
Subject: Re: [PATCH] plugins: Do not try to autopair with Nissan Connect devices

Am 02.09.2022 um 01:56 schrieb Luiz Augusto von Dentz:
> Hi Florian,
>
> On Thu, Sep 1, 2022 at 11:10 AM Florian Leeber <[email protected]> wrote:
>> Am 01.09.2022 um 12:46 schrieb Bastien Nocera:
>>> On Wed, 2022-08-31 at 13:18 -0700, Luiz Augusto von Dentz wrote:
>>>> Hi Florian,
>>>>
>>>>
> Can't you solve the problem in the agent thought? Or does the current
> logic make the pairing fail right away?
>
The problem seems to be that the carkit allows only one try. After a
failed code it cancels the pairing (Seems they violate the specs?). So I
could either resort the list to make 1234 being the first to try. But I
think this would maybe affect other stuff and 0000 is probably the most
used default code.


2022-09-29 16:51:34

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 17:50:35

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 18:52:27

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 19:05:55

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 19:54:46

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 19:57:58

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 20:42:25

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 20:59:46

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 21:42:11

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 22:03:24

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 22:47:14

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 22:56:56

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-29 23:45:45

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth

2022-09-30 00:27:02

by bluez.test.bot

[permalink] [raw]
Subject: RE: plugins: Do not try to autopair with Nissan Connect devices

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----
error: patch failed: plugins/autopair.c:66
error: plugins/autopair.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch


Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth