-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Do not load duplicate certs in ChipCertificateSet #7115
Merged
bzbarsky-apple
merged 3 commits into
project-chip:master
from
pan-apple:duplicate-certs
May 27, 2021
Merged
Do not load duplicate certs in ChipCertificateSet #7115
bzbarsky-apple
merged 3 commits into
project-chip:master
from
pan-apple:duplicate-certs
May 27, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size increase report for "gn_qpg6100-example-build" from 764df83
Full report output
|
Size increase report for "nrfconnect-example-build" from 764df83
Full report output
|
Size increase report for "esp32-example-build" from 764df83
Full report output
|
jmartinez-silabs
approved these changes
May 26, 2021
emargolis
approved these changes
May 26, 2021
andy31415
approved these changes
May 27, 2021
bzbarsky-apple
approved these changes
May 27, 2021
- Add an operator== on BitFlags class.connectedhomeip/src/credentials/CHIPCert.cpp Lines 617 to 627 in 9dddc28
This comment was generated by todo based on a
|
nikita-s-wrk
pushed a commit
to nikita-s-wrk/connectedhomeip
that referenced
this pull request
Sep 23, 2021
* Do not load duplicate certs in ChipCertificateSet * fix build issues * address review comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The certificate loading fails after a few tries when the same cert is loaded repeatedly.
Change overview
The
ChipCertificateSet::LoadCert
doesn't check if the cert (being loaded) is already present in the certificate set. It parses it and adds it to the set. The current limit of certs in a set is set to 4 (3 in tests). This PR adds a new method toChipCertificateData
to compare two certificates. TheLoadCert()
loads the certificate in a temporaryChipCertificateData
instance, and compares it to the existing certs. If the cert is not found, it gets copied to one of the available slot in the set. If the set has no available slot, the function will return error.Testing
Added a new unit test
TestChipCert_LoadDuplicateCerts
to test this behavior.The rest of
TestChipCert
test suite ensures no existing functionality is broken.