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

Fix corner cases of handling of Common Name fallback encoding #28953

Conversation

woody-apple
Copy link
Contributor

Problem:

This PR:

  • Replaces the logic for fallback encoding conversion to take the first legitimate fully matching case for Mvid: and Mpid: and detect errors where either of these is present but without a following Mpid/Mvid.
  • Updates unit tests to improve coverage and to properly mark as invalid some cases marked invalid in spec which where deemed valid by prior code by mistake

Testing done:

  • Integration tests still pass (related to Commissioner DUT).
  • Test vectors updated.
  • New unit tests added.

* Fix corner cases of handling of Common Name fallback encoding

Problem:
- Appearance of a Mpid:/Mvid: in a DAC/PAI/PAA DN was deemed OK
  by previous code, but this caused a critical ambiguity in PAIs which
  would possibly cause fall-back to non-PID-scoped PAI interpretation.
- Related to https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/7470
- Fixes #28898

This PR:

- Replaces the logic for fallback encodign conversion to take
  the first legitimate fully matching case for Mvid: and Mpid:
  and detect errors where either of these is present but without
  a following Mpid/Mvid.
- Updates unit tests to improve coverage and to properly mark as
  invalid some cases marked invalid in spec which where deemed
  valid by prior code by mistake

Testing done:

- Integration tests still pass (relater to Commissioner DUT).
- Test vectors updated.
- New unit tests added.

* Restyled by clang-format

* Restyled by prettier-json

* Address review comments by revamping algorithm

* Fix leftover comment follow-ups from @bzbarsky-apple from #28899

* Restyled by clang-format

* Add more comments and fix clang-tidy

* Address more review comments

---------

Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
@andy31415
Copy link
Contributor

This is an auto-commit for an old SVE branch (probably due to label). Should not be done (branch not used anymore)

@andy31415 andy31415 closed this Aug 29, 2023
@andy31415 andy31415 deleted the cherry-pick-sve-2-70cbc02a07837a3f73ed552549f7f4ae4140211b branch October 3, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants