-
Notifications
You must be signed in to change notification settings - Fork 6
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
FEAT: extend dynamically allocated evidence array by additionalCapacity #59
Conversation
in case derived evidence is to be added on the fly during device detection (f.e. derived from 51d_gethighentropyvalues)
decision is to make an additional array to hold extra evidence, rather than instruct on the call site |
… going to be exceeded when new evidence is added a new array is created and linked to the original one. This is needed to avoid situations where GHEV or other dynamic evidence is unpacked and there is insufficient capacity in the original evidence array. The developer would receive unpredicatable results and it would not be obvious where the problem is. The dynamic allocation of more memory for evidence can be avoided by specifying a sufficiently large evidence capacity when the initial evidence array is created. The void pointer used in pairs and evidence pairs has been removed and the KeyValuePair with character pointers used throughout. This reduces problems with casting void pointers for no reason. The evidence key value pair now uses the key value pair to reduce duplication and ensure that all strings have length fields to reduce calls to strlen and to handle GHEV evidence where the string may not be null terminated. Code that expects the keys, values, or parsed value to be null terminated now needs to use the length field to get the number of characters. If a null terminated version is needed then the caller will need to make a copy and add a null terminator.
… this now that evidence can be expanded dynamically.
…red headers and evidence.
The implementation works for me, there was a minor check added to Two considerations:
|
Re: Realloc - It is more important to make the feature available than add new memory management code for a fringe case. We can consider realloc support in version 5. |
Unit Tests - Mac_x64_Debug518 tests 518 ✅ 6s ⏱️ Results for commit 071b5a7. |
Unit Tests - Ubuntu_x64_Debug520 tests 520 ✅ 4s ⏱️ Results for commit 071b5a7. |
Integration Tests - Mac_x64_Debug0 tests 0 ✅ 0s ⏱️ Results for commit 071b5a7. |
Unit Tests - Ubuntu_x86_Debug520 tests 520 ✅ 5s ⏱️ Results for commit 071b5a7. |
Integration Tests - Ubuntu_x64_Debug0 tests 0 ✅ 0s ⏱️ Results for commit 071b5a7. |
Unit Tests - Ubuntu_x86_Release520 tests 520 ✅ 2s ⏱️ Results for commit 071b5a7. |
Integration Tests - Ubuntu_x86_Debug0 tests 0 ✅ 0s ⏱️ Results for commit 071b5a7. |
Integration Tests - Ubuntu_x86_Release0 tests 0 ✅ 0s ⏱️ Results for commit 071b5a7. |
Unit Tests - Ubuntu_x64_Release520 tests 520 ✅ 2s ⏱️ Results for commit 071b5a7. |
Performance Tests - Ubuntu_x86_Release0 tests 0 ✅ 0s ⏱️ Results for commit 071b5a7. |
Integration Tests - Ubuntu_x64_Release0 tests 0 ✅ 0s ⏱️ Results for commit 071b5a7. |
Performance Tests - Ubuntu_x64_Release0 tests 0 ✅ 0s ⏱️ Results for commit 071b5a7. |
Unit Tests - Windows_VS_x86_Release498 tests 498 ✅ 4s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Unit Tests - Windows_x86_Debug520 tests 520 ✅ 14s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Unit Tests - Windows_x64_Release520 tests 520 ✅ 8s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Integration Tests - Windows_VS_x86_Release0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Unit Tests - Windows_VS_x86_Debug498 tests 498 ✅ 6s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Integration Tests - Windows_x86_Debug0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Unit Tests - Windows_x86_Release520 tests 520 ✅ 8s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Unit Tests - Windows_VS_x64_Debug498 tests 498 ✅ 7s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Unit Tests - Windows_x64_Debug520 tests 520 ✅ 14s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Unit Tests - Windows_VS_x64_Release498 tests 498 ✅ 5s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Integration Tests - Windows_x86_Release0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Integration Tests - Windows_VS_x64_Debug0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Integration Tests - Windows_x64_Debug0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Integration Tests - Windows_VS_x64_Release0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Performance Tests - Windows_x86_Release0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. ♻️ This comment has been updated with latest results. |
Integration Tests - Windows_VS_x86_Debug0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. |
Integration Tests - Windows_x64_Release0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. |
Performance Tests - Windows_x64_Release0 tests 0 ✅ 0s ⏱️ Results for commit 54d8c7f. |
in case derived evidence is to be added on the fly during device detection (f.e. derived from 51d_gethighentropyvalues)