Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp721537ybn; Wed, 2 Oct 2019 05:15:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmROSRp9lnTUMWfJMnjWU172wZZ1UMyZnCOt1XIEkH8qJC/jvjx9XREF8g4XiPu0uFaeLV X-Received: by 2002:a17:906:8c8:: with SMTP id o8mr2827860eje.56.1570018548771; Wed, 02 Oct 2019 05:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570018548; cv=none; d=google.com; s=arc-20160816; b=kg0VSLrsLds6kh/VRVU6UjHC3D30vPsW+hKD9phNB2NR3sIi31Bj/KkfUcPkQnWQU3 YKHtuC+ehvGhCt1UIDNDKNrdO/ePL22JJAo0nWPIaim9gKd2U0wtsV5RIq0DTO8/m6+I zZ1pvSyNNPGFkFETc4dyjQBgepZWrMdKCUOEYYXKaa6xgINBRu8EbnZmbBrd6J/dg4Dt nvrXsfZIX57NPBYTYwo6nnlbgK6DObLcBxtl5irW0gia/tRIK0Z1px9eMHKM17fjyADb ex3zCPeEgQxtvGL0YeIW0NAormGdarUgW1ef13syuFELSDSkCRrZ8hcBhK2IkwKlvkLm ijug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=aIVAhEc+aED2PL3PFqTqxHnMKJi7xBN6y9veQCT8VAw=; b=SJijjra2s/x2wkfcKOrCpxUWaNN/i5ehjM5iN78+FzOdWOw8u385zqMcruD8UuN/Gl x7E9vPMT+PiGT3RvIoS0kFYY5H4/VbjkhgG0DTtmuek352Up8iZZh+PjxVZViHK6xm9x Zyfy++iJkGPsEjpTvdKrPDQoCI3cMXtEH6wVfve0T+LQ2JQzXMWR6Vcn5eUR4iTbVNTq rikiVm6SSYDEHDtUUtukjUW3yZXz8CIBFP0rrTxx3aSRdjVZBpr589M694xHIy4F/6CS nbttFm5x0p6oubA1K4bM9ETbmoCPVPl4Pv0K7lnPIQ+dKxZkKqmMMGMbCnkeVKd4/wjD 8vag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=LKMf2vN4; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p38si11498497edc.449.2019.10.02.05.15.23; Wed, 02 Oct 2019 05:15:48 -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=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=LKMf2vN4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728108AbfJBLYV (ORCPT + 99 others); Wed, 2 Oct 2019 07:24:21 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43564 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfJBLYV (ORCPT ); Wed, 2 Oct 2019 07:24:21 -0400 Received: by mail-lf1-f68.google.com with SMTP id u3so12431484lfl.10 for ; Wed, 02 Oct 2019 04:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:in-reply-to :references:mime-version:content-transfer-encoding; bh=aIVAhEc+aED2PL3PFqTqxHnMKJi7xBN6y9veQCT8VAw=; b=LKMf2vN4zDiFfwnIylNQWlOmyEK224w0Tz4Gig8JHkIJMHWLF6DBGHrPG0PMhuv9j0 WhMHJywsTrNHVJPFLLbJNDgvflh9/pN/Bem0wAurZ6J8OrZOb5Sthu1nhziP33cx4ODH xXlcvaHgx8NuERvh9vW082Yc0SUHqTXpTgkv4chCtvIgQPIJb2ewnu0Y2E6MC8LMmf4Z nk9x6ebxFa8rYW+U99RTEJmG9P+7zXQjV4jcBQ9dLv9EghMBG/8rHwAQBbAvgKwfwbjF 039UiWAovZEOTQ6CGsvWz6lvgCm57w5BtpQ/pEQNtcGzKTuZse2jw+YrgBo6ISZCJy1S WkWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :in-reply-to:references:mime-version:content-transfer-encoding; bh=aIVAhEc+aED2PL3PFqTqxHnMKJi7xBN6y9veQCT8VAw=; b=PsvcvzcQRMAEwWb8OhDa9+GLuIQUtW6OREYeEbgtbLmh5G8SRGc7cQ9hfUizGLqh7V Z2l1PNrQvYUxVF+EpwL5ASPFQLn/Jse7/HJpHyidbvgxPhkTxPudURYdihnyUzbff5n1 wStCX4ZmmbXBo64+xdrB7b5wVmB4ucgRNAshhnOHjyCve/2dx8dyzfUkyH/N5cw4Op+W BRNmFICDnibGkvewzPFlQxBaJXTfQlJcBk5cOCjgEXozly6qZNLiJMijAeLVtVeSiuog YfkBN7D4daBLxKsSjJ4bjJZ6kh06z+zkZoS7OsN7nKr0p0hSHDo7Mu2+pPvkZ9vPp8Dy jIog== X-Gm-Message-State: APjAAAUQQ04cZCMhdrP1+guoBbZHfWJfCb16gw2yUP/IhN80AorX/HPR +0m/kIOSnKz+l8Gl8JzjR4/yCsXU324= X-Received: by 2002:a19:c396:: with SMTP id t144mr2069234lff.14.1570015458805; Wed, 02 Oct 2019 04:24:18 -0700 (PDT) Received: from ix.localnet ([95.143.243.62]) by smtp.gmail.com with ESMTPSA id q11sm4610884lje.52.2019.10.02.04.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 04:24:18 -0700 (PDT) From: Szymon Janc To: Ordit Gross Cc: linux-bluetooth@vger.kernel.org Subject: Re: recommended way to register on bluetooth event Date: Wed, 02 Oct 2019 13:24:16 +0200 Message-ID: <1580531.MKZco2byVY@ix> Organization: CODECOUP In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, On Tuesday, 1 October 2019 15:36:19 CEST Ordit Gross wrote: > hi all, > I would like to register on encryption changed event. > As far as I could tell mgmt-api does not consist of such capability. > I think that reading from an HCI socket may enable me to read all > events (and the needed one as well). > is there a better way of registering on encryption changed event? > > The reason I need this capability in the first place is that I want to > enable repairing if BLE Peripheral Removes Pairing keys. > currently, when the peripheral deletes his side of keys and attempt to > connect to master, the master will get encryption changed event with > error "PIN or Key Missing". > that's why I want to be notified on application that we got this > event, so I can delete my side of keys as well.. > > any suggestions? > thanks in advance!! > Ordit Ha, I was working on that few years back but unfortunatelly it never got in... mostly due to objections about dropping old keys before new pairing (which I don't think is necessary with proposed Agent consent-based approach but others were not sharing my view on this ;-). Kernel part with reporting proper error to userspace is done so userspace has all the information it needs. For bluetoothd I've sent RFC [1] which might give you a bit of headstart while working on this. In short, it extends Agent API with new call used to consent re-bond of remote device. [1] https://marc.info/?l=linux-bluetooth&m=147031736607899&w=2 -- pozdrawiam Szymon Janc