-
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
Validate entropy init and random number generator on all platforms #10454
Comments
tcarmelveilleux
added a commit
to tcarmelveilleux/connectedhomeip
that referenced
this issue
Oct 13, 2021
- Add a temporary audit function in ExchangeMgr.cpp. - ExchangeMgr.cpp is used because it is used by both `DeviceController` and `Server` (i.e. by all modalities) and it already relies on random numbers. - Audit must be run manually since it needs to be done on targets and comparisons across reboot. - Audit validates `GetRandU*` and `Crypto::DRBG_get_bytes()`, which may both use different underlying impl. Testing done: - Unit tests pass - Manually tested on Linux by commenting-out `srand(seed);` in Entropy.cpp, which forces `GetRandU*` to give the same values across calls. - If you are testing this, search for lines starting with `AUDIT:` in the log. Issue project-chip#10454
tcarmelveilleux
added a commit
to tcarmelveilleux/connectedhomeip
that referenced
this issue
Oct 13, 2021
- Add a temporary audit function in ExchangeMgr.cpp. - ExchangeMgr.cpp is used because it is used by both `DeviceController` and `Server` (i.e. by all modalities) and it already relies on random numbers. - Audit must be run manually since it needs to be done on targets and comparisons across reboot. - Audit validates `GetRandU*` and `Crypto::DRBG_get_bytes()`, which may both use different underlying impl. Testing done: - Unit tests pass - Manually tested on Linux by commenting-out `srand(seed);` in Entropy.cpp, which forces `GetRandU*` to give the same values across calls. - If you are testing this, search for lines starting with `AUDIT:` in the log. Issue project-chip#10454
tcarmelveilleux
added a commit
that referenced
this issue
Oct 14, 2021
* Introduce a RNG determinism audit - Add a temporary audit function in ExchangeMgr.cpp. - ExchangeMgr.cpp is used because it is used by both `DeviceController` and `Server` (i.e. by all modalities) and it already relies on random numbers. - Audit must be run manually since it needs to be done on targets and comparisons across reboot. - Audit validates `GetRandU*` and `Crypto::DRBG_get_bytes()`, which may both use different underlying impl. Testing done: - Unit tests pass - Manually tested on Linux by commenting-out `srand(seed);` in Entropy.cpp, which forces `GetRandU*` to give the same values across calls. - If you are testing this, search for lines starting with `AUDIT:` in the log. Issue #10454 * Move audit to InitEntropy() - InitEntropy is in `GenericPlatformManagerImpl` and should always be called. Lack of the logs will help catch bad init. * Restyled by clang-format * Apply suggestions from code review Co-authored-by: Boris Zbarsky <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
All platforms have passed the audit |
tcarmelveilleux
added a commit
to tcarmelveilleux/connectedhomeip
that referenced
this issue
Nov 9, 2021
- Remove the temporary RNG entropy audit now that project-chip#10454 is complete. Fixes project-chip#10454 Fixes project-chip#10526 Fixes project-chip#10527
woody-apple
pushed a commit
to tcarmelveilleux/connectedhomeip
that referenced
this issue
Nov 9, 2021
- Remove the temporary RNG entropy audit now that project-chip#10454 is complete. Fixes project-chip#10454 Fixes project-chip#10526 Fixes project-chip#10527
bzbarsky-apple
pushed a commit
that referenced
this issue
Nov 9, 2021
PSONALl
pushed a commit
to PSONALl/connectedhomeip
that referenced
this issue
Dec 3, 2021
- Remove the temporary RNG entropy audit now that project-chip#10454 is complete. Fixes project-chip#10454 Fixes project-chip#10526 Fixes project-chip#10527
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Entropy initialization for
DRBG_get_bytes()
and random number generation (rand()
from C++ standard library,GetRandU*()
) is done per platform, often in*PlatformManagerImpl<ImplClass>::_InitChipStack()
.It was found that the methods are varied and there are no tests (and no easy test, given the methods used) to ensure entropy sources are initialized properly and across the board.
Proposed Solution
The text was updated successfully, but these errors were encountered: