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

Make TagNumber support tags beyond 30. #1651

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

Conversation

turbocool3r
Copy link
Contributor

This is a smaller version of #1416, but for 32-bit tag numbers.

The PR is intentionally small and only changes handling of Tag and TagNumber types.

The use case for 32-bit tag numbers instead of 16-bit is the Image4 format used in apple firmware files which needs PRIVATE tags with 32-bit numbers.

Breaking changes from the original PR:

  • TagNumber::new() and TagNumber::value() use u32 now
  • Conversions from and to u8 for Tag and TagNumber do not make sense anymore, this also applies to Tag::octet()
  • Length::for_tlv() just assumed, that a tag is always one byte, it now somehow needs to know about the specific tag we are looking at

@turbocool3r turbocool3r force-pushed the larger-tags branch 2 times, most recently from c1113a2 to 7c4d003 Compare February 8, 2025 23:41
@turbocool3r
Copy link
Contributor Author

Added tests from #1416, fixed non-conforming behavior.

@turbocool3r turbocool3r force-pushed the larger-tags branch 2 times, most recently from c70363b to 314218f Compare February 15, 2025 07:31
@sethmoo
Copy link

sethmoo commented Feb 20, 2025

Thanks for the patch! Looks good to me.

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.

3 participants