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

Numeric Comparison and Passkey Entry are not properly handled #114

Open
csmith-morningstar opened this issue Apr 14, 2023 · 1 comment · May be fixed by #117
Open

Numeric Comparison and Passkey Entry are not properly handled #114

csmith-morningstar opened this issue Apr 14, 2023 · 1 comment · May be fixed by #117
Labels
bug Something isn't working

Comments

@csmith-morningstar
Copy link
Contributor

In NimBLEServer.cpp: Currently Numeric Comparison and Passkey Entry (BLE_SM_IOACT_NUMCMP and BLE_SM_IOACT_INPUT respectively) perform blocking calls to callbacks in order to determine the input for ble_sm_inject_io. However, this prevents the SMP Timeout (Vol. 3 Part H Section 3.4 of the Bluetooth 4.2 spec) from properly triggering, as those functions may pend too long waiting for user input.

Furthermore, even if the callbacks do properly timeout themselves, there is no way for them to properly align with the spec, which states that in the event of a timeout "No further SMP commands shall be sent over the L2CAP Security Manager Channel." This is because when the callbacks return, ble_sm_inject_io is always called, which results in a "Pairing Failed" command being sent over the SMP channel.

Instead of relying on blocking function calls, these two scenarios should initiate the callbacks only as a means of displaying a prompt to the user, and relying on an asynchronous event for the call to ble_sm_inject_io. This allows the timeout event to properly occur.

@h2zero h2zero added the bug Something isn't working label Apr 16, 2023
@h2zero
Copy link
Owner

h2zero commented Apr 16, 2023

Hello, yes you are absolutely correct, this has been on my radar to address for quite some time. I will look into fixing this when I get some free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants