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

Update security environment variables #617

Merged
merged 13 commits into from
Apr 16, 2020
Prev Previous commit
Next Next commit
Fix redefinition of get_env_error_str
Signed-off-by: ruffsl <[email protected]>
ruffsl committed Apr 16, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 68a356ef59d7e29e9505a917b3931d75d24b2bd5
15 changes: 8 additions & 7 deletions rcl/src/rcl/security.c
Original file line number Diff line number Diff line change
@@ -139,11 +139,12 @@ char * rcl_get_secure_root(
if (NULL == name) {
return NULL;
}


const char * get_env_error_str = NULL;
// check if enclave override environment variable is empty
char * error_str = rcutils_get_env(ROS_SECURITY_ENCLAVE_OVERRIDE, &env_buf);
if (error_str) {
RCUTILS_LOG_ERROR("rcutils_get_env failed: %s\n", error_str);
get_env_error_str = rcutils_get_env(ROS_SECURITY_ENCLAVE_OVERRIDE, &env_buf);
if (NULL != get_env_error_str) {
RCUTILS_LOG_ERROR("rcutils_get_env failed: %s\n", get_env_error_str);
return NULL;
}
if (!env_buf) {
@@ -155,9 +156,9 @@ char * rcl_get_secure_root(
char * ros_secure_enclave_override_env = rcutils_strdup(env_buf, *allocator);

// check if keystore environment variable is empty
char * error_str = rcutils_get_env(ROS_SECURITY_KEYSTORE_VAR_NAME, &env_buf);
if (error_str) {
RCUTILS_LOG_ERROR("rcutils_get_env failed: %s\n", error_str);
get_env_error_str = rcutils_get_env(ROS_SECURITY_KEYSTORE_VAR_NAME, &env_buf);
if (NULL != get_env_error_str) {
RCUTILS_LOG_ERROR("rcutils_get_env failed: %s\n", get_env_error_str);
allocator->deallocate(ros_secure_enclave_override_env, allocator->state);
return NULL;
}