zephyr BLE host security manager layer error code is not accessible from upper layers
Describe the bug
Currently the SM (Security Manager) pairing failures are not reported to the users, however they are converted into public security failure.
- IMO it is valuable from users' perspective to know what is the actual SM layer failure is in order to be able to act on it. I am not sure if all SM pairing failures are handled to full extend.
- Qualification test case SM/CEN/JW/BI-06-C requires verifying SM failure during test but currently it is not accessible from test application and there is no API for it.
Zephyr Host Error Conversion: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/host/smp.c#L477
Workaround in AutoPTS to be able to pass the test: https://github.com/auto-pts/auto-pts/pull/1628
Regression
- This is a regression.
Steps to reproduce
No response
Relevant log output
Impact
Functional Limitation – Some features not working as expected, but system usable.
Environment
No response
Additional Context
My proposal to solve this problem is to add API to retrieve the latest SM failure which is kept in SM layer, instead of updating the Public security error logs altogether, that way the host user can retrieve latest failure in pairing_failed callback if needed.
Source: zephyrproject-rtos/zephyr