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

Bluetooth: SSP: Improve BR SC only mode #78837

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lylezhu2012
Copy link
Contributor

Actively disconnect the connection with error code BT_HCI_ERR_AUTH_FAIL when the notified link key type is not BT_LK_AUTH_COMBINATION_P256 in BR SC only mode.

Comment on lines 446 to 447
if (IS_ENABLED(CONFIG_BT_SMP_SC_ONLY) &&
(!(evt->key_type == BT_LK_AUTH_COMBINATION_P256))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix your split line indentation and alignement. It should be N tabs + 0-7 spaces so that you align right after the ( of the previous line. The clang-format inline annotations point this out as well.

Copy link
Contributor Author

@lylezhu2012 lylezhu2012 Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I noticed it. I recently discovered that Zephyr's tab occupies 8 character positions.

I was just wondering why there was a compliance issue before. Actually, I pay attention to these formats when making commits.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Comment on lines 456 to 457
LOG_ERR("For SC only mode, link key type should be %d",
BT_LK_AUTH_COMBINATION_P256);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor Author

@lylezhu2012 lylezhu2012 Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

@lylezhu2012 lylezhu2012 force-pushed the ssp_improve_br_sc_only_mode branch 2 times, most recently from a8e779b to cab5898 Compare November 4, 2024 07:26
Comment on lines 455 to 456
LOG_ERR("For SC only mode, link key type should be %d",
BT_LK_AUTH_COMBINATION_P256);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small improvement still: the convention when we get unexpected/invalid data from the controller is to use LOG_WRN() instead of LOG_ERR().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Updated.

Actively disconnect the connection with error code `BT_HCI_ERR_AUTH_FAIL`
when the notified link key type is not `BT_LK_AUTH_COMBINATION_P256` in
BR SC only mode.

Signed-off-by: Lyle Zhu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants