Skip to content

Commit

Permalink
Rename keystore root env from ROS_SECURITY_ROOT_DIRECTORY to ROS_SECU…
Browse files Browse the repository at this point in the history
…RITY_KEYSTORE (#200)

Signed-off-by: ruffsl <[email protected]>
  • Loading branch information
ruffsl authored Apr 16, 2020
1 parent ebc1885 commit 9c3c42f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SROS2_Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ros2 security create_key demo_keys /listener
### Define the SROS2 environment variables

```bash
export ROS_SECURITY_ROOT_DIRECTORY=~/sros2_demo/demo_keys
export ROS_SECURITY_KEYSTORE=~/sros2_demo/demo_keys
export ROS_SECURITY_ENABLE=true
export ROS_SECURITY_STRATEGY=Enforce
```
Expand Down
2 changes: 1 addition & 1 deletion SROS2_MacOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ros2 security create_key demo_keys /listener
### Define the SROS2 environment variables

```bash
export ROS_SECURITY_ROOT_DIRECTORY=$(pwd)/demo_keys
export ROS_SECURITY_KEYSTORE=$(pwd)/demo_keys
export ROS_SECURITY_ENABLE=true
export ROS_SECURITY_STRATEGY=Enforce
```
Expand Down
6 changes: 3 additions & 3 deletions SROS2_Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Then re-run the commands above.
Prepare your environment by setting three following environment variables as follows

```bat
set ROS_SECURITY_ROOT_DIRECTORY=%cd%/demo_keys
set ROS_SECURITY_KEYSTORE=%cd%/demo_keys
set ROS_SECURITY_ENABLE=true
set ROS_SECURITY_STRATEGY=Enforce
```
Expand All @@ -102,7 +102,7 @@ Open a new terminal:

```bat
call <path_to_ros2_install>/setup.bat
set ROS_SECURITY_ROOT_DIRECTORY=%cd%/demo_keys
set ROS_SECURITY_KEYSTORE=%cd%/demo_keys
set ROS_SECURITY_ENABLE=true
set ROS_SECURITY_STRATEGY=Enforce
ros2 run demo_nodes_py talker
Expand All @@ -112,7 +112,7 @@ Open another terminal:

```bat
call <path_to_ros2_install>/setup.bat
set ROS_SECURITY_ROOT_DIRECTORY=%cd%/demo_keys
set ROS_SECURITY_KEYSTORE=%cd%/demo_keys
set ROS_SECURITY_ENABLE=true
set ROS_SECURITY_STRATEGY=Enforce
ros2 run demo_nodes_py listener
Expand Down
2 changes: 1 addition & 1 deletion sros2/sros2/api/_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from cryptography.hazmat.primitives.asymmetric import ec

_DOMAIN_ID_ENV = 'ROS_DOMAIN_ID'
_KEYSTORE_DIR_ENV = 'ROS_SECURITY_ROOT_DIRECTORY'
_KEYSTORE_DIR_ENV = 'ROS_SECURITY_KEYSTORE'


def create_symlink(*, src, dst):
Expand Down
2 changes: 1 addition & 1 deletion sros2_cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Macro definition:
# Executables can use a different or the same enclaves.
# All nodes in the same process use the same enclave.
# SECURITY (cmake arg) if not define or OFF, will not generate key/keystores
# ROS_SECURITY_ROOT_DIRECTORY (env variable) the location of the keystore
# ROS_SECURITY_KEYSTORE (env variable) the location of the keystore
# POLICY_FILE (cmake arg) if defined, will generate security artifacts for each enclave defined in the policy file.
```
6 changes: 3 additions & 3 deletions sros2_cmake/cmake/sros2_generate_artifacts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ macro(sros2_generate_artifacts)
# SECURITY (cmake arg) if not defined or OFF, will not generate keystore/keys/permissions
# POLICY_FILE (cmake arg) if defined, policies defined in the file will used to generate
# permission files for all the enclaves listed in the policy file.
# ROS_SECURITY_ROOT_DIRECTORY (env variable) will be the location of the keystore
# ROS_SECURITY_KEYSTORE (env variable) will be the location of the keystore
if(NOT SECURITY)
message(STATUS "Not generating security files")
return()
endif()
find_program(PROGRAM ros2)

if(DEFINED ENV{ROS_SECURITY_ROOT_DIRECTORY})
set(SECURITY_KEYSTORE $ENV{ROS_SECURITY_ROOT_DIRECTORY})
if(DEFINED ENV{ROS_SECURITY_KEYSTORE})
set(SECURITY_KEYSTORE $ENV{ROS_SECURITY_KEYSTORE})
else()
set(SECURITY_KEYSTORE ${DEFAULT_KEYSTORE})
endif()
Expand Down

0 comments on commit 9c3c42f

Please sign in to comment.