All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: John Klug <John.Klug@multitech.com>
Cc: Linux-Bluetooth MailingList <linux-bluetooth@vger.kernel.org>
Subject: Re: What could cause pairing to fail when bluetoothctl is not running?
Date: Tue, 30 Aug 2022 15:28:32 -0700	[thread overview]
Message-ID: <CABBYNZJNdQeXwVcnjsukMaPvn9s0zHWN2_i_T8Hidyj0WcGM=Q@mail.gmail.com> (raw)
In-Reply-To: <DM8PR13MB511149D1CDA49915538C8FC5FE799@DM8PR13MB5111.namprd13.prod.outlook.com>

Hi John,

On Tue, Aug 30, 2022 at 3:22 PM John Klug <John.Klug@multitech.com> wrote:
>
> I am now looking at what is going on with a sniffer.  For some reason in 5.10, the AuthReq always comes from the slave (BlueZ is the master, GATT client):
>
> 5.10 kernel which fails, leaving out empty PDU, L2CAP Fragments, etc.  This sequence is reproducible.
>
> Sent slave CONNECT_IND
> Rcvd Security Request: AuthReq: Bonding, SecureConnection
> Sent Pairing Failed: Pairing not Supported
> Sent Pairing Failed: Pairing not Supported
> Rcvd Exchange MTU Response ...
> Sent Pairing Request: AuthReq: No Bonding, SecureConnection | Initiator Key(s): <none> | Responder key(s) IRK
> Sent Control Opcode LL_LENGTH_RSP
> Rcvd Pairing Response: AuthReq: No Bonding, SecureConnection | Initiator Key(s): <none> | Responder key(s)
> Sent Pairing Public Key
> Sent Read By Type Request, Sever Supported Features, Handles: ...
> Recvd Pairing Public Key
> Rcvd Pairing Confirm
> Rcvd Error Response - Attribute Not Found, Handle: 0x0001 (Unknown)
> Sent Pairing Random
> Sent Read by Group Type Request, Gatt ...
> Rcvd Pairing Random
> Send Pairing Failed: Numeric Comparison Failed
>
> The 5.4 kernel always works, but BlueZ/Linux sends the first AuthReq:
>
> Sent Slave CONNECT_IND
> Sent Pairing Request: AuthReq: No Bonding, SecureConnection | Initiator Key(s): <none> | Responder key(s)
> Rcvd Pairing Response: AuthReq: No Bonding, SecureConnection | Initiator Key(s): <none> | Responder key(s)
> Sent Read By Type Request, Sever Supported Features, Handles: ...
> Rcvd Pairing Response: AuthReq: No Bonding, SecureConnection | Initiator Key(s): <none> | Responder
> Sent Read by Group Type Request, Gatt ..
> Rcvd Pairing Confirm
> Rcvd Read by Group Type Response, Attribute ..
> Sent Pairing Random
> Sent Read by Group Type Request, Gatt ..
> Rcvd Pairing Random
> Sent Pairing DHKey Check
>
> Should the program be sending a Pair using the Device API?  Is there something else to cause the public key exchange?  In the 5.4 case, the "Paired" property is always being set by the Device API.

Either way you need a pairing agent in case the device for some reason
removes its link key and then you need to repair, besides the agent
also does authorization when the device is not trusted, have you tried
just running bluetoothctl to see if that makes it work?

-- 
Luiz Augusto von Dentz

  reply	other threads:[~2022-08-30 22:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 22:09 What could cause pairing to fail when bluetoothctl is not running? John Klug
2022-08-26 22:43 ` John Klug
2022-08-29  9:49   ` Bastien Nocera
     [not found]     ` <DM8PR13MB5111064C283B3B2F2E8C3681FE799@DM8PR13MB5111.namprd13.prod.outlook.com>
2022-08-30 22:13       ` John Klug
2022-08-30 22:28         ` Luiz Augusto von Dentz [this message]
2022-08-31  0:11           ` John Klug
2022-08-31 17:52             ` John Klug

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABBYNZJNdQeXwVcnjsukMaPvn9s0zHWN2_i_T8Hidyj0WcGM=Q@mail.gmail.com' \
    --to=luiz.dentz@gmail.com \
    --cc=John.Klug@multitech.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.