Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4705565rwe; Tue, 30 Aug 2022 15:32:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR6cJ8fISrzwg/pEnSKNIVCpxxThaXFEBcwfgCfpiMu2dAjK39uJ/x/mQopXh/DKw9cBczWB X-Received: by 2002:a05:6402:5190:b0:448:552e:ce1c with SMTP id q16-20020a056402519000b00448552ece1cmr11806493edd.251.1661898774544; Tue, 30 Aug 2022 15:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661898774; cv=none; d=google.com; s=arc-20160816; b=SQYUxwC1wqDS1velXU5ZhsVlnaROs54/NcN4fW8tWbQ7pNZxuWQ4eSKlaTyd+Nq7bl qHYWXBtp91WSdW6U5dbQO4I8rMy8FF9pxykuEbFSJ8zqnNppHH07FSagfiw9SGxEZAYm /hY9Qa6Qj7wOIh5dnMrd6qHDFQ5aHjvEXuvMBKaP4kTEmEHfH7FEwT8y9eisUZBB9SfX m/gv4i0remHaaN5l0NNncYuKsLDEWDt9UY4m5+LkF6rFwQzyxOHvvZgalGkOtXlJovi5 1dMcXP40F4gY5eG3HF+Z9M7SEaOAkxpsQXX5e2fQxY/HCSMDDcU9M2wuF0gsCSYLK0Ti BCzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lrHR5AxqUMygPO4vrKfQ6iTOv+xjndE+OQ+3I2sFYLg=; b=jYDBNO0HkVnaQZ5hGoba1bY8YQVhhBN2IoETyAB9EoymgY9+zDk6YyBpfstUsb990c kv5zMJmvxbFzPVB9toIW0BG3vLzj/VPiDAkkRdCEw2MJuj/MqyxhrscavkbnSMfeuXDd 9fv/IkxYIkITJZEGKMg01JoxEYn/zArr2WKxXlVRsBY/3QrteMfTKXER49NzuVWWdtEE Q2h7LLszW2wL3TAHB/1Z2FK9vvCCw1Wj8xQoJw4iVpqhbxQWBlE3Vt8mnUE9eYxowEK7 6bQ8YBj6fps51JKPE8BPzuhQByvUmFdCLLyfaS4bLMIL3lhvypck5m2py6zNcA0gy28b gMLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bnS+4z5i; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020a1709067c4a00b0073dd6d901dbsi1029378ejp.72.2022.08.30.15.31.49; Tue, 30 Aug 2022 15:32:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bnS+4z5i; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230483AbiH3WbH (ORCPT + 99 others); Tue, 30 Aug 2022 18:31:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231809AbiH3Waq (ORCPT ); Tue, 30 Aug 2022 18:30:46 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE52584ED7 for ; Tue, 30 Aug 2022 15:28:46 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id w8so8413672lft.12 for ; Tue, 30 Aug 2022 15:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=lrHR5AxqUMygPO4vrKfQ6iTOv+xjndE+OQ+3I2sFYLg=; b=bnS+4z5i/kP41rYhR0IxDz93x5VjI78Ksq72U50Xhn6DYskOhtCLaAvVyYfcIsmLeq uPZUp/5GowB44i0QuZYcl1w5EbeTkM6codRbAOZOEUGWKB3+ynTc2vFV/RQkBgHD3h14 U2Mr0zjvefc5kOCO9deJVFRyP90UO7lu/xqyfE9ktHGIB1Lc9u8q20D1STnqOb3sfewY vFGBphgACDR7NmrrN7RBSW+kOecers4xVWAoDA+6VrnJyDP02hkwbTs+sheHF0w2qiFM LS9h1YOZRHtBgX0xyReFOGFIuk2fn/kwo7hACCTcr7w3xo3HkUabTNnUXpykPz6jVR3C vXcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=lrHR5AxqUMygPO4vrKfQ6iTOv+xjndE+OQ+3I2sFYLg=; b=QSLSzj+0WVfPjBWH3DxESpT7gBCStB1s9wSxLAyeF4K0eOmvOH4aG2j+NYf4VokLpW ZIs0TSMbcvMLtrQ04LJK7GOwEwUvqnbxFngebeYswvgJXK9d0vQ5ynTqi0XHrhqWDXpq LZvlXFE6bXXw6tpnK15eEQXUgddWWyKsw3MJetwDNKfqdvehElgmO1wmFk0n21iJJf8p FgJWCaNc03tmOnXSMZGA7PizjgPgj8Rh+zN6+CKMtIXUE7u9mWwXAHK63uuG9dEGrinl 2E0wW5YEj6R4dKcaQYl6lQaMUZcROffzIRnln/mUK1EkMv+fxDg61JWoBOjzNEOD+ORP iOrQ== X-Gm-Message-State: ACgBeo2zjFMfPy5efUpTdUyD3reK7CtMbjSuoYYDlWRCYTdncdGtddlO 6ljNevufNHuq6ecUk7RXo30tiy9XPQU0B7+VbrAg0p3H X-Received: by 2002:a05:6512:1ce:b0:494:81fc:e755 with SMTP id f14-20020a05651201ce00b0049481fce755mr971744lfp.106.1661898524461; Tue, 30 Aug 2022 15:28:44 -0700 (PDT) MIME-Version: 1.0 References: <3dd715a9d8b30ccb6dce4d4e1e034cf8d0458d44.camel@hadess.net> In-Reply-To: From: Luiz Augusto von Dentz Date: Tue, 30 Aug 2022 15:28:32 -0700 Message-ID: Subject: Re: What could cause pairing to fail when bluetoothctl is not running? To: John Klug Cc: Linux-Bluetooth MailingList Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi John, On Tue, Aug 30, 2022 at 3:22 PM John Klug 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): | Responder key(s) IRK > Sent Control Opcode LL_LENGTH_RSP > Rcvd Pairing Response: AuthReq: No Bonding, SecureConnection | Initiator Key(s): | 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): | Responder key(s) > Rcvd Pairing Response: AuthReq: No Bonding, SecureConnection | Initiator Key(s): | Responder key(s) > Sent Read By Type Request, Sever Supported Features, Handles: ... > Rcvd Pairing Response: AuthReq: No Bonding, SecureConnection | Initiator Key(s): | 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