Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting non-default IRK #887

Open
jimmo opened this issue Nov 26, 2020 · 2 comments
Open

Allow setting non-default IRK #887

jimmo opened this issue Nov 26, 2020 · 2 comments

Comments

@jimmo
Copy link

jimmo commented Nov 26, 2020

hi! I'm from the MicroPython project, where we use NimBLE as our BLE stack (on top of a few different HCI controllers). I've recently been doing some work with pairing & bonding, and seem to be missing something important -- I can't see a way to not use the default IRK ble_hs_pvcy_default_irk.

ble_hs_pvcy_set_our_irk is in a private header (ble_hs_pvcy_priv.h), and even if it wasn't there's no way to avoid it already being called at startup (ble_hs_startup_go calls ble_hs_pvcy_set_our_irk(NULL))

But even if do use ble_hs_pvcy_set_our_irk is in a private header (ble_hs_pvcy_priv.h), and even if it wasn't there's no way to avoid it already being called at startup to re-set it in sync_cb or somewhere, then now all the peer IRK entries loaded from my key store will be thrown away, so I'd have to call ble_hs_misc_restore_irks to re-load them. But that's also in a private header.

I notice in #517 there's a reference to "setting a custom IRK". I'm not sure what the mechanism to set a custom IRK is, but in our case (MicroPython) this should ideally be able to be generated and set at runtime (i.e. not a syscfg option).

How are other NimBLE implementors using a non-default IRK in their devices? Thanks!

jimmo added a commit to jimmo/micropython that referenced this issue Nov 27, 2020
This provides a workaround for apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
dpgeorge pushed a commit to dpgeorge/micropython that referenced this issue Nov 30, 2020
This provides a workaround for apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
dpgeorge pushed a commit to dpgeorge/micropython that referenced this issue Dec 2, 2020
This provides a workaround for apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
dpgeorge pushed a commit to dpgeorge/micropython that referenced this issue Dec 2, 2020
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Dec 22, 2020
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Dec 28, 2020
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Jan 10, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Feb 1, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Feb 1, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Feb 15, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Feb 15, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Mar 10, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Mar 10, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Mar 10, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Apr 9, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pfalcon pushed a commit to pfalcon/pycopy that referenced this issue Apr 18, 2021
This provides a workaround for
apache/mynewt-nimble#887.

Without this, all devices would share a fixed default IRK.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
@jimmo
Copy link
Author

jimmo commented Aug 25, 2022

Hi NimBLE team, just wondering if you have any update on this. In MicroPython we continue to use a workaround similar to what I described above via the private functions. If other implementors are not doing this though, it is a big privacy issue to have all devices sharing the same IRK (as it allows tracking).

See also espressif#24

@sjanc
Copy link
Contributor

sjanc commented Nov 3, 2022

Hi,

#1396 is an initial step to handle this (at some point we should remove fixed IRK and just use random)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants