-
Notifications
You must be signed in to change notification settings - Fork 249
tee-supplicant: support multiple TA load paths #311
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
Conversation
tee-supplicant/src/tee_supplicant.c
Outdated
| if (!ta_path_str) | ||
| goto err; | ||
|
|
||
| for (p = ta_path_str; *p; p++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this can be simplified with strtok_r().
strtok_r() is destructive so we'd need to copy path to ta_path_str again before the second loop.
etienne-lms
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a minor comment. @jforissier, my R-b tag unless you change the implementation as per @jenswi-linaro suggestion.
| * filesystem and return it back to the caller in the parameter ta. | ||
| * | ||
| * @prefix, @dev_path Where to load the TA from. The full path to the TA | ||
| * binary is @prefix/@dev_path/@destination.ta. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for consistency:
* @param: prefix Prefix for TA load path
* @param: dev_path Where to load the TA from. The full path to the TA
* binary is @prefix/@dev_path/@destination.ta.|
Comments addressed. |
etienne-lms
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
| } | ||
| n++; /* NULL terminator */ | ||
|
|
||
| ta_path = malloc(n * sizeof(char *)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last element in the array should be zeroed, perhaps calloc() here instead would be a better choice.
Edit: nevermind, I see that it indeed is zeroed when the loop is terminated below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also though it should but since line 730 breaks when ta_path[n++] is NULL, last element is properly inited to NULL, IIUC.
(edited):
Edit: nevermind, I see that it indeed is zeroed when the loop is terminated below.
Indeed. I've should have read your updated comment :)
|
|
Parse CFG_TEE_CLIENT_LOAD_PATH (TEEC_LOAD_PATH) and TEEC_TEST_LOAD_PATH as a colon-separated list of paths. This commit also updates the documentation of CFG_TEE_CLIENT_LOAD_PATH and try_load_secure_module() which were either lacking or incorrect. Suggested-by: Chao Chen <ccha@amazon.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Parse CFG_TEE_CLIENT_LOAD_PATH (TEEC_LOAD_PATH) and TEEC_TEST_LOAD_PATH
as a colon-separated list of paths. This commit also updates the
documentation of CFG_TEE_CLIENT_LOAD_PATH and try_load_secure_module()
which were either lacking or incorrect.
Suggested-by: Chao Chen ccha@amazon.com
Signed-off-by: Jerome Forissier jerome.forissier@linaro.org