Re: [Bluez PATCH 3/3] adapter: Remove "Master" entry from LTK storage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luiz,

On Tue, 2 Nov 2021 at 14:13, Luiz Augusto von Dentz
<luiz.dentz@xxxxxxxxx> wrote:
>
> Hi Archie,
>
> On Sun, Oct 31, 2021 at 11:06 PM Archie Pusaka <apusaka@xxxxxxxxxx> wrote:
> >
> > From: Archie Pusaka <apusaka@xxxxxxxxxxxx>
> >
> > 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.
>
Got it. Then I would prefer to wait until this series of patches is
merged before removing the file conversion.

> >
> >  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.
>
Probably these "convert" methods precedes the "split LTK entries into
central and peripheral" decision, and this setting is unintentionally
left out when splitting LTKs.

> >         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

Thanks,
Archie



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux