Skip to content

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
@turbocool3r turbocool3r force-pushed the larger-tags branch 2 times, most recently from ca567e0 to 57b15ea Compare February 20, 2025 09:00
@sethmoo
Copy link

sethmoo commented Feb 20, 2025

Thanks for the patch! Looks good to me.

@turbocool3r
Copy link
Contributor Author

Rebased onto last master, fixed clippy's suggestions

@baloo baloo merged commit 42b178a into RustCrypto:master Feb 25, 2025
106 checks passed
@turbocool3r turbocool3r deleted the larger-tags branch February 26, 2025 08:23
tarcieri added a commit that referenced this pull request Mar 18, 2025
After #1651 the inner `u32` of `TagNumber` is now `pub` and the
`TagNumber::new` function no longer maintains an invariant (which it
previously did by panicking when tag numbers are out-of-range).

With the field now `pub` there is no longer a need to call a function to
construct a `TagNumber`, instead it can be done directly.
tarcieri added a commit that referenced this pull request Mar 18, 2025
After #1651 the inner `u32` of `TagNumber` is now `pub` and the
`TagNumber::new` function no longer maintains an invariant (which it
previously did by panicking when tag numbers are out-of-range).

With the field now `pub` there is no longer a need to call a function to
construct a `TagNumber`, instead it can be done directly.
tarcieri added a commit that referenced this pull request Mar 18, 2025
After #1651 the inner `u32` of `TagNumber` is now `pub` and the
`TagNumber::new` function no longer maintains an invariant (which it
previously did by panicking when tag numbers are out-of-range).

With the field now `pub` there is no longer a need to call a function to
construct a `TagNumber`, instead it can be done directly.
tarcieri added a commit that referenced this pull request Mar 18, 2025
After #1651 the inner `u32` of `TagNumber` is now `pub` and the
`TagNumber::new` function no longer maintains an invariant (which it
previously did by panicking when tag numbers are out-of-range).

With the field now `pub` there is no longer a need to call a function to
construct a `TagNumber`, instead it can be done directly.
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.

4 participants