Skip to content

fix(cri): iterate SET contents in iter_raw_values(), not SET TLV#238

Open
sumleo wants to merge 1 commit intorusticata:masterfrom
sumleo:fix/cri-iter-raw-values
Open

fix(cri): iterate SET contents in iter_raw_values(), not SET TLV#238
sumleo wants to merge 1 commit intorusticata:masterfrom
sumleo:fix/cri-iter-raw-values

Conversation

@sumleo
Copy link

@sumleo sumleo commented Feb 15, 2026

Summary

  • X509CriAttribute::iter_raw_values() was iterating over self.value which contains the full SET TLV (tag + length + content)
  • This caused the iterator to yield the entire SET as a single item rather than iterating over the individual AttributeValue entries inside it
  • Fixed by parsing past the SET header before creating the iterator, so it correctly yields each value in the SET

Test plan

  • Full test suite passes with cargo test --all-features

Copy link
Collaborator

@cpu cpu left a comment

Choose a reason for hiding this comment

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

I think this fix is another candidate where test coverage would be helpful.

// to iterate over the individual values inside the SET
let content = match <Set>::parse_der_as_input(self.value.clone()) {
Ok((_, (_, content))) => content,
Err(_) => Input::default(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems reasonable for this context, but might be worth mentioning in the rustdoc.

@sumleo sumleo force-pushed the fix/cri-iter-raw-values branch from 6417207 to 50ceefc Compare February 23, 2026 01:16
Previously iter_raw_values() iterated over the full SET TLV, yielding
the SET itself as a single item. Now it parses past the SET header and
iterates over the individual values inside the SET.

Updated rustdoc to document that the method returns raw DER content of
each value within the SET. Added tag assertions in tests to verify that
returned items are the inner values (e.g. UTF8String, SEQUENCE) rather
than the SET envelope.
@sumleo sumleo force-pushed the fix/cri-iter-raw-values branch from 50ceefc to 254fa3b Compare March 10, 2026 01:16
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