Skip to content

UUID cleanup #1892

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

Merged
merged 5 commits into from
Mar 22, 2019
Merged

UUID cleanup #1892

merged 5 commits into from
Mar 22, 2019

Conversation

micolous
Copy link
Contributor

@micolous micolous commented Mar 9, 2019

There are multiple implementations of a UUID-like field, and some places where we don't use this at all (but could!). This pull request merges them, and brings it into a new scapy.field.UUIDField.

This impacts s.l.bluetooth, s.l.dhcp6, s.c.dce_rpc, s.c.opc_da and s.c.pnio_rpc.

The new UUIDField always uses Python's uuid.UUID class as an internal representation (not all modules did this).

  • Merge functionality of s.l.bluetooth.BTUUIDField and s.c.dce_rpc.UUIDField into s.fields.UUIDField
  • Moves s.c.dce_rpc.RandUUID to s.volatile
  • Adds support for RFC 4122 "versioned" UUIDs to RandUUID, and adds tests
  • Moves UUIDField tests that don't use EndiannessField from s/c/dce_rpc.uts to t/regression.uts
  • dhcp6: Migrates DUID_UUID.uuid to UUIDField, and adds tests (tested only with regression tests, based on my reading of the RFC)
  • opc_da: Migrate from PUUID to UUIDField, removes PUUID (tested only with regression tests)
  • pnio_rpc: Fix regressions from dce_rpc changes (tested only with regression tests)
  • Fix re module stomping in t/regression.uts

Tests still pass on py2.7 and 3.7 (skipping root/netaccess tests)

micolous added 3 commits March 9, 2019 12:57
- Merge functionality of `s.l.bluetooth.BTUUIDField` and
  `s.c.dce_rpc.UUIDField`

- Moves `s.c.dce_rpc.RandUUID` to `s.volatile`

- Adds support for RFC 4122 "versioned" UUIDs to `RandUUID`, and adds tests

- Moves some `UUIDField` tests from `s/c/dce_rpc.uts` to `t/regression.uts`

- Migrates `s.l.dhcp6.DUID_UUID.uuid` to `UUIDField`, and adds tests

- Fix `re` stomping in `t/regression.uts`
@micolous micolous mentioned this pull request Mar 9, 2019
@gpotter2 gpotter2 added tests cleanup Performs some code clean-up labels Mar 9, 2019
@codecov
Copy link

codecov bot commented Mar 9, 2019

Codecov Report

Merging #1892 into master will increase coverage by 0.05%.
The diff coverage is 95.2%.

@@            Coverage Diff             @@
##           master    #1892      +/-   ##
==========================================
+ Coverage   85.88%   85.94%   +0.05%     
==========================================
  Files         187      187              
  Lines       42733    42750      +17     
==========================================
+ Hits        36701    36740      +39     
+ Misses       6032     6010      -22
Impacted Files Coverage Δ
scapy/layers/dhcp6.py 84.8% <ø> (ø) ⬆️
scapy/layers/bluetooth.py 87.01% <ø> (+0.19%) ⬆️
scapy/contrib/opc_da.py 79.41% <ø> (+0.67%) ⬆️
scapy/contrib/dce_rpc.py 97.82% <100%> (+2.98%) ⬆️
scapy/contrib/pnio_rpc.py 92.3% <100%> (+0.07%) ⬆️
scapy/fields.py 91.75% <94.11%> (+0.08%) ⬆️
scapy/volatile.py 78.34% <95.38%> (+1.91%) ⬆️
scapy/layers/inet6.py 88.23% <0%> (-0.06%) ⬇️
scapy/contrib/cdp.py 90.9% <0%> (ø) ⬆️
scapy/layers/l2.py 84.61% <0%> (+0.19%) ⬆️
... and 3 more

Copy link
Member

@gpotter2 gpotter2 left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Member

@p-l- p-l- left a comment

Choose a reason for hiding this comment

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

Thanks for that PR. Apart from my minor comment, that's OK for me.

@micolous
Copy link
Contributor Author

@p-l-: I have made all requested changes now, please take a look.

@gpotter2 gpotter2 merged commit 9f684dc into secdev:master Mar 22, 2019
micolous added a commit to micolous/scapy that referenced this pull request Mar 24, 2019
- Decodes iBeacon as a submessage of Apple's BLE broadcast frame format.
  Does not implement support for other types of Apple BLE broadcasts.

- Adds tests and example documentation.

This PR uses `UUIDField` from PR secdev#1892.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Performs some code clean-up tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants