Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3870092pxb; Mon, 1 Nov 2021 23:14:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJximo16TIIjdSxxzNFASuYfh0a9eQq4Od0FWemYa4ShoIm4nW6uyK+mPsSEqi9wE2w/HAIx X-Received: by 2002:a05:6e02:1a83:: with SMTP id k3mr9783387ilv.202.1635833677099; Mon, 01 Nov 2021 23:14:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635833677; cv=none; d=google.com; s=arc-20160816; b=bVGKOyDsRRWGwqv8Dp6/AoyjpdXQFL/usrBLxAzV7R9Nl5/g0LUgDrephHl7OQWPYU qCT0eKLgPiqIM9L2VKfR8LqkqT7qd8OoXBlCBy2SHSkr3N79NNZ78v8FfhSJqgXIFxps km1AwBL6Bat8vl8kAoSYF59wBpDLG52QAta+U0N0FIGeJLL0RiOzm0jQ0Xf6Sj86uc7V eJUjUEp8/Qj97riT6DLI5Zyt01NqOrMAeT1x8h6xTWtU7/pNn94zJJcQmt8uQbgLkAjY sP2bi0rw0OGYIXAg693uiLW7RpzgUL+Wf5kRH7WMgaNVtOcBATBsSQEKhq1Oe9SN0c+n BvuQ== 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=G6Yad7puWQwWtkvh/WEGeT+Dug1fEBf8eSfMTl14pcc=; b=up/MyO7c+oUwd2t+ZFyEA1QVQmyQrAp146d2Q5hBzsXozQFHZ2muI3ZZlU8oqTabEU q6EpEtHxoTOdhPHDf8PmAJCZJkRHxffAhO4QjbuIVlZAd55iJ2yAHTdxnKkBr3W2z+0y zOw/U8XV86C4xQ5mVmhhvRz1Uhb+rPczr9BRVX4xOZwcoKFJYFrYsFdg/4I8/VTswU0X 2YZxaByVcdZlvc1glGIJhg5vfH2HHkcHXQFHoyFW1qLThZTlX/XQxuFOb1MwoZgKcINB 1WYLJpb/S5exjxQMX7bVyHSg3Zsyl7udskDI7HyF6/w49ls78mCkYglJGsrFMveiit/A drlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dwqFaBbq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si6644059ila.39.2021.11.01.23.14.11; Mon, 01 Nov 2021 23:14:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dwqFaBbq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 S229505AbhKBGQL (ORCPT + 99 others); Tue, 2 Nov 2021 02:16:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhKBGQK (ORCPT ); Tue, 2 Nov 2021 02:16:10 -0400 Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DAE2C061714 for ; Mon, 1 Nov 2021 23:13:36 -0700 (PDT) Received: by mail-ua1-x930.google.com with SMTP id v20so35968272uaj.9 for ; Mon, 01 Nov 2021 23:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G6Yad7puWQwWtkvh/WEGeT+Dug1fEBf8eSfMTl14pcc=; b=dwqFaBbqAjHfflqB16RlY3Rz3Sa0zHjh2SrLXP4C4tF98GTEx25ylTkFECQBL8yVAs AflvymD81VBlJueSsJCrNu69+QSIGryFPC045gKNiN/+TdCNtmIrQi1YMpmHM6gI7YHk zaQleSezaOUnIaEig6aIQ68rRGShB4wg1nhiPFASsPVRLqZ85BY/mpvETtFxBWd3irzF 2aHA7lj6SSR6FQVFWSH6PBTAg/mRhAnNbb1uXV43yTzRCO22QR7u0Ry/zKJ8h1cDsZkT txIHRbLNYXDt4T1ddD4aUe2gUuChByfAvUR4ge3JJ5d0xli1XWxllTmEAzWK2N8suZzW tdQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G6Yad7puWQwWtkvh/WEGeT+Dug1fEBf8eSfMTl14pcc=; b=ZiOSa+xolNCQtGBwH2i0FBYhXApeGy3/AOEPjBQPAH4UgnAZw1OQo1ZU/rfqtJOzoJ Wae2SA3N3Krd58+72/ZX13XR+5JbJHaz3ZBvAPSbWjFxD6QXO8L33UjbCaf0G/gHl6xN c41IvhN7z7ncAQA56EpjoOfpH4bFbo3ERrPMm3p/Q2KPYsEcueBzRsH0M2ou0vEz1BjF QbT73/6ZWqvh9lMUcxT+UO0VXxv27uRLlPjBxRgZKHwjge191AKOJ8RkeZZh9TqzxwaP E0cmy4al3QFtKJkfsV1SlCzD/Tr1MTwVG4Mc1L/FpMw7FTiejoTLnwk++NqvhLlp1QxX qq2Q== X-Gm-Message-State: AOAM533HCDLNb7jGJ3E2ybzuJeoQ8JZra0VQ4T3d4tPqeONol/RC5rDk 4czxTkh8gjzTqDcDFXVuyliPOKMoIUYcyjy8CjQ= X-Received: by 2002:a67:b844:: with SMTP id o4mr37322213vsh.61.1635833615279; Mon, 01 Nov 2021 23:13:35 -0700 (PDT) MIME-Version: 1.0 References: <20211101140544.Bluez.1.I515833d2764b8ec2ac2bb1f87313de80ebb497cd@changeid> <20211101140544.Bluez.3.Idb95ae18113225915b97a4f06983e1e41a7f7a2e@changeid> In-Reply-To: <20211101140544.Bluez.3.Idb95ae18113225915b97a4f06983e1e41a7f7a2e@changeid> From: Luiz Augusto von Dentz Date: Mon, 1 Nov 2021 23:13:24 -0700 Message-ID: Subject: Re: [Bluez PATCH 3/3] adapter: Remove "Master" entry from LTK storage To: Archie Pusaka Cc: linux-bluetooth , Marcel Holtmann , CrosBT Upstreaming , Archie Pusaka Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Archie, On Sun, Oct 31, 2021 at 11:06 PM Archie Pusaka wrote: > > From: Archie Pusaka > > The entry has been deprecated since 2014 and it's time to remove them > altogether. > --- > Hi maintainers, > While cleaning this entry, I found that this entry is involved in some > kind of storage file conversion, probably when upgrading BlueZ 4 to 5. > Should we also remove the file conversion too, since it's dated to > 2014 as well? Perhaps we can but I'd had such cleanup as a separate patch then. > > src/adapter.c | 12 ------------ > 1 file changed, 12 deletions(-) > > diff --git a/src/adapter.c b/src/adapter.c > index 6b12c9e793..3a3c957a6c 100644 > --- a/src/adapter.c > +++ b/src/adapter.c > @@ -3779,8 +3779,6 @@ static struct smp_ltk_info *get_ltk(GKeyFile *key_file, const char *peer, > uint8_t peer_type, const char *group) > { > struct smp_ltk_info *ltk = NULL; > - GError *gerr = NULL; > - bool central; > char *key; > char *rand = NULL; > > @@ -3836,12 +3834,6 @@ static struct smp_ltk_info *get_ltk(GKeyFile *key_file, const char *peer, > NULL); > ltk->ediv = g_key_file_get_integer(key_file, group, "EDiv", NULL); > > - central = g_key_file_get_boolean(key_file, group, "Master", &gerr); > - if (gerr) > - g_error_free(gerr); > - else > - ltk->central = central; > - > ltk->is_blocked = is_blocked_key(HCI_BLOCKED_KEY_TYPE_LTK, > ltk->val); > > @@ -5904,7 +5896,6 @@ static void convert_ltk_entry(GKeyFile *key_file, void *value) > g_free(str); > > g_key_file_set_integer(key_file, "LongTermKey", "Authenticated", auth); > - g_key_file_set_integer(key_file, "LongTermKey", "Master", central); Weird that it still was setting the "Master" even though this is meant to convert the old format into the new one. > g_key_file_set_integer(key_file, "LongTermKey", "EncSize", enc_size); > g_key_file_set_integer(key_file, "LongTermKey", "EDiv", ediv); > > @@ -8445,9 +8436,6 @@ static void store_ltk_group(struct btd_adapter *adapter, const bdaddr_t *peer, > g_error_free(gerr); > } > > - /* Old files may contain this so remove it in case it exists */ > - g_key_file_remove_key(key_file, "LongTermKey", "Master", NULL); > - > for (i = 0; i < 16; i++) > sprintf(key_str + (i * 2), "%2.2X", key[i]); > > -- > 2.33.1.1089.g2158813163f-goog > -- Luiz Augusto von Dentz