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

Improve Bluetooth HCI Command packet definition #4088

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

benquike
Copy link
Contributor

@benquike benquike commented Aug 5, 2023

  • Divide opcode into ogf and ocf following Core Spec
  • Redefine existing HCI commands with new format

Checklist:

  • If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
  • I squashed commits belonging together
  • I added unit tests or explained why they are not relevant
  • I executed the regression tests (using cd test && ./run_tests or tox)
  • If the PR is still not finished, please create a Draft Pull Request

The ogf and ocf fields in the Bluetooth HCI Command Header are grouped together,
making it difficult to check these individual fields and mapping them back to packet definitions in
Core spec.

This change divide the opcode field into ogf and ocf bitfields following the defitions in core spec.

@codecov
Copy link

codecov bot commented Aug 5, 2023

Codecov Report

Merging #4088 (98d96ef) into master (2fe5cee) will increase coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is 96.61%.

❗ Current head 98d96ef differs from pull request most recent head a1a5e03. Consider uploading reports for the commit a1a5e03 to get more accurate results

@@            Coverage Diff             @@
##           master    #4088      +/-   ##
==========================================
+ Coverage   81.95%   81.97%   +0.01%     
==========================================
  Files         328      328              
  Lines       75852    75897      +45     
==========================================
+ Hits        62163    62213      +50     
+ Misses      13689    13684       -5     
Files Changed Coverage Δ
scapy/layers/bluetooth.py 87.09% <96.61%> (+0.77%) ⬆️

... and 9 files with indirect coverage changes

@benquike benquike force-pushed the master branch 2 times, most recently from 8942fbf to 4a48d02 Compare August 9, 2023 07:25
@benquike benquike requested a review from gpotter2 August 9, 2023 07:27
- Divide opcode into ogf and ocf following Core Spec
- Redefine existing HCI commands with new format
@gpotter2
Copy link
Member

You have quite a bunch of failing tests. Could you fix those? Thanks

@gpotter2
Copy link
Member

Please do not run an auto-formatter. This brings many un-necessary changes to the PR making it harder to review, and breaking the history. Could you revert this commit and only fix the formatting of your own changes? Thanks

1. Fix some outdated command definitions
2. Fix the names of commands, use the formal name from core spec
3. Fix the some of the tests
@benquike
Copy link
Contributor Author

benquike commented Aug 25, 2023

@gpotter2 Can you please have another look?

@gpotter2 gpotter2 merged commit 8eab848 into secdev:master Aug 25, 2023
19 checks passed
@gpotter2
Copy link
Member

Thanks for the PR !

@gpotter2 gpotter2 added this to the 2.6.0 milestone Nov 28, 2023
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

Successfully merging this pull request may close these issues.

2 participants