Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3707873ybb; Tue, 31 Mar 2020 10:23:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu4p7GzaSIk5YYk7yR6thqCsDpaPDwfh67CiUkr0injBBFlofjVoVjdnbcaj5OG6ffH9vDs X-Received: by 2002:a9d:ac5:: with SMTP id 63mr14168766otq.239.1585675419548; Tue, 31 Mar 2020 10:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585675419; cv=none; d=google.com; s=arc-20160816; b=a10D/+2AmwvQ8p4xyHRtcw1B+90KpCceERuxde8oUPrhrBsCp3GvnJu2h8FL2vgvJG nGRLdgupKJin/sxgMRXilLsiAdYs8THgAeWeYlnGF1SlMhuXLzcbaXRhBpbY7Oc4xV8c 93iHVHLRliDN63luYkCzLWeLqJHgSDiFvh8to+KR228eMZ8AqQ93Lun5t4AgaObxSHjz Tma6PuFZH5HQZZjTWX2hunkSNtQtp3pBwZ2hyJYerdd+z9iQzITV2+nIx7xOTgYFsA3y mRSMdGVSVTiIxb3qv7BrDwui5ZT4wyVFksZXb/uj+WBYqYI3uSjj6/xWft1wbCEVOxpP HXEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AkFweVO6+fKbQ/CR3A2jIG2D72GQfDQ97HnpjS5ITLc=; b=VPdi+5MG9Uf4cS9KhuFY6DaY168WZZp5+LFUW5zxJqhljn81fIAM09OEO68dSwK2Rp gdDapbtAohDlTjlfK9Tp9PRxea8WV23Xeeb0pG1a4XS300XhYW/7YfnMkAm3WXWO0ble oI66rvn9aJ5IpeXVIGQaED7x5r0atMlQ6fqcFS0BEqWaPkN8RlQfkxQ3YeAhEvON39yW n6QJnKKO9kEZMrtVJxHDE1cC5szjF5U40GMvyo3wUNYvrBY/LeJO+YH/hb58abAgxRIK eZt0HGshzX6P39FyI5m3mUOD396BTMpIsRbomHEzvH/2e/Da6RHMakKRdGeQrfjl26EF KHyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JWPpiWZX; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l19si7724399otp.119.2020.03.31.10.23.09; Tue, 31 Mar 2020 10:23:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JWPpiWZX; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726194AbgCaRWt (ORCPT + 99 others); Tue, 31 Mar 2020 13:22:49 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:46646 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbgCaRWt (ORCPT ); Tue, 31 Mar 2020 13:22:49 -0400 Received: by mail-oi1-f193.google.com with SMTP id q204so19556100oia.13 for ; Tue, 31 Mar 2020 10:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AkFweVO6+fKbQ/CR3A2jIG2D72GQfDQ97HnpjS5ITLc=; b=JWPpiWZXez24hu+a7A0dvLaFWBpSmMn/dAmRXBYfHG1q6PFKE78Vhc1SL4XM+TMXYi R99+xb9BfjWzDLo53Pe47Oj7T9XU4jsKWFc6qUwnrQe0hL20MaLakyD9xZyf6AMH6j8T KdMaUOkoOh3EHai6FNFPmCLPyyM/G6jfEzE+s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AkFweVO6+fKbQ/CR3A2jIG2D72GQfDQ97HnpjS5ITLc=; b=muc2tTM2mX7quqScSMxtT+GOyrNExRHXA2uAulRF4B1mIrvLWzdSdCzHUC5i2kN/x3 x9fbYJfJ9C+XY1II1DsjUJ3R/l4AQszi9+y4nRKwkNubBP+O9ZLb41Qhtb+s3jHDB4IE CmB2QWFxrrw+ewuWuB3lgNTCjfoSx9xPjz+j4CUsD5OzM5JqPm5ZUr4/XaPLw6SH+EN9 paeHtG8HEFYXDf+sIKBIiHGRTMeEC2eLn7Z/OIVOu6uC6jSlHiUMcwDQdalRjvWy35Qa wLgcnQSd3mtJM6WMtAB3eWXW+QqR+xDTq1ebH0ppR3yvsbxT8P34u9xvzBx0EP2Co2iH LG9w== X-Gm-Message-State: ANhLgQ2ROhlbbSts/R7WeKvRCBxOW/WIZorumS6fTtFPmoh81nwsKhQw xgjYD/gtmgnurPBUw2ODPEtyMVP9q3jgkG6p01esvA== X-Received: by 2002:aca:dd55:: with SMTP id u82mr2864806oig.27.1585675368666; Tue, 31 Mar 2020 10:22:48 -0700 (PDT) MIME-Version: 1.0 References: <20200328003318.13937-1-sonnysasaka@chromium.org> In-Reply-To: From: Sonny Sasaka Date: Tue, 31 Mar 2020 10:22:36 -0700 Message-ID: Subject: Re: [PATCH] core/device: Handle Just-Works auto-accept To: Luiz Augusto von Dentz Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Thanks, Luiz. On Mon, Mar 30, 2020 at 11:30 PM Luiz Augusto von Dentz wrote: > > Hi Sonny, > > On Fri, Mar 27, 2020 at 5:36 PM Sonny Sasaka wrote: > > > > The kernel starts to always request confirmation to BlueZ daemon for > > Just-Works pairing. In this patch the daemon does auto-accept if the > > client has clearly indicated a pairing intent by calling the Pair() > > D-Bus API. > > --- > > src/device.c | 14 ++++++++++++-- > > 1 file changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/src/device.c b/src/device.c > > index 69f98e488..db14cc129 100644 > > --- a/src/device.c > > +++ b/src/device.c > > @@ -6168,12 +6168,22 @@ int device_confirm_passkey(struct btd_device *device, uint8_t type, > > > > auth->passkey = passkey; > > > > - if (confirm_hint) > > + if (confirm_hint) { > > + if (device->bonding != NULL) { > > + /* We know the client has indicated the intent to pair > > + * with the peer device, so we can auto-accept. */ > > + btd_adapter_confirm_reply(device->adapter, > > + &device->bdaddr, > > + type, TRUE); > > + return 0; > > + } > > + > > err = agent_request_authorization(auth->agent, device, > > confirm_cb, auth, NULL); > > - else > > + } else { > > err = agent_request_confirmation(auth->agent, device, passkey, > > confirm_cb, auth, NULL); > > + } > > > > if (err < 0) { > > if (err == -EINPROGRESS) { > > -- > > 2.17.1 > > > Applied. > > -- > Luiz Augusto von Dentz