Hi,
Following my previous ticket on the matter, Moving from MITM to LESC , I have attempted to DFU an MITM bonded device to LESC code, such that the peripheral device will disconnect connections that are not lesc and mitm_protected (the disconnect on mitm_protection had already existed in our code before, as explained in my previous ticket).
As a result, the subsequent connection fails, since the LTK that was used for MITM-only encryption is not LESC.
I have also attempted to re-authenticate - but the peripheral disconnects the central given that a bond already exists..
As I see it, we have a few possible solutions:
- Given a connection that is already bonded+encrypted+mitm_protected but not lesc, peripheral should delete it's bond data on the central, and return a disconnect message which the central would then perceive as "erase LTK for this etag". This would initiate pairing from scratch (with LESC) on the subsequent connection. We are not fond of this solution, as we are not sure of all the security repercussions, and would not like a potential attacker to be able to cause us to delete bonds by pretending to be our central. If we would use this solution, it would only be as a patch until a better solution is reached, or this DFU is deemed impossible.
- Changing our aforementioned disconnect case from "not lesc or not mitm_protected" to "not mitm_protected or not encrypted". Again, the same questions arise.
- m_flag_allow_repairing is set to false in our code - we could set it potentially to true, allowing us to authenticate even if an LTK already exists on the central.
My question in essence is:
- Is one of the aforementioned solutions good practice? If so, which one?
- If not - what is the best practice to DFU peripherals in the field from mitm only to mitm+LESC? Is this possible?
Thanks!
Roi