diff --git a/CMakeLists.txt b/CMakeLists.txt index fb6cedff69f54c6ee3863eabf6c1843f3639f2f8..7c407999496d3026561a46df7ce33d0c46d88208 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ if(MSVC OR MSVC_IDE) else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") endif() + add_compile_options(/wd4996) # 为 MSVC 编译器添加额外的警告选项,目的是使 MSVC 编译器的行为更加接近 GCC 或 Clang 编译器。 # C4101 未引用的局部变量 @@ -46,9 +47,9 @@ if(MSVC OR MSVC_IDE) #add_compile_options(/w34189 /w34555 /w34715 /w35038) else() # 添加 GCC 和 Clang 编译器配置通用的警告和链接器选项 - #set(CMAKE_CXX_FLAGS - # "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra -Wno-unknown-pragmas -Wno-error=deprecated-declarations -Wno-switch-bool") - #add_compile_options(-Wno-narrowing) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra -Wno-unknown-pragmas -Wno-error=deprecated-declarations -Wno-switch-bool") + add_compile_options(-Wno-narrowing) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") diff --git a/README.md b/README.md index d30979d7c39237dd496775cdaa1dd1723759e212..73223af53da4e311bb24e4136021cc3dd54e070a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # travodds-security-plugin #### 介绍 -travodds安全插件 +travodds的安全插件动态库,配合travodds的核心框架实现身份验证、访问控制和数据加密。 + +客户端应用程序调用travodds框架接口加载此安全插件动态库。 #### 软件架构 -SecurityPlugin/ +travodds-security-plugin/ ├── include/ │ └── securityplugin/ # 公共头文件 │ ├── securityplugin.h @@ -14,6 +16,11 @@ SecurityPlugin/ │ ├── securityplugin.cpp │ ├── pkidhauthentication.cpp │ └── ... + +├── example/ # 应用示例 + +├── doc/ # 安全配置文档 + ├── CMakeLists.txt # 构建配置 └── README.md # 说明文档 @@ -28,7 +35,7 @@ SecurityPlugin/ 2. 配置CMake - cmake .. -DTRAVODDS_DIR=/your/travoddspath -DOPENSSL_DIR=/your/opensslpath + cmake .. -DCMAKE_PREFIX_PATH=/your/travoddspath 3. 编译项目 @@ -44,9 +51,11 @@ SecurityPlugin/ #### 使用说明 -1. xxxx -2. xxxx -3. xxxx +1. 在example下分为travodds-helloworld和travodds-fastdds,travodds-helloworld是travodds自身验证安全功能,travodds-fastdds是验证和fastdds的互通。如何使用在安全配置指导文档.docx的测试用例里有详细说明。 + +2. 提供了负载加密配置config_payload_encrypt、子消息加密配置config_payload_sub_encrypt等,如果想自定义更多配置,参考安全配置指导文档.docx的自定义配置config生成。 + + #### 参与贡献 diff --git a/doc/README.MD b/doc/README.MD deleted file mode 100644 index 9392ca36056d27453971fb7e9b4448f16bb26169..0000000000000000000000000000000000000000 --- a/doc/README.MD +++ /dev/null @@ -1,73 +0,0 @@ - - -# travodds-security-plugin - -#### 介绍 - -travodds-security-plugin是一个安全插件库,提供各种安全相关功能。项目采用CMake构建系统,支持Windows和Linux平台。 - -#### 快速开始 - -前提条件: - -​ CMake版本3.10或更高 - -编译器: - -​ Linux: GCC 4.8+ 或 Clang 3.3+ - -​ Windows: Visual Studio 2015+ - -构建工具: - -​ Linux: make - -​ Windows: Visual Studio - -安装依赖(Ubuntu/Debian) - sudo apt update - sudo apt install build-essential cmake - -安装依赖(Windows) - 安装 Visual Studio 或 MinGW-w64 - 安装 CMake - -#### 构建指南 - -1. 创建构建目录 - - mkdir build - - cd build - -2. 配置CMake - - cmake .. -DTRAVODDS_DIR=/your/travoddspath -DOPENSSL_DIR=/your/opensslpath - -3. 编译项目 - - Linux:make -j4 - - Windows: - -4. 安装库文件 - - Linux:sudo make install - - Windows:cmake --install . --config Release - -#### 安装路径说明 - -Linux 默认安装路径 - 头文件: /usr/local/include/SecurityPlugin/ - -​ 库文件: /usr/local/lib/libSecurityPlugin.so - -​ 配置文件: /usr/local/lib/cmake/SecurityPlugin/ - -Windows 默认安装路径 - 头文件: C:\Program Files\SecurityPlugin\include\SecurityPlugin\ - -​ 库文件: C:\Program Files\SecurityPlugin\bin\SecurityPlugin.dll - -​ 导入库: C:\Program Files\SecurityPlugin\lib\SecurityPlugin.lib \ No newline at end of file diff --git "a/doc/\345\256\211\345\205\250\351\205\215\347\275\256\346\214\207\345\257\274\346\226\207\346\241\243.docx" "b/doc/\345\256\211\345\205\250\351\205\215\347\275\256\346\214\207\345\257\274\346\226\207\346\241\243.docx" new file mode 100644 index 0000000000000000000000000000000000000000..1e13223f7c97a1dca318fbe22bed1da4abbc058c Binary files /dev/null and "b/doc/\345\256\211\345\205\250\351\205\215\347\275\256\346\214\207\345\257\274\346\226\207\346\241\243.docx" differ diff --git a/example/travodds-fastdds/fastdds_example/CMakeLists.txt b/example/travodds-fastdds/fastdds_example/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..132a05d1eb1f509d53bc9f9c55ffd7ad1a111511 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/CMakeLists.txt @@ -0,0 +1,69 @@ +# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cmake_minimum_required(VERSION 3.16.3) + +project(HelloWorldExample VERSION 1) + + +find_package(OpenSSL REQUIRED) +if(OpenSSL_FOUND) + message(STATUS "Find OpenSSL.") +else() + message(FATAL_ERROR "OpenSSL not found!") +endif() + + +# 设置包含目录 - 需要根据自环境配置 +include_directories( + /opt/agiros/loong/include/ + /opt/agiros/loong/include/fastcdr + /opt/agiros/loong/include/fastrtps +) + +# 设置库目录 fastcdr、fastrtps、foonathan_memory_vendor和openssl的库目录 +link_directories( + /opt/agiros/loong/lib +) + +#Check C++11 +include(CheckCXXCompilerFlag) +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR + CMAKE_CXX_COMPILER_ID MATCHES "Clang") + check_cxx_compiler_flag(-std=c++11 SUPPORTS_CXX11) + if(NOT SUPPORTS_CXX11) + message(FATAL_ERROR "Compiler doesn't support C++11") + endif() +endif() + +message(STATUS "Configuring HelloWorld example...") +file(GLOB HELLOWORLD_EXAMPLE_SOURCES_CXX "*.cxx") +file(GLOB HELLOWORLD_EXAMPLE_SOURCES_CPP "*.cpp") + +add_executable(HelloWorldExample ${HELLOWORLD_EXAMPLE_SOURCES_CXX} ${HELLOWORLD_EXAMPLE_SOURCES_CPP}) +target_compile_definitions(HelloWorldExample PRIVATE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. +) + +# 依赖库 根据实际库名 +target_link_libraries(HelloWorldExample PRIVATE OpenSSL::SSL OpenSSL::Crypto) +target_link_libraries(HelloWorldExample PRIVATE + libfastcdr.so + libfastrtps.so + #libfoonathan_memory.so + ) + +install(TARGETS HelloWorldExample + RUNTIME DESTINATION examples/C++/HelloWorldExample/${BIN_INSTALL_DIR}) diff --git a/example/travodds-fastdds/fastdds_example/HelloWorld.cxx b/example/travodds-fastdds/fastdds_example/HelloWorld.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c57bf78fb879396046c135bb705ddc715f7528df --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/HelloWorld.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +HelloWorld::HelloWorld() +{ + // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3f197a46 + m_index = 0; + // m_message com.eprosima.idl.parser.typecode.StringTypeCode@1817d444 + m_message =""; + +} + +HelloWorld::~HelloWorld() +{ + +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + m_message = x.m_message; +} + +HelloWorld::HelloWorld( + HelloWorld&& x) +{ + m_index = x.m_index; + m_message = std::move(x.m_message); +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + + m_index = x.m_index; + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) +{ + + m_index = x.m_index; + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + + return (m_index == x.m_index && m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + + return current_alignment - initial_alignment; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_index; + scdr << m_message; + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_index; + dcdr >> m_message; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + +size_t HelloWorld::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} diff --git a/example/travodds-fastdds/fastdds_example/HelloWorld.h b/example/travodds-fastdds/fastdds_example/HelloWorld.h new file mode 100644 index 0000000000000000000000000000000000000000..ca96c339a28d2bda430c2c3b5926fb56134f9961 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/HelloWorld.h @@ -0,0 +1,232 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HelloWorld_SOURCE) +#define HelloWorld_DllAPI __declspec( dllexport ) +#else +#define HelloWorld_DllAPI __declspec( dllimport ) +#endif // HelloWorld_SOURCE +#else +#define HelloWorld_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HelloWorld_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HELLOWORLD + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x); + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + +private: + + uint32_t m_index; + std::string m_message; +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/example/travodds-fastdds/fastdds_example/HelloWorld.idl b/example/travodds-fastdds/fastdds_example/HelloWorld.idl new file mode 100644 index 0000000000000000000000000000000000000000..24c5152e02af7b9293aea613aa9c6d593207b74a --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/HelloWorld.idl @@ -0,0 +1,4 @@ +struct HelloWorld { + unsigned long index; + string message; +}; \ No newline at end of file diff --git a/example/travodds-fastdds/fastdds_example/HelloWorldPubSubTypes.cxx b/example/travodds-fastdds/fastdds_example/HelloWorldPubSubTypes.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b70dbc225732dc912653405e45eaec371be14a2a --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/HelloWorldPubSubTypes.cxx @@ -0,0 +1,170 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "HelloWorldPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +HelloWorldPubSubType::HelloWorldPubSubType() +{ + setName("HelloWorld"); + auto type_size = HelloWorld::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = HelloWorld::isKeyDefined(); + size_t keyLength = HelloWorld::getKeyMaxCdrSerializedSize() > 16 ? + HelloWorld::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +HelloWorldPubSubType::~HelloWorldPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool HelloWorldPubSubType::serialize( + void* data, + SerializedPayload_t* payload) +{ + HelloWorld* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; +} + +bool HelloWorldPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + //Convert DATA to pointer of your type + HelloWorld* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; +} + +std::function HelloWorldPubSubType::getSerializedSizeProvider( + void* data) +{ + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; +} + +void* HelloWorldPubSubType::createData() +{ + return reinterpret_cast(new HelloWorld()); +} + +void HelloWorldPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool HelloWorldPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + HelloWorld* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + HelloWorld::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || HelloWorld::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; +} + diff --git a/example/travodds-fastdds/fastdds_example/HelloWorldPubSubTypes.h b/example/travodds-fastdds/fastdds_example/HelloWorldPubSubTypes.h new file mode 100644 index 0000000000000000000000000000000000000000..8b2348be67c70060c9277ba0cf08e2793248c23b --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/HelloWorldPubSubTypes.h @@ -0,0 +1,101 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ + +#include +#include + +#include "HelloWorld.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated HelloWorld is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +/*! + * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. + * @ingroup HELLOWORLD + */ +class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef HelloWorld type; + + eProsima_user_DllExport HelloWorldPubSubType(); + + eProsima_user_DllExport virtual ~HelloWorldPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/example/travodds-fastdds/fastdds_example/HelloWorld_main.cpp b/example/travodds-fastdds/fastdds_example/HelloWorld_main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..50547a3321be73c995c35d7f30b0cf124fdc7262 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/HelloWorld_main.cpp @@ -0,0 +1,532 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "HelloWorldPubSubTypes.h" +#include +#include +#include + +using namespace eprosima::fastdds::dds; + +std::atomic stop_flag(false); + +void signal_handler(int signal) +{ + stop_flag = true; + std::cout << "Received signal " << signal << ", shutting down..." << std::endl; +} + +bool test_data_serialization() +{ + HelloWorld test_data; + test_data.index(123); + test_data.message("Test message"); + + // 尝试获取序列化大小 + try { + size_t serialized_size = test_data.getMaxCdrSerializedSize(); + std::cout << "Max serialized size: " << serialized_size << std::endl; + return true; + } + catch (const std::exception& e) { + std::cerr << "Serialization test failed: " << e.what() << std::endl; + return false; + } +} + +bool configure_security(DomainParticipantQos& participant_qos) +{ + participant_qos.transport().use_builtin_transports = false; + //添加UDPv4传输 + auto udp_transport = std::make_shared(); + + // 配置UDP参数 + udp_transport->sendBufferSize = 65536; + udp_transport->receiveBufferSize = 65536; + + // 添加到用户传输列表 + participant_qos.transport().user_transports.push_back(udp_transport); + // 启用详细的安全日志 + participant_qos.properties().properties().emplace_back( + "dds.sec.log.file", "security_debug.log"); + participant_qos.properties().properties().emplace_back( + "dds.sec.log.level", "ALL"); // ALL是最详细的级别 + + // 设置安全插件名称(对应TravODDS的dds.sec.plugin_name) + // 明确设置所有三个安全插件 + participant_qos.properties().properties().emplace_back( + "dds.sec.auth.plugin", "builtin.PKI-DH"); + participant_qos.properties().properties().emplace_back( + "dds.sec.access.plugin", "builtin.Access-Permissions"); + participant_qos.properties().properties().emplace_back( + "dds.sec.crypto.plugin", "builtin.AES-GCM-GMAC"); // 明确指定加密插件 + + // TODO 需要根据实际路径修改 + // 身份验证配置 + participant_qos.properties().properties().emplace_back( + "dds.sec.auth.builtin.PKI-DH.identity_ca", "file://../config/identity_ca.cert.pem"); + participant_qos.properties().properties().emplace_back( + "dds.sec.auth.builtin.PKI-DH.identity_certificate", "file://../config/cert.pem"); + participant_qos.properties().properties().emplace_back( + "dds.sec.auth.builtin.PKI-DH.private_key", "file://../config/key.pem"); + + // 访问控制配置 + participant_qos.properties().properties().emplace_back( + "dds.sec.access.builtin.Access-Permissions.permissions_ca", "file://../config/permissions_ca.cert.pem"); + participant_qos.properties().properties().emplace_back( + "dds.sec.access.builtin.Access-Permissions.permissions", "file://../config/permissions.p7s"); + participant_qos.properties().properties().emplace_back( + "dds.sec.access.builtin.Access-Permissions.governance", "file://../config/governance.p7s"); + + return true; +} + +class FastDDSClient +{ +private: + DomainParticipant* participant_; + Publisher* publisher_; + Subscriber* subscriber_; + Topic* topic_; + DataWriter* writer_; + DataReader* reader_; + TypeSupport type_; + + bool is_publisher_; + int domain_id_; + std::string topic_name_; + + // Writer listener for publication matched events + class WriterListener : public DataWriterListener + { + public: + void on_publication_matched( + DataWriter* writer, + const PublicationMatchedStatus& info) override + { + if (info.current_count_change == 1) + { + std::cout << "[Publisher] Matched with subscriber " << info.last_subscription_handle << std::endl; + } + else if (info.current_count_change == -1) + { + std::cout << "[Publisher] Unmatched with subscriber " << info.last_subscription_handle << std::endl; + } + } + } writer_listener_; + + // Reader listener for data available events + class ReaderListener : public DataReaderListener + { + public: + void on_data_available(DataReader* reader) override + { + SampleInfo info; + HelloWorld data; + + while (reader->take_next_sample(&data, &info) == ReturnCode_t::RETCODE_OK) + { + if (info.valid_data) + { + std::cout << "[Subscriber] Received - Index: " << data.index() + << ", Message: " << data.message() << std::endl; + } + } + } + + void on_subscription_matched( + DataReader* reader, + const SubscriptionMatchedStatus& info) override + { + if (info.current_count_change == 1) + { + std::cout << "[Subscriber] Matched with publisher " << info.last_publication_handle << std::endl; + } + else if (info.current_count_change == -1) + { + std::cout << "[Subscriber] Unmatched with publisher " << info.last_publication_handle << std::endl; + } + } + } reader_listener_; + +public: + FastDDSClient(bool is_publisher, int domain_id = 0, const std::string& topic_name = "rr/aReply") + : participant_(nullptr) + , publisher_(nullptr) + , subscriber_(nullptr) + , topic_(nullptr) + , writer_(nullptr) + , reader_(nullptr) + , type_(new HelloWorldPubSubType()) + , is_publisher_(is_publisher) + , domain_id_(domain_id) + , topic_name_(topic_name) + { + } + + ~FastDDSClient() + { + cleanup(); + } + + bool initialize() + { + eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Info); + + // Create Domain Participant + //DomainParticipantQos participant_qos = PARTICIPANT_QOS_DEFAULT; + //participant_ = DomainParticipantFactory::get_instance()->create_participant(domain_id_, participant_qos); + + DomainParticipantQos participant_qos = PARTICIPANT_QOS_DEFAULT; + + // 配置安全 + if (!configure_security(participant_qos)) { + return false; + } + participant_ = DomainParticipantFactory::get_instance()->create_participant(domain_id_, participant_qos); + + if (participant_ == nullptr) + { + std::cerr << "Error: Failed to create domain participant" << std::endl; + return false; + } + + // Register the Type + type_.register_type(participant_); + + // Create Topic + topic_ = participant_->create_topic(topic_name_, "HelloWorld", TOPIC_QOS_DEFAULT); + if (topic_ == nullptr) + { + std::cerr << "Error: Failed to create topic" << std::endl; + cleanup(); + return false; + } + + if (is_publisher_) + { + return initialize_publisher(); + } + else + { + return initialize_subscriber(); + } + } + + void run() + { + if (is_publisher_) + { + run_publisher(); + } + else + { + run_subscriber(); + } + } + +private: + bool initialize_publisher() + { + // 测试数据序列化 + if (!test_data_serialization()) { + std::cerr << "Data serialization test failed!" << std::endl; + return false; + } + + // Create Publisher + publisher_ = participant_->create_publisher(PUBLISHER_QOS_DEFAULT); + if (publisher_ == nullptr) + { + std::cerr << "Error: Failed to create publisher" << std::endl; + cleanup(); + return false; + } + + // Create DataWriter + DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; + //writer_qos.reliability().kind = BEST_EFFORT_RELIABILITY_QOS; + writer_qos.reliability().kind = RELIABLE_RELIABILITY_QOS/*BEST_EFFORT_RELIABILITY_QOS*/; + + writer_ = publisher_->create_datawriter(topic_, writer_qos, &writer_listener_); + if (writer_ == nullptr) + { + std::cerr << "Error: Failed to create data writer" << std::endl; + cleanup(); + return false; + } + + std::cout << "FastDDS Publisher initialized successfully!" << std::endl; + std::cout << "Domain ID: " << domain_id_ << std::endl; + std::cout << "Topic: " << topic_name_ << std::endl; + std::cout << "Waiting for subscribers..." << std::endl; + + return true; + } + + bool initialize_subscriber() + { + // Create Subscriber + subscriber_ = participant_->create_subscriber(SUBSCRIBER_QOS_DEFAULT); + if (subscriber_ == nullptr) + { + std::cerr << "Error: Failed to create subscriber" << std::endl; + cleanup(); + return false; + } + + // Create DataReader + DataReaderQos reader_qos = DATAREADER_QOS_DEFAULT; + //reader_qos.reliability().kind = BEST_EFFORT_RELIABILITY_QOS; + reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; + + reader_ = subscriber_->create_datareader(topic_, reader_qos, &reader_listener_); + if (reader_ == nullptr) + { + std::cerr << "Error: Failed to create data reader" << std::endl; + cleanup(); + return false; + } + + std::cout << "FastDDS Subscriber initialized successfully!" << std::endl; + std::cout << "Domain ID: " << domain_id_ << std::endl; + std::cout << "Topic: " << topic_name_ << std::endl; + std::cout << "Waiting for publishers..." << std::endl; + + return true; + } + + void run_publisher() + { + HelloWorld data; + int count = 0; + + std::cout << "Publisher started. Press Ctrl+C to stop." << std::endl; + + while (getchar()/*!stop_flag*/) + { + data.index(count); + data.message("Hello from FastDDS - Count: " + std::to_string(count)); + bool ret = writer_->write(&data); + if (!ret) + { + if (1/*count % 10 == 0*/) // Print every 10th message + { + std::cout << "[Publisher] Sent - Index: " << data.index() + << ", Message: " << data.message() << std::endl; + } + } + else + { + if (1/*count % 10 == 0*/) // Print every 10th message + { + std::cout << "[Publisher] Sent - Index: " << data.index() + << ", Message: " << data.message() << std::endl; + } + } + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + count++; + } + + std::cout << "Publisher stopped after sending " << count << " messages." << std::endl; + } + + void run_subscriber() + { + std::cout << "Subscriber started. Press Ctrl+C to stop." << std::endl; + + while (!stop_flag) + { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } + + std::cout << "Subscriber stopped." << std::endl; + } + + void cleanup() + { + if (writer_ != nullptr) + { + publisher_->delete_datawriter(writer_); + writer_ = nullptr; + } + if (reader_ != nullptr) + { + subscriber_->delete_datareader(reader_); + reader_ = nullptr; + } + if (publisher_ != nullptr) + { + participant_->delete_publisher(publisher_); + publisher_ = nullptr; + } + if (subscriber_ != nullptr) + { + participant_->delete_subscriber(subscriber_); + subscriber_ = nullptr; + } + if (topic_ != nullptr) + { + participant_->delete_topic(topic_); + topic_ = nullptr; + } + if (participant_ != nullptr) + { + DomainParticipantFactory::get_instance()->delete_participant(participant_); + participant_ = nullptr; + } + } +}; + +void print_usage(const char* program_name) +{ + std::cout << "FastDDS Client - Communication with TravODDS" << std::endl; + std::cout << "Usage: " << program_name << " [pub|sub] [domain_id] [topic_name]" << std::endl; + std::cout << std::endl; + std::cout << "Arguments:" << std::endl; + std::cout << " pub|sub : Run as Publisher or Subscriber" << std::endl; + std::cout << " domain_id : Domain ID (default: 0)" << std::endl; + std::cout << " topic_name : Topic name (default: rr/aReply)" << std::endl; + std::cout << std::endl; + std::cout << "Examples:" << std::endl; + std::cout << " " << program_name << " pub # Run as Publisher" << std::endl; + std::cout << " " << program_name << " sub # Run as Subscriber" << std::endl; + std::cout << " " << program_name << " pub 150 my_topic # Custom domain and topic" << std::endl; + std::cout << " " << program_name << " # Interactive mode" << std::endl; +} + +int main(int argc, char* argv[]) +{ + // Setup signal handling for graceful shutdown + signal(SIGINT, signal_handler); + signal(SIGTERM, signal_handler); + + // 启用所有INFO级别日志(包括SECURITY) + eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Info); + + static eprosima::fastdds::dds::StdoutErrConsumer consumer; + eprosima::fastdds::dds::Log::ClearConsumers(); + eprosima::fastdds::dds::Log::RegisterConsumer(std::unique_ptr(&consumer)); + + // 设置详细级别 + eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Info); + + // 启用 SECURITY 类别 + eprosima::fastdds::dds::Log::SetCategoryFilter(std::regex("SECURITY")); + + // 启用文件名和行号显示 + eprosima::fastdds::dds::Log::ReportFilenames(true); + eprosima::fastdds::dds::Log::ReportFunctions(true); + + // Default parameters + bool is_publisher = false; + int domain_id = 150; + //"HelloWorldTopic", "HelloWorld" + std::string topic_name = "rr/aReply";//"HelloWorldTopic"; + + // Parse command line arguments + if (argc >= 2) + { + std::string mode = argv[1]; + if (mode == "pub") + { + is_publisher = true; + } + else if (mode == "sub") + { + is_publisher = false; + } + else + { + std::cerr << "Error: Invalid mode '" << mode << "'. Use 'pub' or 'sub'." << std::endl; + print_usage(argv[0]); + return 1; + } + + if (argc >= 3) + { + try + { + domain_id = std::stoi(argv[2]); + } + catch (const std::exception& e) + { + std::cerr << "Error: Invalid domain ID '" << argv[2] << "'" << std::endl; + return 1; + } + } + + if (argc >= 4) + { + topic_name = argv[3]; + } + } + else + { + // Interactive mode + std::string mode; + std::cout << "Select mode (pub/sub): "; + std::cin >> mode; + if (mode == "pub") + { + is_publisher = true; + } + else if (mode == "sub") + { + is_publisher = false; + } + else + { + std::cerr << "Error: Invalid mode '" << mode << "'" << std::endl; + return 1; + } + + std::cout << "domain ID (default 0): "; + domain_id = 0; + + } + + std::cout << "Starting FastDDS Client..." << std::endl; + std::cout << "Mode: " << (is_publisher ? "Publisher" : "Subscriber") << std::endl; + std::cout << "Domain ID: " << domain_id << std::endl; + std::cout << "Topic: " << topic_name << std::endl; + + try + { + FastDDSClient client(is_publisher, domain_id, topic_name); + + if (client.initialize()) + { + client.run(); + std::cout << "FastDDS Client terminated successfully." << std::endl; + return 0; + } + else + { + std::cerr << "Failed to initialize FastDDS Client" << std::endl; + return 1; + } + } + catch (const std::exception& e) + { + std::cerr << "Exception: " << e.what() << std::endl; + return 1; + } +} diff --git a/example/travodds-fastdds/fastdds_example/config/ca.key.pem b/example/travodds-fastdds/fastdds_example/config/ca.key.pem new file mode 100644 index 0000000000000000000000000000000000000000..7836dacd2e2381021cc31420b8b6f48e9c6886ae --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/ca.key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgru/rnDjwLmTcRDgt ++C8hwFsOnYuO0G7cex/oA0RUJXKhRANCAAR4k5HXYrJm/muqAzpygt835dHQYdx2 +0JJLvS6T1NfjmXKBqfxktfdnYLnAPQLRxMt+gg3BsfxDl+mQ2E10GI/P +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/fastdds_example/config/cert.pem b/example/travodds-fastdds/fastdds_example/config/cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..cb467b403362c9e70db12246e83021d754058f7f --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBQzCB66ADAgECAhRSujF8MSuyE+NrrGkGZ76zd9MN3DAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTExMDA3MjI1MVoXDTM1MTEwOTA3MjI1 +MVowJDEiMCAGA1UEAwwZL3RhbGtlcl9saXN0ZW5lci9saXN0ZW5lcjBZMBMGByqG +SM49AgEGCCqGSM49AwEHA0IABD7M1zsBoRk0ocvrbbJIXS6kATnEZJ3R4G1JiHtS +TUPQFHR7J2X7Rx9mKU3cwEUs4mXSF+JMC5gWPWPAyuWWvjSjDTALMAkGA1UdEwQC +MAAwCgYIKoZIzj0EAwIDRwAwRAIgffaAzHHudjOPTbqKoBlNjdYii++rnY1lGsFL +uIOuTxoCIF788nB4ovJ3q1w9XKe8luIYoXUyf9K1wM2IN0pUixop +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/fastdds_example/config/governance.p7s b/example/travodds-fastdds/fastdds_example/config/governance.p7s new file mode 100644 index 0000000000000000000000000000000000000000..b0c9cea68afd7b49775caf60dbce4f4a9415d8a1 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/governance.p7s @@ -0,0 +1,58 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----3C9403812D08B6E245BCFBDB2CD72448" + +This is an S/MIME signed message + +------3C9403812D08B6E245BCFBDB2CD72448 +Content-Type: text/plain + + + + + + 0 + + false + true + NONE + NONE + NONE + + + * + false + false + true + true + NONE + ENCRYPT + + + + + + +------3C9403812D08B6E245BCFBDB2CD72448 +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC9gYJKoZIhvcNAQcCoIIC5zCCAuMCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggE+MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoG +CCqGSM49BAMCMBIxEDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcN +MzUxMTA5MDcyMDQ2WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYI +KoZIzj0DAQcDQgAEeJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8 +ZLX3Z2C5wD0C0cTLfoINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB +/wIBATAKBggqhkjOPQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMT +fRXqYFkcNMoCIEGoUYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1MYIBfDCC +AXgCAQEwKTASMRAwDgYDVQQDDAdzcm9zMkNBAhMZsdvUkGYgEGBIvSDwW4lLNB59 +MA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ +KoZIhvcNAQkFMQ8XDTI2MDQyMjA4NTU1OVowLwYJKoZIhvcNAQkEMSIEIDJsG3ss +8EzvArICnvN78aiTBF/P+3yMOZU7aHeM7uCkMHkGCSqGSIb3DQEJDzFsMGowCwYJ +YIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcNAwcw +DgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3 +DQMCAgEoMAoGCCqGSM49BAMCBEYwRAIgOJyPSBpeo1DyyHUqS0eV+3rujh0t2xYM +b7FBIjX5KioCICg7sk9J8hRhR8RwRbXbRipYYabmZhffBrZidJCEWEYH + +------3C9403812D08B6E245BCFBDB2CD72448-- + diff --git a/example/travodds-fastdds/fastdds_example/config/governance.xml b/example/travodds-fastdds/fastdds_example/config/governance.xml new file mode 100644 index 0000000000000000000000000000000000000000..c696c23de3efb909ed911d09da4373988181212b --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/governance.xml @@ -0,0 +1,25 @@ + + + + + 0 + + false + true + NONE + NONE + NONE + + + * + false + false + true + true + NONE + ENCRYPT + + + + + diff --git a/example/travodds-fastdds/fastdds_example/config/identity_ca.cert.pem b/example/travodds-fastdds/fastdds_example/config/identity_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..a055be03d399613b2644d579c3318afe4021664e --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/identity_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoGCCqGSM49BAMCMBIx +EDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcNMzUxMTA5MDcyMDQ2 +WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE +eJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8ZLX3Z2C5wD0C0cTL +foINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB/wIBATAKBggqhkjO +PQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMTfRXqYFkcNMoCIEGo +UYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1 +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/fastdds_example/config/identity_ca.key.pem b/example/travodds-fastdds/fastdds_example/config/identity_ca.key.pem new file mode 100644 index 0000000000000000000000000000000000000000..7836dacd2e2381021cc31420b8b6f48e9c6886ae --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/identity_ca.key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgru/rnDjwLmTcRDgt ++C8hwFsOnYuO0G7cex/oA0RUJXKhRANCAAR4k5HXYrJm/muqAzpygt835dHQYdx2 +0JJLvS6T1NfjmXKBqfxktfdnYLnAPQLRxMt+gg3BsfxDl+mQ2E10GI/P +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/fastdds_example/config/key.pem b/example/travodds-fastdds/fastdds_example/config/key.pem new file mode 100644 index 0000000000000000000000000000000000000000..4412e55150d4c8b3f1ebedd4e18ce798e5a91021 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgJBGkfSuxfMwcLA92 +Oh78PEgR+cNcnVNu4+OTUQuzIH2hRANCAAQ+zNc7AaEZNKHL622ySF0upAE5xGSd +0eBtSYh7Uk1D0BR0eydl+0cfZilN3MBFLOJl0hfiTAuYFj1jwMrllr40 +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/fastdds_example/config/permissions.p7s b/example/travodds-fastdds/fastdds_example/config/permissions.p7s new file mode 100644 index 0000000000000000000000000000000000000000..9e88cfb2e5786cff4519fc5ff02796e8ff91785e --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/permissions.p7s @@ -0,0 +1,95 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----B8214CD690DE0A655D8A15FBAF0C32FA" + +This is an S/MIME signed message + +------B8214CD690DE0A655D8A15FBAF0C32FA +Content-Type: text/plain + + + + + CN=/talker_listener/listener + + 2025-11-10T07:22:51 + 2035-11-09T07:22:51 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + + +------B8214CD690DE0A655D8A15FBAF0C32FA +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC9wYJKoZIhvcNAQcCoIIC6DCCAuQCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggE+MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoG +CCqGSM49BAMCMBIxEDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcN +MzUxMTA5MDcyMDQ2WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYI +KoZIzj0DAQcDQgAEeJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8 +ZLX3Z2C5wD0C0cTLfoINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB +/wIBATAKBggqhkjOPQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMT +fRXqYFkcNMoCIEGoUYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1MYIBfTCC +AXkCAQEwKTASMRAwDgYDVQQDDAdzcm9zMkNBAhMZsdvUkGYgEGBIvSDwW4lLNB59 +MA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ +KoZIhvcNAQkFMQ8XDTI1MTExMTA5MTkzNVowLwYJKoZIhvcNAQkEMSIEIBvkrVSU +V1bgL+Uh9vkFHppjJayGUGET2hnfkK92OxI1MHkGCSqGSIb3DQEJDzFsMGowCwYJ +YIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcNAwcw +DgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3 +DQMCAgEoMAoGCCqGSM49BAMCBEcwRQIgSJYtnftxu65ObkfFQClaRJRXqiQoYbLF +KPE6ekmETSECIQD7gUFjQSLrAhsrbK8bi4mnwAkY8NLDrJMaqOoEFMU0cA== + +------B8214CD690DE0A655D8A15FBAF0C32FA-- + diff --git a/example/travodds-fastdds/fastdds_example/config/permissions.xml b/example/travodds-fastdds/fastdds_example/config/permissions.xml new file mode 100644 index 0000000000000000000000000000000000000000..d3e039c83cba9e2bcce2cb8bb6c20d69a4233afd --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/permissions.xml @@ -0,0 +1,62 @@ + + + + CN=/talker_listener/listener + + 2025-11-10T07:22:51 + 2035-11-09T07:22:51 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + diff --git a/example/travodds-fastdds/fastdds_example/config/permissions_ca.cert.pem b/example/travodds-fastdds/fastdds_example/config/permissions_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..a055be03d399613b2644d579c3318afe4021664e --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config/permissions_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoGCCqGSM49BAMCMBIx +EDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcNMzUxMTA5MDcyMDQ2 +WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE +eJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8ZLX3Z2C5wD0C0cTL +foINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB/wIBATAKBggqhkjO +PQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMTfRXqYFkcNMoCIEGo +UYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1 +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/fastdds_example/config_allencrypt/cert.pem b/example/travodds-fastdds/fastdds_example/config_allencrypt/cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..e83af9da408de9e41cad971e0050c01cb5f8178e --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_allencrypt/cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBRDCB66ADAgECAhQ3uEATNHoM9mZ4uHAPoyPgSeYP9DAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MzIzMloXDTM1MTIwMjE0MzIz +MlowJDEiMCAGA1UEAwwZL3RhbGtlcl9saXN0ZW5lci9saXN0ZW5lcjBZMBMGByqG +SM49AgEGCCqGSM49AwEHA0IABBnLjXZ9CyD1F5dcU7GwJW6M+5qFf1GE9ghDHpx9 +YOvkGHuO9ibMM7ScKIIyRgc3lpToRm+E1d4zSBse5xq5rFijDTALMAkGA1UdEwQC +MAAwCgYIKoZIzj0EAwIDSAAwRQIgTXflHKLzIPhZJbzXgsrjhSkLtt/Bl5xttt0X +RQfhN/ACIQDEcxkfKIbec8EDw4m6iISsENqKn1r8d9fBGhRYlwd9lg== +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/fastdds_example/config_allencrypt/governance.p7s b/example/travodds-fastdds/fastdds_example/config_allencrypt/governance.p7s new file mode 100644 index 0000000000000000000000000000000000000000..d780c7a4411be602e064e67f3be096c1c926e415 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_allencrypt/governance.p7s @@ -0,0 +1,58 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----2EBF410662B48FD38E1BF8A3D0C3B30C" + +This is an S/MIME signed message + +------2EBF410662B48FD38E1BF8A3D0C3B30C +Content-Type: text/plain + + + + + + 0 + + false + true + NONE + NONE + ENCRYPT + + + * + false + false + true + true + ENCRYPT + ENCRYPT + + + + + + +------2EBF410662B48FD38E1BF8A3D0C3B30C +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC+QYJKoZIhvcNAQcCoIIC6jCCAuYCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggFAMIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAK +BggqhkjOPQQDAjASMRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloX +DTM1MTIwMjE0MjYwNlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEG +CCqGSM49AwEHA0IABIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJ +bd60PbRpa+Px0ok9g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYB +Af8CAQEwCgYIKoZIzj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBf +AHKswi2MOC6nAiEAvOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwUxggF9 +MIIBeQIBATAqMBIxEDAOBgNVBAMMB3Nyb3MyQ0ECFFQl4Ij4dhvU1fIsLxqK2uUu +GppaMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw +HAYJKoZIhvcNAQkFMQ8XDTI2MDExMjA2MDMwNlowLwYJKoZIhvcNAQkEMSIEINJE +ffD2YaiMmavrM+kFDGzhMsHn/JySOpEiimb4Ys21MHkGCSqGSIb3DQEJDzFsMGow +CwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcN +AwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqG +SIb3DQMCAgEoMAoGCCqGSM49BAMCBEYwRAIgejfv1c7wIalvOLVENku7w5NayLT4 +CP+X5PGk0aP1XQQCIEsO91RJ6iYABZZPR2LH+EgiP1JzE9tM9U43+Ja+PniE + +------2EBF410662B48FD38E1BF8A3D0C3B30C-- + diff --git a/example/travodds-fastdds/fastdds_example/config_allencrypt/identity_ca.cert.pem b/example/travodds-fastdds/fastdds_example/config_allencrypt/identity_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..356a0657fae78b58bbedb97fc0467af0d3ea3165 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_allencrypt/identity_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloXDTM1MTIwMjE0MjYw +NlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA +BIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJbd60PbRpa+Px0ok9 +g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYIKoZI +zj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBfAHKswi2MOC6nAiEA +vOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwU= +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/fastdds_example/config_allencrypt/key.pem b/example/travodds-fastdds/fastdds_example/config_allencrypt/key.pem new file mode 100644 index 0000000000000000000000000000000000000000..5b14c1e0be40253c48a5e89a39c9fa53aefc7a17 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_allencrypt/key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgrS4yiMPshmEddlm8 +sHsF+nU8pLkPwKUi30OK6dlsIaihRANCAAQZy412fQsg9ReXXFOxsCVujPuahX9R +hPYIQx6cfWDr5Bh7jvYmzDO0nCiCMkYHN5aU6EZvhNXeM0gbHucauaxY +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/fastdds_example/config_allencrypt/permissions.p7s b/example/travodds-fastdds/fastdds_example/config_allencrypt/permissions.p7s new file mode 100644 index 0000000000000000000000000000000000000000..02bc514dc8c08ef38b8aabe4d06c6edb16ffc75f --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_allencrypt/permissions.p7s @@ -0,0 +1,95 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----FF77F18233B61B7A77A37BB6B2EABBEB" + +This is an S/MIME signed message + +------FF77F18233B61B7A77A37BB6B2EABBEB +Content-Type: text/plain + + + + + CN=/talker_listener/listener + + 2025-12-03T14:32:32 + 2035-12-02T14:32:32 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + + +------FF77F18233B61B7A77A37BB6B2EABBEB +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC+wYJKoZIhvcNAQcCoIIC7DCCAugCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggFAMIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAK +BggqhkjOPQQDAjASMRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloX +DTM1MTIwMjE0MjYwNlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEG +CCqGSM49AwEHA0IABIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJ +bd60PbRpa+Px0ok9g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYB +Af8CAQEwCgYIKoZIzj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBf +AHKswi2MOC6nAiEAvOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwUxggF/ +MIIBewIBATAqMBIxEDAOBgNVBAMMB3Nyb3MyQ0ECFFQl4Ij4dhvU1fIsLxqK2uUu +GppaMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw +HAYJKoZIhvcNAQkFMQ8XDTI1MTIwNDA5MzUyOFowLwYJKoZIhvcNAQkEMSIEIHEB +8XFJGT0CPRafpZ2Le4rZ2K3k4KVOXG4EMgHlqsI/MHkGCSqGSIb3DQEJDzFsMGow +CwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcN +AwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqG +SIb3DQMCAgEoMAoGCCqGSM49BAMCBEgwRgIhAJC0tE16BjHr+AfZWCOXAC8lSmty +u6k+C0T7pGH5lEQ7AiEAgh/CiSEXUKl3KVQfqplxxXqAdByX8yixYdotvTj4Aqo= + +------FF77F18233B61B7A77A37BB6B2EABBEB-- + diff --git a/example/travodds-fastdds/fastdds_example/config_allencrypt/permissions.xml b/example/travodds-fastdds/fastdds_example/config_allencrypt/permissions.xml new file mode 100644 index 0000000000000000000000000000000000000000..4baf56d6af99da00287ccc5fc31e48d276b86420 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_allencrypt/permissions.xml @@ -0,0 +1,62 @@ + + + + CN=/talker_listener/listener + + 2025-12-03T14:32:32 + 2035-12-02T14:32:32 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + diff --git a/example/travodds-fastdds/fastdds_example/config_allencrypt/permissions_ca.cert.pem b/example/travodds-fastdds/fastdds_example/config_allencrypt/permissions_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..356a0657fae78b58bbedb97fc0467af0d3ea3165 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_allencrypt/permissions_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloXDTM1MTIwMjE0MjYw +NlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA +BIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJbd60PbRpa+Px0ok9 +g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYIKoZI +zj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBfAHKswi2MOC6nAiEA +vOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwU= +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/cert.pem b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..e83af9da408de9e41cad971e0050c01cb5f8178e --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBRDCB66ADAgECAhQ3uEATNHoM9mZ4uHAPoyPgSeYP9DAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MzIzMloXDTM1MTIwMjE0MzIz +MlowJDEiMCAGA1UEAwwZL3RhbGtlcl9saXN0ZW5lci9saXN0ZW5lcjBZMBMGByqG +SM49AgEGCCqGSM49AwEHA0IABBnLjXZ9CyD1F5dcU7GwJW6M+5qFf1GE9ghDHpx9 +YOvkGHuO9ibMM7ScKIIyRgc3lpToRm+E1d4zSBse5xq5rFijDTALMAkGA1UdEwQC +MAAwCgYIKoZIzj0EAwIDSAAwRQIgTXflHKLzIPhZJbzXgsrjhSkLtt/Bl5xttt0X +RQfhN/ACIQDEcxkfKIbec8EDw4m6iISsENqKn1r8d9fBGhRYlwd9lg== +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/governance.p7s b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/governance.p7s new file mode 100644 index 0000000000000000000000000000000000000000..afa37c6e272c1e4d59f9724f310330fb3ef7e7b7 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/governance.p7s @@ -0,0 +1,58 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----D118566432FC4D512ABC8E7AC17AC7A7" + +This is an S/MIME signed message + +------D118566432FC4D512ABC8E7AC17AC7A7 +Content-Type: text/plain + + + + + + 0 + + false + true + NONE + NONE + NONE + + + * + false + false + true + true + NONE + ENCRYPT + + + + + + +------D118566432FC4D512ABC8E7AC17AC7A7 +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC+wYJKoZIhvcNAQcCoIIC7DCCAugCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggFAMIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAK +BggqhkjOPQQDAjASMRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloX +DTM1MTIwMjE0MjYwNlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEG +CCqGSM49AwEHA0IABIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJ +bd60PbRpa+Px0ok9g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYB +Af8CAQEwCgYIKoZIzj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBf +AHKswi2MOC6nAiEAvOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwUxggF/ +MIIBewIBATAqMBIxEDAOBgNVBAMMB3Nyb3MyQ0ECFFQl4Ij4dhvU1fIsLxqK2uUu +GppaMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw +HAYJKoZIhvcNAQkFMQ8XDTI1MTIwNDA5MjQ1NVowLwYJKoZIhvcNAQkEMSIEIC4U +qypi7KRLiZHqGUG6dYkkmQ4tF4edrDnguVTs9nzNMHkGCSqGSIb3DQEJDzFsMGow +CwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcN +AwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqG +SIb3DQMCAgEoMAoGCCqGSM49BAMCBEgwRgIhALLhMikr0dMbDzVv9uZJYhlndpL9 +3yoVY8wtivoEup/BAiEA74o98Tk+hYdTI9w1sjjtyB0Kp/44hmFVNi4OcXoQXLI= + +------D118566432FC4D512ABC8E7AC17AC7A7-- + diff --git a/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/governance.xml b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/governance.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa92c6e3b645a68336c1fc2a99efdbbcbb146ce8 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/governance.xml @@ -0,0 +1,25 @@ + + + + + 0 + + false + true + NONE + NONE + NONE + + + * + false + false + true + true + NONE + ENCRYPT + + + + + diff --git a/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/identity_ca.cert.pem b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/identity_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..356a0657fae78b58bbedb97fc0467af0d3ea3165 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/identity_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloXDTM1MTIwMjE0MjYw +NlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA +BIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJbd60PbRpa+Px0ok9 +g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYIKoZI +zj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBfAHKswi2MOC6nAiEA +vOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwU= +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/key.pem b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/key.pem new file mode 100644 index 0000000000000000000000000000000000000000..5b14c1e0be40253c48a5e89a39c9fa53aefc7a17 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgrS4yiMPshmEddlm8 +sHsF+nU8pLkPwKUi30OK6dlsIaihRANCAAQZy412fQsg9ReXXFOxsCVujPuahX9R +hPYIQx6cfWDr5Bh7jvYmzDO0nCiCMkYHN5aU6EZvhNXeM0gbHucauaxY +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/permissions.p7s b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/permissions.p7s new file mode 100644 index 0000000000000000000000000000000000000000..02bc514dc8c08ef38b8aabe4d06c6edb16ffc75f --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/permissions.p7s @@ -0,0 +1,95 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----FF77F18233B61B7A77A37BB6B2EABBEB" + +This is an S/MIME signed message + +------FF77F18233B61B7A77A37BB6B2EABBEB +Content-Type: text/plain + + + + + CN=/talker_listener/listener + + 2025-12-03T14:32:32 + 2035-12-02T14:32:32 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + + +------FF77F18233B61B7A77A37BB6B2EABBEB +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC+wYJKoZIhvcNAQcCoIIC7DCCAugCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggFAMIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAK +BggqhkjOPQQDAjASMRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloX +DTM1MTIwMjE0MjYwNlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEG +CCqGSM49AwEHA0IABIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJ +bd60PbRpa+Px0ok9g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYB +Af8CAQEwCgYIKoZIzj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBf +AHKswi2MOC6nAiEAvOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwUxggF/ +MIIBewIBATAqMBIxEDAOBgNVBAMMB3Nyb3MyQ0ECFFQl4Ij4dhvU1fIsLxqK2uUu +GppaMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw +HAYJKoZIhvcNAQkFMQ8XDTI1MTIwNDA5MzUyOFowLwYJKoZIhvcNAQkEMSIEIHEB +8XFJGT0CPRafpZ2Le4rZ2K3k4KVOXG4EMgHlqsI/MHkGCSqGSIb3DQEJDzFsMGow +CwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcN +AwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqG +SIb3DQMCAgEoMAoGCCqGSM49BAMCBEgwRgIhAJC0tE16BjHr+AfZWCOXAC8lSmty +u6k+C0T7pGH5lEQ7AiEAgh/CiSEXUKl3KVQfqplxxXqAdByX8yixYdotvTj4Aqo= + +------FF77F18233B61B7A77A37BB6B2EABBEB-- + diff --git a/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/permissions.xml b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/permissions.xml new file mode 100644 index 0000000000000000000000000000000000000000..4baf56d6af99da00287ccc5fc31e48d276b86420 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/permissions.xml @@ -0,0 +1,62 @@ + + + + CN=/talker_listener/listener + + 2025-12-03T14:32:32 + 2035-12-02T14:32:32 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + diff --git a/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/permissions_ca.cert.pem b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/permissions_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..356a0657fae78b58bbedb97fc0467af0d3ea3165 --- /dev/null +++ b/example/travodds-fastdds/fastdds_example/config_payloadencrypt_noprotect/permissions_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloXDTM1MTIwMjE0MjYw +NlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA +BIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJbd60PbRpa+Px0ok9 +g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYIKoZI +zj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBfAHKswi2MOC6nAiEA +vOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwU= +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/CMakeLists.txt b/example/travodds-fastdds/travodds_example/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..edb8f0e9b25b988d15c62909a4d2fe179d579e3c --- /dev/null +++ b/example/travodds-fastdds/travodds_example/CMakeLists.txt @@ -0,0 +1,92 @@ +#Copyright(c)[2025][AGIROS][TravoDDS] is licensed under Mulan PSL v2. +# +#You can use this software according to the terms and conditions of +#the Mulan PSL v2.You may obtain a copy of Mulan PSL v2 at : +#http://license.coscl.org.cn/MulanPSL2 +# +#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF +#ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +#NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +# +#See the Mulan PSL v2 for more details. + +cmake_minimum_required(VERSION 3.10) +project(ConnenctPoint LANGUAGES CXX) +if(NOT TRAVODDS_FOUND) + find_package(TRAVODDS 1 REQUIRED) +endif() + +#检测 C++11 +include(CheckCXXCompilerFlag) +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + check_cxx_compiler_flag(-std=c++11 SUPPORTS_CXX11) + if(NOT SUPPORTS_CXX11) + message(FATAL_ERROR "Compiler doesn't support C++11") + endif() +endif() + +# 设置CMAKE_BUILD_TYPE 默认为Release. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'Release' as none was specified.") + set(CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + +#############################基础配置############################# +add_compile_options("$<$:/source-charset:utf-8>") + +############################################################################### +# 警告等级 +############################################################################### +if(MSVC OR MSVC_IDE) + if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif() + + # 为 MSVC 编译器添加额外的警告选项,目的是使 MSVC 编译器的行为更加接近 GCC 或 Clang 编译器。 + # C4101 未引用的局部变量 + # C4189 已初始化但未引用的局部变量 + # C4555 表达式无效,应该是有副作用的表达式 + # C4715 函数的所有控制路径未返回值 + # C5038 数据成员初始化顺序警告 + # C4100 未引用的形式参数 + #add_compile_options(/w34101 /w34189 /w34555 /w34715 /w35038 /w44100) + #add_compile_options(/w34189 /w34555 /w34715 /w35038) +else() + # 添加 GCC 和 Clang 编译器配置通用的警告和链接器选项 + #set(CMAKE_CXX_FLAGS + # "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra -Wno-unknown-pragmas -Wno-error=deprecated-declarations -Wno-switch-bool") + #add_compile_options(-Wno-narrowing) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15,0) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-builtins") + endif() + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl") + endif() +endif() + +message(STATUS "Configuring example...") +#收集源文件 +file(GLOB_RECURSE SOURCES_FILES + "src/ConnectPoint.cpp" + "src/HelloWorld.cpp" + "src/HelloWorldTypeSupport.cpp" +) +add_executable(ConnectPoint ${SOURCES_FILES}) +# target_compile_definitions(${PROJECT_NAME} +# PRIVATE +# _DDS_STATIC_LIB +# ) + +target_link_libraries(ConnectPoint PRIVATE TRAVODDS::TRAVODDS) + +if(TRAVODDS_INCLUDE_DIR) + include_directories(${TRAVODDS_INCLUDE_DIR}) +endif() diff --git a/example/travodds-fastdds/travodds_example/config/ca.key.pem b/example/travodds-fastdds/travodds_example/config/ca.key.pem new file mode 100644 index 0000000000000000000000000000000000000000..7836dacd2e2381021cc31420b8b6f48e9c6886ae --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/ca.key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgru/rnDjwLmTcRDgt ++C8hwFsOnYuO0G7cex/oA0RUJXKhRANCAAR4k5HXYrJm/muqAzpygt835dHQYdx2 +0JJLvS6T1NfjmXKBqfxktfdnYLnAPQLRxMt+gg3BsfxDl+mQ2E10GI/P +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/travodds_example/config/cert.pem b/example/travodds-fastdds/travodds_example/config/cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..cb467b403362c9e70db12246e83021d754058f7f --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBQzCB66ADAgECAhRSujF8MSuyE+NrrGkGZ76zd9MN3DAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTExMDA3MjI1MVoXDTM1MTEwOTA3MjI1 +MVowJDEiMCAGA1UEAwwZL3RhbGtlcl9saXN0ZW5lci9saXN0ZW5lcjBZMBMGByqG +SM49AgEGCCqGSM49AwEHA0IABD7M1zsBoRk0ocvrbbJIXS6kATnEZJ3R4G1JiHtS +TUPQFHR7J2X7Rx9mKU3cwEUs4mXSF+JMC5gWPWPAyuWWvjSjDTALMAkGA1UdEwQC +MAAwCgYIKoZIzj0EAwIDRwAwRAIgffaAzHHudjOPTbqKoBlNjdYii++rnY1lGsFL +uIOuTxoCIF788nB4ovJ3q1w9XKe8luIYoXUyf9K1wM2IN0pUixop +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/config/governance.p7s b/example/travodds-fastdds/travodds_example/config/governance.p7s new file mode 100644 index 0000000000000000000000000000000000000000..b0c9cea68afd7b49775caf60dbce4f4a9415d8a1 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/governance.p7s @@ -0,0 +1,58 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----3C9403812D08B6E245BCFBDB2CD72448" + +This is an S/MIME signed message + +------3C9403812D08B6E245BCFBDB2CD72448 +Content-Type: text/plain + + + + + + 0 + + false + true + NONE + NONE + NONE + + + * + false + false + true + true + NONE + ENCRYPT + + + + + + +------3C9403812D08B6E245BCFBDB2CD72448 +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC9gYJKoZIhvcNAQcCoIIC5zCCAuMCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggE+MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoG +CCqGSM49BAMCMBIxEDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcN +MzUxMTA5MDcyMDQ2WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYI +KoZIzj0DAQcDQgAEeJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8 +ZLX3Z2C5wD0C0cTLfoINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB +/wIBATAKBggqhkjOPQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMT +fRXqYFkcNMoCIEGoUYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1MYIBfDCC +AXgCAQEwKTASMRAwDgYDVQQDDAdzcm9zMkNBAhMZsdvUkGYgEGBIvSDwW4lLNB59 +MA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ +KoZIhvcNAQkFMQ8XDTI2MDQyMjA4NTU1OVowLwYJKoZIhvcNAQkEMSIEIDJsG3ss +8EzvArICnvN78aiTBF/P+3yMOZU7aHeM7uCkMHkGCSqGSIb3DQEJDzFsMGowCwYJ +YIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcNAwcw +DgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3 +DQMCAgEoMAoGCCqGSM49BAMCBEYwRAIgOJyPSBpeo1DyyHUqS0eV+3rujh0t2xYM +b7FBIjX5KioCICg7sk9J8hRhR8RwRbXbRipYYabmZhffBrZidJCEWEYH + +------3C9403812D08B6E245BCFBDB2CD72448-- + diff --git a/example/travodds-fastdds/travodds_example/config/governance.xml b/example/travodds-fastdds/travodds_example/config/governance.xml new file mode 100644 index 0000000000000000000000000000000000000000..c696c23de3efb909ed911d09da4373988181212b --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/governance.xml @@ -0,0 +1,25 @@ + + + + + 0 + + false + true + NONE + NONE + NONE + + + * + false + false + true + true + NONE + ENCRYPT + + + + + diff --git a/example/travodds-fastdds/travodds_example/config/identity_ca.cert.pem b/example/travodds-fastdds/travodds_example/config/identity_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..a055be03d399613b2644d579c3318afe4021664e --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/identity_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoGCCqGSM49BAMCMBIx +EDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcNMzUxMTA5MDcyMDQ2 +WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE +eJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8ZLX3Z2C5wD0C0cTL +foINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB/wIBATAKBggqhkjO +PQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMTfRXqYFkcNMoCIEGo +UYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1 +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/config/identity_ca.key.pem b/example/travodds-fastdds/travodds_example/config/identity_ca.key.pem new file mode 100644 index 0000000000000000000000000000000000000000..7836dacd2e2381021cc31420b8b6f48e9c6886ae --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/identity_ca.key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgru/rnDjwLmTcRDgt ++C8hwFsOnYuO0G7cex/oA0RUJXKhRANCAAR4k5HXYrJm/muqAzpygt835dHQYdx2 +0JJLvS6T1NfjmXKBqfxktfdnYLnAPQLRxMt+gg3BsfxDl+mQ2E10GI/P +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/travodds_example/config/key.pem b/example/travodds-fastdds/travodds_example/config/key.pem new file mode 100644 index 0000000000000000000000000000000000000000..4412e55150d4c8b3f1ebedd4e18ce798e5a91021 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgJBGkfSuxfMwcLA92 +Oh78PEgR+cNcnVNu4+OTUQuzIH2hRANCAAQ+zNc7AaEZNKHL622ySF0upAE5xGSd +0eBtSYh7Uk1D0BR0eydl+0cfZilN3MBFLOJl0hfiTAuYFj1jwMrllr40 +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/travodds_example/config/permissions.p7s b/example/travodds-fastdds/travodds_example/config/permissions.p7s new file mode 100644 index 0000000000000000000000000000000000000000..9e88cfb2e5786cff4519fc5ff02796e8ff91785e --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/permissions.p7s @@ -0,0 +1,95 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----B8214CD690DE0A655D8A15FBAF0C32FA" + +This is an S/MIME signed message + +------B8214CD690DE0A655D8A15FBAF0C32FA +Content-Type: text/plain + + + + + CN=/talker_listener/listener + + 2025-11-10T07:22:51 + 2035-11-09T07:22:51 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + + +------B8214CD690DE0A655D8A15FBAF0C32FA +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC9wYJKoZIhvcNAQcCoIIC6DCCAuQCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggE+MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoG +CCqGSM49BAMCMBIxEDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcN +MzUxMTA5MDcyMDQ2WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYI +KoZIzj0DAQcDQgAEeJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8 +ZLX3Z2C5wD0C0cTLfoINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB +/wIBATAKBggqhkjOPQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMT +fRXqYFkcNMoCIEGoUYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1MYIBfTCC +AXkCAQEwKTASMRAwDgYDVQQDDAdzcm9zMkNBAhMZsdvUkGYgEGBIvSDwW4lLNB59 +MA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ +KoZIhvcNAQkFMQ8XDTI1MTExMTA5MTkzNVowLwYJKoZIhvcNAQkEMSIEIBvkrVSU +V1bgL+Uh9vkFHppjJayGUGET2hnfkK92OxI1MHkGCSqGSIb3DQEJDzFsMGowCwYJ +YIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcNAwcw +DgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3 +DQMCAgEoMAoGCCqGSM49BAMCBEcwRQIgSJYtnftxu65ObkfFQClaRJRXqiQoYbLF +KPE6ekmETSECIQD7gUFjQSLrAhsrbK8bi4mnwAkY8NLDrJMaqOoEFMU0cA== + +------B8214CD690DE0A655D8A15FBAF0C32FA-- + diff --git a/example/travodds-fastdds/travodds_example/config/permissions.xml b/example/travodds-fastdds/travodds_example/config/permissions.xml new file mode 100644 index 0000000000000000000000000000000000000000..d3e039c83cba9e2bcce2cb8bb6c20d69a4233afd --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/permissions.xml @@ -0,0 +1,62 @@ + + + + CN=/talker_listener/listener + + 2025-11-10T07:22:51 + 2035-11-09T07:22:51 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + diff --git a/example/travodds-fastdds/travodds_example/config/permissions_ca.cert.pem b/example/travodds-fastdds/travodds_example/config/permissions_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..a055be03d399613b2644d579c3318afe4021664e --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config/permissions_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoGCCqGSM49BAMCMBIx +EDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcNMzUxMTA5MDcyMDQ2 +WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE +eJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8ZLX3Z2C5wD0C0cTL +foINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB/wIBATAKBggqhkjO +PQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMTfRXqYFkcNMoCIEGo +UYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1 +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/config_allencrypt/cert.pem b/example/travodds-fastdds/travodds_example/config_allencrypt/cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..e83af9da408de9e41cad971e0050c01cb5f8178e --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_allencrypt/cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBRDCB66ADAgECAhQ3uEATNHoM9mZ4uHAPoyPgSeYP9DAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MzIzMloXDTM1MTIwMjE0MzIz +MlowJDEiMCAGA1UEAwwZL3RhbGtlcl9saXN0ZW5lci9saXN0ZW5lcjBZMBMGByqG +SM49AgEGCCqGSM49AwEHA0IABBnLjXZ9CyD1F5dcU7GwJW6M+5qFf1GE9ghDHpx9 +YOvkGHuO9ibMM7ScKIIyRgc3lpToRm+E1d4zSBse5xq5rFijDTALMAkGA1UdEwQC +MAAwCgYIKoZIzj0EAwIDSAAwRQIgTXflHKLzIPhZJbzXgsrjhSkLtt/Bl5xttt0X +RQfhN/ACIQDEcxkfKIbec8EDw4m6iISsENqKn1r8d9fBGhRYlwd9lg== +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/config_allencrypt/governance.p7s b/example/travodds-fastdds/travodds_example/config_allencrypt/governance.p7s new file mode 100644 index 0000000000000000000000000000000000000000..d780c7a4411be602e064e67f3be096c1c926e415 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_allencrypt/governance.p7s @@ -0,0 +1,58 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----2EBF410662B48FD38E1BF8A3D0C3B30C" + +This is an S/MIME signed message + +------2EBF410662B48FD38E1BF8A3D0C3B30C +Content-Type: text/plain + + + + + + 0 + + false + true + NONE + NONE + ENCRYPT + + + * + false + false + true + true + ENCRYPT + ENCRYPT + + + + + + +------2EBF410662B48FD38E1BF8A3D0C3B30C +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC+QYJKoZIhvcNAQcCoIIC6jCCAuYCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggFAMIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAK +BggqhkjOPQQDAjASMRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloX +DTM1MTIwMjE0MjYwNlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEG +CCqGSM49AwEHA0IABIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJ +bd60PbRpa+Px0ok9g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYB +Af8CAQEwCgYIKoZIzj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBf +AHKswi2MOC6nAiEAvOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwUxggF9 +MIIBeQIBATAqMBIxEDAOBgNVBAMMB3Nyb3MyQ0ECFFQl4Ij4dhvU1fIsLxqK2uUu +GppaMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw +HAYJKoZIhvcNAQkFMQ8XDTI2MDExMjA2MDMwNlowLwYJKoZIhvcNAQkEMSIEINJE +ffD2YaiMmavrM+kFDGzhMsHn/JySOpEiimb4Ys21MHkGCSqGSIb3DQEJDzFsMGow +CwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcN +AwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqG +SIb3DQMCAgEoMAoGCCqGSM49BAMCBEYwRAIgejfv1c7wIalvOLVENku7w5NayLT4 +CP+X5PGk0aP1XQQCIEsO91RJ6iYABZZPR2LH+EgiP1JzE9tM9U43+Ja+PniE + +------2EBF410662B48FD38E1BF8A3D0C3B30C-- + diff --git a/example/travodds-fastdds/travodds_example/config_allencrypt/identity_ca.cert.pem b/example/travodds-fastdds/travodds_example/config_allencrypt/identity_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..356a0657fae78b58bbedb97fc0467af0d3ea3165 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_allencrypt/identity_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloXDTM1MTIwMjE0MjYw +NlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA +BIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJbd60PbRpa+Px0ok9 +g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYIKoZI +zj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBfAHKswi2MOC6nAiEA +vOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwU= +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/config_allencrypt/key.pem b/example/travodds-fastdds/travodds_example/config_allencrypt/key.pem new file mode 100644 index 0000000000000000000000000000000000000000..5b14c1e0be40253c48a5e89a39c9fa53aefc7a17 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_allencrypt/key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgrS4yiMPshmEddlm8 +sHsF+nU8pLkPwKUi30OK6dlsIaihRANCAAQZy412fQsg9ReXXFOxsCVujPuahX9R +hPYIQx6cfWDr5Bh7jvYmzDO0nCiCMkYHN5aU6EZvhNXeM0gbHucauaxY +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/travodds_example/config_allencrypt/permissions.p7s b/example/travodds-fastdds/travodds_example/config_allencrypt/permissions.p7s new file mode 100644 index 0000000000000000000000000000000000000000..02bc514dc8c08ef38b8aabe4d06c6edb16ffc75f --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_allencrypt/permissions.p7s @@ -0,0 +1,95 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----FF77F18233B61B7A77A37BB6B2EABBEB" + +This is an S/MIME signed message + +------FF77F18233B61B7A77A37BB6B2EABBEB +Content-Type: text/plain + + + + + CN=/talker_listener/listener + + 2025-12-03T14:32:32 + 2035-12-02T14:32:32 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + + +------FF77F18233B61B7A77A37BB6B2EABBEB +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC+wYJKoZIhvcNAQcCoIIC7DCCAugCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggFAMIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAK +BggqhkjOPQQDAjASMRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloX +DTM1MTIwMjE0MjYwNlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEG +CCqGSM49AwEHA0IABIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJ +bd60PbRpa+Px0ok9g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYB +Af8CAQEwCgYIKoZIzj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBf +AHKswi2MOC6nAiEAvOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwUxggF/ +MIIBewIBATAqMBIxEDAOBgNVBAMMB3Nyb3MyQ0ECFFQl4Ij4dhvU1fIsLxqK2uUu +GppaMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw +HAYJKoZIhvcNAQkFMQ8XDTI1MTIwNDA5MzUyOFowLwYJKoZIhvcNAQkEMSIEIHEB +8XFJGT0CPRafpZ2Le4rZ2K3k4KVOXG4EMgHlqsI/MHkGCSqGSIb3DQEJDzFsMGow +CwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcN +AwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqG +SIb3DQMCAgEoMAoGCCqGSM49BAMCBEgwRgIhAJC0tE16BjHr+AfZWCOXAC8lSmty +u6k+C0T7pGH5lEQ7AiEAgh/CiSEXUKl3KVQfqplxxXqAdByX8yixYdotvTj4Aqo= + +------FF77F18233B61B7A77A37BB6B2EABBEB-- + diff --git a/example/travodds-fastdds/travodds_example/config_allencrypt/permissions.xml b/example/travodds-fastdds/travodds_example/config_allencrypt/permissions.xml new file mode 100644 index 0000000000000000000000000000000000000000..4baf56d6af99da00287ccc5fc31e48d276b86420 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_allencrypt/permissions.xml @@ -0,0 +1,62 @@ + + + + CN=/talker_listener/listener + + 2025-12-03T14:32:32 + 2035-12-02T14:32:32 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + diff --git a/example/travodds-fastdds/travodds_example/config_allencrypt/permissions_ca.cert.pem b/example/travodds-fastdds/travodds_example/config_allencrypt/permissions_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..356a0657fae78b58bbedb97fc0467af0d3ea3165 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_allencrypt/permissions_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloXDTM1MTIwMjE0MjYw +NlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA +BIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJbd60PbRpa+Px0ok9 +g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYIKoZI +zj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBfAHKswi2MOC6nAiEA +vOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwU= +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/cert.pem b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..e83af9da408de9e41cad971e0050c01cb5f8178e --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBRDCB66ADAgECAhQ3uEATNHoM9mZ4uHAPoyPgSeYP9DAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MzIzMloXDTM1MTIwMjE0MzIz +MlowJDEiMCAGA1UEAwwZL3RhbGtlcl9saXN0ZW5lci9saXN0ZW5lcjBZMBMGByqG +SM49AgEGCCqGSM49AwEHA0IABBnLjXZ9CyD1F5dcU7GwJW6M+5qFf1GE9ghDHpx9 +YOvkGHuO9ibMM7ScKIIyRgc3lpToRm+E1d4zSBse5xq5rFijDTALMAkGA1UdEwQC +MAAwCgYIKoZIzj0EAwIDSAAwRQIgTXflHKLzIPhZJbzXgsrjhSkLtt/Bl5xttt0X +RQfhN/ACIQDEcxkfKIbec8EDw4m6iISsENqKn1r8d9fBGhRYlwd9lg== +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/governance.p7s b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/governance.p7s new file mode 100644 index 0000000000000000000000000000000000000000..afa37c6e272c1e4d59f9724f310330fb3ef7e7b7 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/governance.p7s @@ -0,0 +1,58 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----D118566432FC4D512ABC8E7AC17AC7A7" + +This is an S/MIME signed message + +------D118566432FC4D512ABC8E7AC17AC7A7 +Content-Type: text/plain + + + + + + 0 + + false + true + NONE + NONE + NONE + + + * + false + false + true + true + NONE + ENCRYPT + + + + + + +------D118566432FC4D512ABC8E7AC17AC7A7 +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC+wYJKoZIhvcNAQcCoIIC7DCCAugCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggFAMIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAK +BggqhkjOPQQDAjASMRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloX +DTM1MTIwMjE0MjYwNlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEG +CCqGSM49AwEHA0IABIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJ +bd60PbRpa+Px0ok9g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYB +Af8CAQEwCgYIKoZIzj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBf +AHKswi2MOC6nAiEAvOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwUxggF/ +MIIBewIBATAqMBIxEDAOBgNVBAMMB3Nyb3MyQ0ECFFQl4Ij4dhvU1fIsLxqK2uUu +GppaMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw +HAYJKoZIhvcNAQkFMQ8XDTI1MTIwNDA5MjQ1NVowLwYJKoZIhvcNAQkEMSIEIC4U +qypi7KRLiZHqGUG6dYkkmQ4tF4edrDnguVTs9nzNMHkGCSqGSIb3DQEJDzFsMGow +CwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcN +AwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqG +SIb3DQMCAgEoMAoGCCqGSM49BAMCBEgwRgIhALLhMikr0dMbDzVv9uZJYhlndpL9 +3yoVY8wtivoEup/BAiEA74o98Tk+hYdTI9w1sjjtyB0Kp/44hmFVNi4OcXoQXLI= + +------D118566432FC4D512ABC8E7AC17AC7A7-- + diff --git a/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/governance.xml b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/governance.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa92c6e3b645a68336c1fc2a99efdbbcbb146ce8 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/governance.xml @@ -0,0 +1,25 @@ + + + + + 0 + + false + true + NONE + NONE + NONE + + + * + false + false + true + true + NONE + ENCRYPT + + + + + diff --git a/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/identity_ca.cert.pem b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/identity_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..356a0657fae78b58bbedb97fc0467af0d3ea3165 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/identity_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloXDTM1MTIwMjE0MjYw +NlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA +BIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJbd60PbRpa+Px0ok9 +g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYIKoZI +zj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBfAHKswi2MOC6nAiEA +vOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwU= +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/key.pem b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/key.pem new file mode 100644 index 0000000000000000000000000000000000000000..5b14c1e0be40253c48a5e89a39c9fa53aefc7a17 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgrS4yiMPshmEddlm8 +sHsF+nU8pLkPwKUi30OK6dlsIaihRANCAAQZy412fQsg9ReXXFOxsCVujPuahX9R +hPYIQx6cfWDr5Bh7jvYmzDO0nCiCMkYHN5aU6EZvhNXeM0gbHucauaxY +-----END PRIVATE KEY----- diff --git a/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/permissions.p7s b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/permissions.p7s new file mode 100644 index 0000000000000000000000000000000000000000..02bc514dc8c08ef38b8aabe4d06c6edb16ffc75f --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/permissions.p7s @@ -0,0 +1,95 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----FF77F18233B61B7A77A37BB6B2EABBEB" + +This is an S/MIME signed message + +------FF77F18233B61B7A77A37BB6B2EABBEB +Content-Type: text/plain + + + + + CN=/talker_listener/listener + + 2025-12-03T14:32:32 + 2035-12-02T14:32:32 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + + +------FF77F18233B61B7A77A37BB6B2EABBEB +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC+wYJKoZIhvcNAQcCoIIC7DCCAugCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggFAMIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAK +BggqhkjOPQQDAjASMRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloX +DTM1MTIwMjE0MjYwNlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEG +CCqGSM49AwEHA0IABIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJ +bd60PbRpa+Px0ok9g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYB +Af8CAQEwCgYIKoZIzj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBf +AHKswi2MOC6nAiEAvOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwUxggF/ +MIIBewIBATAqMBIxEDAOBgNVBAMMB3Nyb3MyQ0ECFFQl4Ij4dhvU1fIsLxqK2uUu +GppaMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw +HAYJKoZIhvcNAQkFMQ8XDTI1MTIwNDA5MzUyOFowLwYJKoZIhvcNAQkEMSIEIHEB +8XFJGT0CPRafpZ2Le4rZ2K3k4KVOXG4EMgHlqsI/MHkGCSqGSIb3DQEJDzFsMGow +CwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcN +AwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqG +SIb3DQMCAgEoMAoGCCqGSM49BAMCBEgwRgIhAJC0tE16BjHr+AfZWCOXAC8lSmty +u6k+C0T7pGH5lEQ7AiEAgh/CiSEXUKl3KVQfqplxxXqAdByX8yixYdotvTj4Aqo= + +------FF77F18233B61B7A77A37BB6B2EABBEB-- + diff --git a/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/permissions.xml b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/permissions.xml new file mode 100644 index 0000000000000000000000000000000000000000..4baf56d6af99da00287ccc5fc31e48d276b86420 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/permissions.xml @@ -0,0 +1,62 @@ + + + + CN=/talker_listener/listener + + 2025-12-03T14:32:32 + 2035-12-02T14:32:32 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + diff --git a/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/permissions_ca.cert.pem b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/permissions_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..356a0657fae78b58bbedb97fc0467af0d3ea3165 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/config_payloadencrypt_noprotect/permissions_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBPDCB4qADAgECAhRUJeCI+HYb1NXyLC8aitrlLhqaWjAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTIwMzE0MjYwNloXDTM1MTIwMjE0MjYw +NlowEjEQMA4GA1UEAwwHc3JvczJDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA +BIcDDXSGA8xAOZ4HLA7kpYhWj6aPSBgb9dj5ZtomHUnILruJbd60PbRpa+Px0ok9 +g0kPS8sSEy7ULaePD9A77kKjFjAUMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYIKoZI +zj0EAwIDSQAwRgIhAInvkLW48np9qgM75zqPEIwZKQHPkiBfAHKswi2MOC6nAiEA +vOrJANZ3HzVSwsTZLNF+pbLdv+rl1cMxsHDtNuT3AwU= +-----END CERTIFICATE----- diff --git a/example/travodds-fastdds/travodds_example/dds_security_qos.xml b/example/travodds-fastdds/travodds_example/dds_security_qos.xml new file mode 100644 index 0000000000000000000000000000000000000000..a6c36ddcc52c03bbe792935694967008af84fd8c --- /dev/null +++ b/example/travodds-fastdds/travodds_example/dds_security_qos.xml @@ -0,0 +1,65 @@ + + + + + + true + + + + + true + + + + + dds.sec.plugin_name + SecurityPlugin + false + + + dds.sec.auth.identity_ca + file:../config/identity_ca.cert.pem + false + + + dds.sec.auth.identity_certificate + file:../config/cert.pem + false + + + dds.sec.auth.private_key + file:../config/key.pem + false + + + dds.sec.access.permissions_ca + file:../config/permissions_ca.cert.pem + false + + + dds.sec.access.permissions + file:../config/permissions.p7s + false + + + dds.sec.access.governance + file:../config/governance.p7s + false + + + + + + + RELIABLE_RELIABILITY_QOS + + + + + RELIABLE_RELIABILITY_QOS + + + + + diff --git a/example/travodds-fastdds/travodds_example/src/ConnectPoint.cpp b/example/travodds-fastdds/travodds_example/src/ConnectPoint.cpp new file mode 100644 index 0000000000000000000000000000000000000000..543bf90f3918e285053696289834e86be2e006ab --- /dev/null +++ b/example/travodds-fastdds/travodds_example/src/ConnectPoint.cpp @@ -0,0 +1,409 @@ +#include "dcps/domain/domainparticipant.h" +#include "dcps/topic/topic.h" +#include "HelloWorld.h" +#include "HelloWorldTypeSupport.h" +#include +#include "dcps/domain/domainparticipantfactory.h" +USING_TRAVODDS_NAMESPACE + +class myDataListener : public DataReaderListener { +public: + virtual void on_data_available(DataReader* reader); +}; +void myDataListener::on_data_available(DataReader* reader) +{ + SequenceData data_seq; + SampleInfoSeq info_seq; + ReturnCode_t retcode; + int i; + retcode = reader->take( + data_seq, info_seq, LENGTH_UNLIMITED, + ANY_SAMPLE_STATE, ANY_VIEW_STATE, ANY_INSTANCE_STATE); + + if (retcode == RETCODE_NO_DATA) { + return; + } + else if (retcode != RETCODE_OK) { + fprintf(stderr, "take error %d\n", retcode); + return; + } + for (i = 0; i < data_seq.length(); ++i) { + printf("Received data, index %d, message %s\n", data_seq[i].index, data_seq[i].message.data()); + } +} + +static int publisher_shutdown( + DomainParticipant* participant) +{ + ReturnCode_t retcode; + int status = 0; + + if (participant != NULL) { + retcode = participant->delete_contained_entities(); + if (retcode != RETCODE_OK) { + fprintf(stderr, "delete_contained_entities error %d\n", retcode); + status = -1; + } + + retcode = TheParticipantFactory->delete_participant(participant); + if (retcode != RETCODE_OK) { + fprintf(stderr, "delete_participant error %d\n", retcode); + status = -1; + } + } + return status; +} + +static int subscriber_shutdown( + DomainParticipant* participant) +{ + ReturnCode_t retcode; + int status = 0; + + if (participant != NULL) { + retcode = participant->delete_contained_entities(); + if (retcode != RETCODE_OK) { + fprintf(stderr, "delete_contained_entities error %d\n", retcode); + status = -1; + } + + retcode = TheParticipantFactory->delete_participant(participant); + if (retcode != RETCODE_OK) { + fprintf(stderr, "delete_participant error %d\n", retcode); + status = -1; + } + } + return status; +} + +int main(int argc, char* argv[]) +{ + + std::string type = ""; + if (argc < 2) { + std::cerr << "input pub、 sub、pubnosec or subnosec" << std::endl; + std::cin >> type; + } + else { + type = argv[1]; + } + if (type == "pub") + { + DomainParticipantFactory* factory = TheParticipantFactory; + int retCode; + retCode = factory->load_security_plugin( + "SecurityPlugin", + "SecurityPlugin.dll", + "SecPluginGetInstance", + "SecPluginFinalize"); + if (retCode != 0) + { + printf("load_security_plugin failed(%d).", retCode); + while (1) { + } + return -1; + } + + int sample_count = 0; + DomainParticipant* participant = NULL; + Publisher* publisher = NULL; + Topic* topic = NULL; + DataWriter* writer = NULL; + HelloWorld instance = { 0,"a" }; + + Subscriber* subscriber = NULL; + myDataListener* reader_listener = NULL; + DataReader* reader = NULL; + + ReturnCode_t retcode; + InstanceHandle_t instance_handle = HANDLE_NIL; + const char* type_name = NULL; + int count = 0; + + { + factory->load_qos_from_xml("../dds_security_qos.xml"); + participant = factory->create_participant_with_profile( + 0, "default_lib", + "default_profile", "example_pub", NULL, PUBLICATION_MATCHED_STATUS); + if (participant == NULL) { + while (1) { + } + fprintf(stderr, "create_participant error\n"); + return -1; + } + //participant = factory->create_participant(0 , PARTICIPANT_QOS_DEFAULT, NULL, PUBLICATION_MATCHED_STATUS); + } + publisher = participant->create_publisher( + PUBLISHER_QOS_DEFAULT, NULL, STATUS_MASK_NONE); + if (publisher == NULL) { + fprintf(stderr, "create_publisher error\n"); + publisher_shutdown(participant); + return -1; + } + + type_name = HelloWorldTypeSupport::get_instance()->get_typename(); + participant->registe_type(type_name, HelloWorldTypeSupport::get_instance()); + topic = participant->create_topic( + "rr/aReply", + type_name, TOPIC_QOS_DEFAULT, NULL, + STATUS_MASK_NONE); + if (topic == NULL) { + fprintf(stderr, "create_topic error\n"); + publisher_shutdown(participant); + return -1; + } + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); //考虑时序性 + + DataWriterQos wrQos; + publisher->get_default_datawriter_qos(wrQos); + //wrQos.reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + wrQos.reliability.kind = RELIABLE_RELIABILITY_QOS; + writer = publisher->create_datawriter(topic, wrQos, nullptr, STATUS_MASK_ALL); + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + + for (count = 0; (sample_count == 0) || (count < sample_count); ++count) { + if (count % 20 == 0) + printf("Writing myData, count %d\n", count); + instance.index = count; + retcode = writer->write(&instance, instance_handle); + if (retcode != RETCODE_OK) { + fprintf(stderr, "write error %d\n", retcode); + } + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + } + + publisher_shutdown(participant); + } + else if (type == "sub") { + DomainParticipantFactory* factory = TheParticipantFactory; + int retCode; + retCode = factory->load_security_plugin( + "SecurityPlugin", + "SecurityPlugin.dll", + "SecPluginGetInstance", + "SecPluginFinalize"); + if (retCode != 0) + { + printf("load_security_plugin failed(%d).", retCode); + while (1) { + } + return -1; + } + + int sample_count = 0; + DomainParticipant* participant = NULL; + Publisher* publisher = NULL; + Topic* topic = NULL; + DataWriter* writer = NULL; + HelloWorld instance = { 0,"a" }; + + Subscriber* subscriber = NULL; + myDataListener* reader_listener = NULL; + DataReader* reader = NULL; + + ReturnCode_t retcode; + InstanceHandle_t instance_handle = HANDLE_NIL; + const char* type_name = NULL; + int count = 0; + + { + factory->load_qos_from_xml("../dds_security_qos.xml"); + participant = factory->create_participant_with_profile( + 0, "default_lib", + "default_profile", "example_pub", NULL, PUBLICATION_MATCHED_STATUS); + if (participant == NULL) { + fprintf(stderr, "create_participant error\n"); + while (1) { + } + return -1; + } + //participant = factory->create_participant(0, PARTICIPANT_QOS_DEFAULT, NULL, PUBLICATION_MATCHED_STATUS); + } + + subscriber = participant->create_subscriber( + SUBSCRIBER_QOS_DEFAULT, NULL, STATUS_MASK_NONE); + if (subscriber == NULL) { + fprintf(stderr, "create_subscriber error\n"); + subscriber_shutdown(participant); + return -1; + } + + type_name = HelloWorldTypeSupport::get_instance()->get_typename(); + participant->registe_type(type_name, HelloWorldTypeSupport::get_instance()); + + topic = participant->create_topic( + "rr/aReply", + type_name, TOPIC_QOS_DEFAULT, NULL, + STATUS_MASK_NONE); + if (topic == NULL) { + fprintf(stderr, "create_topic error\n"); + subscriber_shutdown(participant); + return -1; + } + + reader_listener = new myDataListener(); + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); //考虑时序性 + + DataReaderQos drQos; + subscriber->get_default_datareader_qos(drQos); + //drQos.reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + drQos.reliability.kind = RELIABLE_RELIABILITY_QOS; + reader = subscriber->create_datareader( + topic, drQos, reader_listener, + STATUS_MASK_ALL); + if (reader == NULL) { + fprintf(stderr, "create_datareader error\n"); + subscriber_shutdown(participant); + delete reader_listener; + return -1; + } + + /* Main loop */ + for (count = 0; (sample_count == 0) || (count < sample_count); ++count) { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + //break; + } + + return subscriber_shutdown(participant); + } + else if (type == "pubnosec") + { + DomainParticipantFactory* factory = TheParticipantFactory; + int retCode; + int sample_count = 0; + DomainParticipant* participant = NULL; + Publisher* publisher = NULL; + Topic* topic = NULL; + DataWriter* writer = NULL; + HelloWorld instance = { 0,"a" }; + Subscriber* subscriber = NULL; + myDataListener* reader_listener = NULL; + DataReader* reader = NULL; + ReturnCode_t retcode; + InstanceHandle_t instance_handle = HANDLE_NIL; + const char* type_name = NULL; + int count = 0; + participant = factory->create_participant( + 0, PARTICIPANT_QOS_DEFAULT, NULL, PUBLICATION_MATCHED_STATUS); + if (participant == NULL) { + fprintf(stderr, "create_participant error\n"); + return -1; + } + publisher = participant->create_publisher( + PUBLISHER_QOS_DEFAULT, NULL, STATUS_MASK_NONE); + if (publisher == NULL) { + fprintf(stderr, "create_publisher error\n"); + publisher_shutdown(participant); + return -1; + } + type_name = HelloWorldTypeSupport::get_instance()->get_typename(); + participant->registe_type(type_name, HelloWorldTypeSupport::get_instance()); + topic = participant->create_topic( + "rr/aReply", + type_name, TOPIC_QOS_DEFAULT, NULL, + STATUS_MASK_NONE); + if (topic == NULL) { + fprintf(stderr, "create_topic error\n"); + publisher_shutdown(participant); + return -1; + } + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); //考虑时序性 + DataWriterQos wrQos; + publisher->get_default_datawriter_qos(wrQos); + //wrQos.reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + wrQos.reliability.kind = RELIABLE_RELIABILITY_QOS; + writer = publisher->create_datawriter(topic, wrQos, nullptr, STATUS_MASK_ALL); + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + for (count = 0; (sample_count == 0) || (count < sample_count); ++count) { + if (count % 20 == 0) + printf("Writing myData, count %d\n", count); + instance.index = count; + retcode = writer->write(&instance, instance_handle); + if (retcode != RETCODE_OK) { + fprintf(stderr, "write error %d\n", retcode); + } + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + } + publisher_shutdown(participant); + } + else if (type == "subnosec") { + DomainParticipantFactory* factory = TheParticipantFactory; + int retCode; + int sample_count = 0; + DomainParticipant* participant = NULL; + Publisher* publisher = NULL; + Topic* topic = NULL; + DataWriter* writer = NULL; + HelloWorld instance = { 0,"a" }; + + Subscriber* subscriber = NULL; + myDataListener* reader_listener = NULL; + DataReader* reader = NULL; + + ReturnCode_t retcode; + InstanceHandle_t instance_handle = HANDLE_NIL; + const char* type_name = NULL; + int count = 0; + participant = factory->create_participant( + 0, PARTICIPANT_QOS_DEFAULT, NULL, PUBLICATION_MATCHED_STATUS); + if (participant == NULL) { + fprintf(stderr, "create_participant error\n"); + return -1; + } + subscriber = participant->create_subscriber( + SUBSCRIBER_QOS_DEFAULT, NULL, STATUS_MASK_NONE); + if (subscriber == NULL) { + fprintf(stderr, "create_subscriber error\n"); + subscriber_shutdown(participant); + return -1; + } + + type_name = HelloWorldTypeSupport::get_instance()->get_typename(); + participant->registe_type(type_name, HelloWorldTypeSupport::get_instance()); + + topic = participant->create_topic( + "rr/aReply", + type_name, TOPIC_QOS_DEFAULT, NULL, + STATUS_MASK_NONE); + if (topic == NULL) { + fprintf(stderr, "create_topic error\n"); + subscriber_shutdown(participant); + return -1; + } + + reader_listener = new myDataListener(); + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); //考虑时序性 + + DataReaderQos drQos; + subscriber->get_default_datareader_qos(drQos); + //drQos.reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + drQos.reliability.kind = RELIABLE_RELIABILITY_QOS; + reader = subscriber->create_datareader( + topic, drQos, reader_listener, + STATUS_MASK_ALL); + if (reader == NULL) { + fprintf(stderr, "create_datareader error\n"); + subscriber_shutdown(participant); + delete reader_listener; + return -1; + } + + /* Main loop */ + for (count = 0; (sample_count == 0) || (count < sample_count); ++count) { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + //break; + } + + return subscriber_shutdown(participant); + } + else { + return 0; + } + while (1) { + } +} + diff --git a/example/travodds-fastdds/travodds_example/src/HelloWorld.cpp b/example/travodds-fastdds/travodds_example/src/HelloWorld.cpp new file mode 100644 index 0000000000000000000000000000000000000000..38b58bb156ae0496f2fc3c0eaaaeb0a628966ec1 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/src/HelloWorld.cpp @@ -0,0 +1,12 @@ +#include "HelloWorld.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} + + + +#endif diff --git a/example/travodds-fastdds/travodds_example/src/HelloWorld.h b/example/travodds-fastdds/travodds_example/src/HelloWorld.h new file mode 100644 index 0000000000000000000000000000000000000000..34e9ab86d7b9f4f2b174399887c847806034eec3 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/src/HelloWorld.h @@ -0,0 +1,32 @@ +#ifndef HelloWorld_H +#define HelloWorld_H + +#include +#include +#include +#include +#include "cdr/travoddscdr.h" + +#if defined(DDS_TYPE_EXPORT) && defined(_WIN32) +#define DDS_TYPE_API __declspec(dllexport) +#else +#define DDS_TYPE_API +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +class DDS_TYPE_API HelloWorld { +public: + bool operator<(const HelloWorld& rhs) const { + return false; + } + unsigned int index; + std::string message; +}; + +#ifdef __cplusplus +} +#endif +#endif /* HelloWorld_H */ diff --git a/example/travodds-fastdds/travodds_example/src/HelloWorldTypeSupport.cpp b/example/travodds-fastdds/travodds_example/src/HelloWorldTypeSupport.cpp new file mode 100644 index 0000000000000000000000000000000000000000..13af13ffafb344b964c720f8862491442dd82aa2 --- /dev/null +++ b/example/travodds-fastdds/travodds_example/src/HelloWorldTypeSupport.cpp @@ -0,0 +1,121 @@ +#include "HelloWorldTypeSupport.h" + +USING_TRAVODDS_NAMESPACE + +#ifdef __cplusplus +extern "C" { +#endif + +HelloWorldTypeSupport* HelloWorldTypeSupport::get_instance() { + static HelloWorldTypeSupport instance; + return &instance; +} + +void* HelloWorldTypeSupport::create_data() { + return new HelloWorld(); +} + +void HelloWorldTypeSupport::delete_data(void* data) { + delete static_cast(data); +} + +int HelloWorldTypeSupport::copy_data(void* dst, void* src) { + HelloWorld* dstData = static_cast(dst); + HelloWorld* srcData = static_cast(src); + *dstData = *srcData; + return 0; +} + +unsigned int HelloWorldTypeSupport::get_serialized_data_size(void* data, unsigned int currentAlignment) { + HelloWorld* structData = static_cast(data); + unsigned int initialAlignment = currentAlignment; + unsigned int tmpAlignment = 0; + currentAlignment += TRAVODDS::CdrSerializer::getBaseTypeSize(sizeof(unsigned int), currentAlignment); + currentAlignment += TRAVODDS::CdrSerializer::getStringSize(structData->message.size() + 1, currentAlignment); + return currentAlignment - initialAlignment; +} + +unsigned int HelloWorldTypeSupport::get_max_serialized_data_size(void* data, unsigned int currentAlignment) { + return LENGTH_UNLIMITED; +} + +int HelloWorldTypeSupport::serialize_data(void* data, TRAVODDS::CdrSerializer* cdr, int endian) { + HelloWorld* structData = static_cast(data); + uint32_t tmpLength = 0; + if (!cdr->serializeBaseType(structData->index)) { + fprintf(stderr, "Serialization failed for field: structData->index\n"); + return -1; + } + if (!cdr->serializeString(structData->message)) { + fprintf(stderr, "Serialization failed for field: structData->message\n"); + return -1; + } + return 0; +} + +int HelloWorldTypeSupport::deserialize_data(void* data, TRAVODDS::CdrDeserializer* cdr, int endian) { + HelloWorld* structData = static_cast(data); + unsigned int tmpLength = 0; + char tmpCharEnum = 0; + short tmpShortEnum = 0; + int tmpIntEnum = 0; + if (!cdr->deserializeBaseType(structData->index)) { + fprintf(stderr, "Deserialization failed for field: structData->index\n"); + return -1; + } + if (!cdr->deserializeString(structData->message)) { + fprintf(stderr, "Deserialization failed for field: structData->message\n"); + return -1; + } + return 0; +} + +TypeObject* HelloWorldTypeSupport::get_typeobject() { + return nullptr; +} + +int HelloWorldTypeSupport::serialize_key(void* data, TRAVODDS::CdrSerializer* cdr, int endian) { + HelloWorld* structData = static_cast(data); + bool memberHasKey = false; + return 0; +} + +int HelloWorldTypeSupport::MakeKey(const void* data, InstanceHandle_t& iHandle, bool forceMd5) { + unsigned int serializedSize = get_serialized_data_size((void*)data, 0); + SerializedBuffer buffer; + buffer.buffer_size = serializedSize; + buffer.buffer = new char[buffer.buffer_size]; + TRAVODDS::CdrSerializer cdr(&buffer); + ReturnCode_t ret = get_instancehandle((void*)data, &cdr, iHandle, forceMd5); + delete[] buffer.buffer; + return ret == RETCODE_OK ? 0 : -1; +} + +ReturnCode_t HelloWorldTypeSupport::get_instancehandle(void* data, TRAVODDS::CdrSerializer* cdr, InstanceHandle_t& iHandle, bool forceMd5) { + if (!has_key()) { + iHandle = HANDLE_NIL; + return RETCODE_OK; + } + int ret = serialize_key(data, cdr, forceMd5); + if (ret != 0) { + fprintf(stderr, "Failed to serialize key.\n"); + return RETCODE_ERROR; + } + if (!cdr->getKeyHash((char*)&iHandle, forceMd5)) { + fprintf(stderr, "Failed to get key hash\n"); + return RETCODE_ERROR; + } + return RETCODE_OK; +} + +bool HelloWorldTypeSupport::has_key() { + return false; +} + +const char* HelloWorldTypeSupport::get_typename() { + return "HelloWorld"; +} + +#ifdef __cplusplus +} +#endif diff --git a/example/travodds-fastdds/travodds_example/src/HelloWorldTypeSupport.h b/example/travodds-fastdds/travodds_example/src/HelloWorldTypeSupport.h new file mode 100644 index 0000000000000000000000000000000000000000..86981d2c11abe747587dc40ff3d0043c5514d91f --- /dev/null +++ b/example/travodds-fastdds/travodds_example/src/HelloWorldTypeSupport.h @@ -0,0 +1,48 @@ +#ifndef HelloWorldTypeSupport_H +#define HelloWorldTypeSupport_H + +#include "dcps/topic/typesupport.h" +#include "HelloWorld.h" + +#ifdef __cplusplus +extern "C" { +#endif + +class DDS_TYPE_API HelloWorldTypeSupport : public TRAVODDS::TypeSupport { +public: + static HelloWorldTypeSupport* get_instance(); + + virtual void* create_data() override; + + virtual void delete_data(void* data) override; + + virtual int copy_data(void* dst, void* src) override; + + virtual unsigned int get_serialized_data_size(void* data, unsigned int currentAlignment) override; + + virtual unsigned int get_max_serialized_data_size(void* data, unsigned int currentAlignment) override; + + virtual int serialize_data(void* data, TRAVODDS::CdrSerializer* cdr, int endian) override; + + virtual int deserialize_data(void* data, TRAVODDS::CdrDeserializer* cdr, int endian) override; + + virtual TRAVODDS::TypeObject* get_typeobject() override; + + virtual TRAVODDS::ReturnCode_t get_instancehandle(void* data, TRAVODDS::CdrSerializer* cdr, TRAVODDS::InstanceHandle_t& iHandle, bool forceMd5 = false) override; + + virtual bool has_key() override; + + virtual const char* get_typename() override; + + virtual int MakeKey(const void* data, TRAVODDS::InstanceHandle_t& iHandle, bool forceMd5 = false) override; + + int serialize_key(void* data, TRAVODDS::CdrSerializer* cdr, int endian); + +private: + HelloWorldTypeSupport() = default; +}; + +#ifdef __cplusplus +} +#endif +#endif /* HelloWorldTypeSupport_H */ diff --git a/example/travodds-helloworld/HelloWorld/CMakeLists.txt b/example/travodds-helloworld/HelloWorld/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..44e5709f3c00e7f5607beacc14774d06c2d3a331 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/CMakeLists.txt @@ -0,0 +1,89 @@ +#Copyright(c)[2025][AGIROS][TravoDDS] is licensed under Mulan PSL v2. +# +#You can use this software according to the terms and conditions of +#the Mulan PSL v2.You may obtain a copy of Mulan PSL v2 at : +#http://license.coscl.org.cn/MulanPSL2 +# +#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF +#ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +#NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +# +#See the Mulan PSL v2 for more details. + +cmake_minimum_required(VERSION 3.10) +project(ConnenctPoint LANGUAGES CXX) +if(NOT TRAVODDS_FOUND) + find_package(TRAVODDS REQUIRED) +endif() + +#检测 C++11 +include(CheckCXXCompilerFlag) +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + check_cxx_compiler_flag(-std=c++11 SUPPORTS_CXX11) + if(NOT SUPPORTS_CXX11) + message(FATAL_ERROR "Compiler doesn't support C++11") + endif() +endif() + +# 设置CMAKE_BUILD_TYPE 默认为Release. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'Release' as none was specified.") + set(CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + +#############################基础配置############################# +add_compile_options("$<$:/source-charset:utf-8>") + +############################################################################### +# 警告等级 +############################################################################### +if(MSVC OR MSVC_IDE) + if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif() + + # 为 MSVC 编译器添加额外的警告选项,目的是使 MSVC 编译器的行为更加接近 GCC 或 Clang 编译器。 + # C4101 未引用的局部变量 + # C4189 已初始化但未引用的局部变量 + # C4555 表达式无效,应该是有副作用的表达式 + # C4715 函数的所有控制路径未返回值 + # C5038 数据成员初始化顺序警告 + # C4100 未引用的形式参数 + #add_compile_options(/w34101 /w34189 /w34555 /w34715 /w35038 /w44100) + #add_compile_options(/w34189 /w34555 /w34715 /w35038) +else() + # 添加 GCC 和 Clang 编译器配置通用的警告和链接器选项 + #set(CMAKE_CXX_FLAGS + # "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra -Wno-unknown-pragmas -Wno-error=deprecated-declarations -Wno-switch-bool") + #add_compile_options(-Wno-narrowing) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15,0) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-builtins") + endif() + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl") + endif() +endif() + +message(STATUS "Configuring example...") +#收集源文件 +file(GLOB_RECURSE SOURCES_FILES + "src/ConnectPoint.cpp" + "src/HelloWorld.cpp" + "src/HelloWorldTypeSupport.cpp" +) +add_executable(ConnectPoint ${SOURCES_FILES}) + +target_link_libraries(ConnectPoint PRIVATE TRAVODDS::TRAVODDS) + +if(TRAVODDS_INCLUDE_DIR) + include_directories(${TRAVODDS_INCLUDE_DIR}) +endif() + diff --git a/example/travodds-helloworld/HelloWorld/config/ca.key.pem b/example/travodds-helloworld/HelloWorld/config/ca.key.pem new file mode 100644 index 0000000000000000000000000000000000000000..7836dacd2e2381021cc31420b8b6f48e9c6886ae --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/ca.key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgru/rnDjwLmTcRDgt ++C8hwFsOnYuO0G7cex/oA0RUJXKhRANCAAR4k5HXYrJm/muqAzpygt835dHQYdx2 +0JJLvS6T1NfjmXKBqfxktfdnYLnAPQLRxMt+gg3BsfxDl+mQ2E10GI/P +-----END PRIVATE KEY----- diff --git a/example/travodds-helloworld/HelloWorld/config/cert.pem b/example/travodds-helloworld/HelloWorld/config/cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..cb467b403362c9e70db12246e83021d754058f7f --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBQzCB66ADAgECAhRSujF8MSuyE+NrrGkGZ76zd9MN3DAKBggqhkjOPQQDAjAS +MRAwDgYDVQQDDAdzcm9zMkNBMB4XDTI1MTExMDA3MjI1MVoXDTM1MTEwOTA3MjI1 +MVowJDEiMCAGA1UEAwwZL3RhbGtlcl9saXN0ZW5lci9saXN0ZW5lcjBZMBMGByqG +SM49AgEGCCqGSM49AwEHA0IABD7M1zsBoRk0ocvrbbJIXS6kATnEZJ3R4G1JiHtS +TUPQFHR7J2X7Rx9mKU3cwEUs4mXSF+JMC5gWPWPAyuWWvjSjDTALMAkGA1UdEwQC +MAAwCgYIKoZIzj0EAwIDRwAwRAIgffaAzHHudjOPTbqKoBlNjdYii++rnY1lGsFL +uIOuTxoCIF788nB4ovJ3q1w9XKe8luIYoXUyf9K1wM2IN0pUixop +-----END CERTIFICATE----- diff --git a/example/travodds-helloworld/HelloWorld/config/governance.p7s b/example/travodds-helloworld/HelloWorld/config/governance.p7s new file mode 100644 index 0000000000000000000000000000000000000000..6e5ca8ac3f5f69c72be8251522fcfbf52586c064 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/governance.p7s @@ -0,0 +1,58 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----E61178EE2C2E014D53C8BE4EE4C75154" + +This is an S/MIME signed message + +------E61178EE2C2E014D53C8BE4EE4C75154 +Content-Type: text/plain + + + + + + 0 + + false + true + ENCRYPT + ENCRYPT + SIGN + + + * + true + true + true + true + ENCRYPT + ENCRYPT + + + + + + +------E61178EE2C2E014D53C8BE4EE4C75154 +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC9wYJKoZIhvcNAQcCoIIC6DCCAuQCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggE+MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoG +CCqGSM49BAMCMBIxEDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcN +MzUxMTA5MDcyMDQ2WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYI +KoZIzj0DAQcDQgAEeJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8 +ZLX3Z2C5wD0C0cTLfoINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB +/wIBATAKBggqhkjOPQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMT +fRXqYFkcNMoCIEGoUYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1MYIBfTCC +AXkCAQEwKTASMRAwDgYDVQQDDAdzcm9zMkNBAhMZsdvUkGYgEGBIvSDwW4lLNB59 +MA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ +KoZIhvcNAQkFMQ8XDTI1MTExMTA3MjA0NlowLwYJKoZIhvcNAQkEMSIEIE5xbOoV +CiYGQXDWxmE0xABZL5D8kRnSwh5MHHqVAwESMHkGCSqGSIb3DQEJDzFsMGowCwYJ +YIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcNAwcw +DgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3 +DQMCAgEoMAoGCCqGSM49BAMCBEcwRQIgEwMiEwm1Hgm5BmOYdod0l00F6hATEyio +/9a6OGF6uycCIQCop9NTL/oPysIkplRfZWgiIBE0TPG6jiz3u7xafD3I9Q== + +------E61178EE2C2E014D53C8BE4EE4C75154-- + diff --git a/example/travodds-helloworld/HelloWorld/config/governance.xml b/example/travodds-helloworld/HelloWorld/config/governance.xml new file mode 100644 index 0000000000000000000000000000000000000000..c6fb08f5fef5b5ba484a4937405300aade62c86f --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/governance.xml @@ -0,0 +1,26 @@ + + + + + + 0 + + FALSE + FALSE + NONE + NONE + NONE + + + * + FALSE + FALSE + FALSE + FALSE + ENCRYPT + NONE + + + + + diff --git a/example/travodds-helloworld/HelloWorld/config/identity_ca.cert.pem b/example/travodds-helloworld/HelloWorld/config/identity_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..a055be03d399613b2644d579c3318afe4021664e --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/identity_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoGCCqGSM49BAMCMBIx +EDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcNMzUxMTA5MDcyMDQ2 +WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE +eJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8ZLX3Z2C5wD0C0cTL +foINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB/wIBATAKBggqhkjO +PQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMTfRXqYFkcNMoCIEGo +UYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1 +-----END CERTIFICATE----- diff --git a/example/travodds-helloworld/HelloWorld/config/identity_ca.key.pem b/example/travodds-helloworld/HelloWorld/config/identity_ca.key.pem new file mode 100644 index 0000000000000000000000000000000000000000..7836dacd2e2381021cc31420b8b6f48e9c6886ae --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/identity_ca.key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgru/rnDjwLmTcRDgt ++C8hwFsOnYuO0G7cex/oA0RUJXKhRANCAAR4k5HXYrJm/muqAzpygt835dHQYdx2 +0JJLvS6T1NfjmXKBqfxktfdnYLnAPQLRxMt+gg3BsfxDl+mQ2E10GI/P +-----END PRIVATE KEY----- diff --git a/example/travodds-helloworld/HelloWorld/config/key.pem b/example/travodds-helloworld/HelloWorld/config/key.pem new file mode 100644 index 0000000000000000000000000000000000000000..4412e55150d4c8b3f1ebedd4e18ce798e5a91021 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgJBGkfSuxfMwcLA92 +Oh78PEgR+cNcnVNu4+OTUQuzIH2hRANCAAQ+zNc7AaEZNKHL622ySF0upAE5xGSd +0eBtSYh7Uk1D0BR0eydl+0cfZilN3MBFLOJl0hfiTAuYFj1jwMrllr40 +-----END PRIVATE KEY----- diff --git a/example/travodds-helloworld/HelloWorld/config/permissions.p7s b/example/travodds-helloworld/HelloWorld/config/permissions.p7s new file mode 100644 index 0000000000000000000000000000000000000000..9e88cfb2e5786cff4519fc5ff02796e8ff91785e --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/permissions.p7s @@ -0,0 +1,95 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----B8214CD690DE0A655D8A15FBAF0C32FA" + +This is an S/MIME signed message + +------B8214CD690DE0A655D8A15FBAF0C32FA +Content-Type: text/plain + + + + + CN=/talker_listener/listener + + 2025-11-10T07:22:51 + 2035-11-09T07:22:51 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + + +------B8214CD690DE0A655D8A15FBAF0C32FA +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIC9wYJKoZIhvcNAQcCoIIC6DCCAuQCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggE+MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoG +CCqGSM49BAMCMBIxEDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcN +MzUxMTA5MDcyMDQ2WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYI +KoZIzj0DAQcDQgAEeJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8 +ZLX3Z2C5wD0C0cTLfoINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB +/wIBATAKBggqhkjOPQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMT +fRXqYFkcNMoCIEGoUYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1MYIBfTCC +AXkCAQEwKTASMRAwDgYDVQQDDAdzcm9zMkNBAhMZsdvUkGYgEGBIvSDwW4lLNB59 +MA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ +KoZIhvcNAQkFMQ8XDTI1MTExMTA5MTkzNVowLwYJKoZIhvcNAQkEMSIEIBvkrVSU +V1bgL+Uh9vkFHppjJayGUGET2hnfkK92OxI1MHkGCSqGSIb3DQEJDzFsMGowCwYJ +YIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcNAwcw +DgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3 +DQMCAgEoMAoGCCqGSM49BAMCBEcwRQIgSJYtnftxu65ObkfFQClaRJRXqiQoYbLF +KPE6ekmETSECIQD7gUFjQSLrAhsrbK8bi4mnwAkY8NLDrJMaqOoEFMU0cA== + +------B8214CD690DE0A655D8A15FBAF0C32FA-- + diff --git a/example/travodds-helloworld/HelloWorld/config/permissions.xml b/example/travodds-helloworld/HelloWorld/config/permissions.xml new file mode 100644 index 0000000000000000000000000000000000000000..d3e039c83cba9e2bcce2cb8bb6c20d69a4233afd --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/permissions.xml @@ -0,0 +1,62 @@ + + + + CN=/talker_listener/listener + + 2025-11-10T07:22:51 + 2035-11-09T07:22:51 + + + + 0 + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + rq/*/_action/cancel_goalRequest + rq/*/_action/get_resultRequest + rq/*/_action/send_goalRequest + rq/*Request + rr/*/_action/cancel_goalReply + rr/*/_action/get_resultReply + rr/*/_action/send_goalReply + rt/*/_action/feedback + rt/*/_action/status + rr/*Reply + rt/* + + + + + + 0 + + + + ros_discovery_info + + + + + ros_discovery_info + + + + DENY + + + diff --git a/example/travodds-helloworld/HelloWorld/config/permissions_ca.cert.pem b/example/travodds-helloworld/HelloWorld/config/permissions_ca.cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..a055be03d399613b2644d579c3318afe4021664e --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config/permissions_ca.cert.pem @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBOjCB4aADAgECAhMZsdvUkGYgEGBIvSDwW4lLNB59MAoGCCqGSM49BAMCMBIx +EDAOBgNVBAMMB3Nyb3MyQ0EwHhcNMjUxMTEwMDcyMDQ2WhcNMzUxMTA5MDcyMDQ2 +WjASMRAwDgYDVQQDDAdzcm9zMkNBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE +eJOR12KyZv5rqgM6coLfN+XR0GHcdtCSS70uk9TX45lygan8ZLX3Z2C5wD0C0cTL +foINwbH8Q5fpkNhNdBiPz6MWMBQwEgYDVR0TAQH/BAgwBgEB/wIBATAKBggqhkjO +PQQDAgNIADBFAiEA7AlAXET8CXFaKYc0BeVPDhtrG5/1WIMTfRXqYFkcNMoCIEGo +UYbLn1UkCIhg+VyixvvbRz7itAPldHse4gTUJ4q1 +-----END CERTIFICATE----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app1.csr b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app1.csr new file mode 100644 index 0000000000000000000000000000000000000000..b8e4fc28bc1ec583dbed98b8964e294c10a4a7e8 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app1.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICezCCAWMCAQAwNjELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQK +DAJaUjENMAsGA1UEAwwEYXBwMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALp8MgWb1Ic7eL98hqtzTGJZkn+EKgp/1GqWfHd2DzhaxdLtzQRug32PB3vj +xqfSkl7BpbgrZtx0n4dBOUOXrslOuQqyEmsc9pa4xsNSFfPGwDZGtluO0cUXS3U5 +D357o42jG+ViBsyFXwEz2KPhhvAHPnv7Kc4Hw30SwEM7x9IkHLrcKDlYo+DlndkP +41WsK1Ph6JCYVQNh9W2YU3BhEWb9QBSvRPFP844Z3WE2Gu1jzGMa9G9je1Q/MddN +ZYr5vmsxY2jMHdGzLteh35YUouN5TQkoUH5KK8OaTFlQouRdisE+2WuTxKbD1uU7 +NLJQ+in+5TG6fguo2SDtiYJcHisCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQCY +g5OqQbMDPu9OtbUZ4zAnghhwuIc8ZjZiq1hXq/cEwZ30FkPDsMTwwhLW1aWToygl ++b0zpBcAQxCHgETNOjzluCOtfqexgsKTMAeTlV3KU7AJ1t3iv7ubem0hYp2mFUWb +VG4ObEK/XeLMPAcUSUC+e5IweplCSW3IhdbnV/3NIBZCm4SSc4NI3folbF+D2MBf +dJYXP5T7VCoMZjGXEv149ArZVGWGFxY801oAofoZtdDXRzUG/VypMOIeWtSRK5Zb +aEJM7mwjTs3hFR6MUqOBIh6GyZ6EwDY83bjfbfkBepY72KbpJprg+shIAIuuB4CL +r95BdmYlrJr2Qk6F/ECI +-----END CERTIFICATE REQUEST----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app1.key b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app1.key new file mode 100644 index 0000000000000000000000000000000000000000..dd00553431881ffc6526505bd236b1209cb58515 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app1.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAunwyBZvUhzt4v3yGq3NMYlmSf4QqCn/UapZ8d3YPOFrF0u3N +BG6DfY8He+PGp9KSXsGluCtm3HSfh0E5Q5euyU65CrISaxz2lrjGw1IV88bANka2 +W47RxRdLdTkPfnujjaMb5WIGzIVfATPYo+GG8Ac+e/spzgfDfRLAQzvH0iQcutwo +OVij4OWd2Q/jVawrU+HokJhVA2H1bZhTcGERZv1AFK9E8U/zjhndYTYa7WPMYxr0 +b2N7VD8x101livm+azFjaMwd0bMu16HflhSi43lNCShQfkorw5pMWVCi5F2KwT7Z +a5PEpsPW5Ts0slD6Kf7lMbp+C6jZIO2JglweKwIDAQABAoIBAHJCCfv5wDujKpZY +W8LMf+56ZxIODhwkuiccUOJ4yVaD91UHMmgWtiXF7pXvtxW4JMo956VxojJMmjmq +ssVBOGxK+YEeHb7XHha228Fsl9qm2bnnlW9/j/MsFKWb8mxSoKD1YPAoIXZJ+S2p +cIDoe16xcY1RFAoSI6qMRJRtGj8bqK8mhPMJ2qqmWtf6gEMRFsQKu6mnhLo0gXIX +fzTDFzeh0UkpnT77oBoZVMQPtV3gENIPFb0oqt9aG+LO+pwKjOmv/NV8UZGCcr0D +7zw654fKFxnVe+P1Kbtva2m96U7l2unolU0UHfXjfo5wzO4ke89uAFeKcWBB9gEV +Pe0O51ECgYEA6ySQXY4Splfb0zbZreVeMHvMHSodHiZiG8N9j7UByBRtlBGg24KW +8FZObKBwGNgKqddH9qcXmHBG9nFJVQ/ru1NBrmhTTMB6SFylchKzA/zNHgRPjOZv +ktswD780FbrfgYI8lx/PctmFBlWR/l6otlMa8vLUfegMbAdEPjV0gS0CgYEAywbA +XB8Y+ALNi/X2wjlnQNOc3eZAKZQev3hlP0LWAqB5tYFPYAgCMiSe9bKnunbVHs8z +Wes+fCF8jZXDNEda62NW6NmzqwuPjc0fhEXEnsttIzMG3D6G7YTjBUs9HExyqdur +cWzsRjYMbtnzrnj7oXhK6UwnhYjex71jRcB5Q7cCgYBlB3q3l5lPuyQJ5eE1I/2K +G0ahqTyFfbxdbWr/WagATTafjcttRPiRHqPnbC99nSVHv+V9hmFO776tmBMH5yVD +gQwRYWWY7oIboSK8lmgv6GhA411CjqeVk3Nc8KvyQi5RuKFL1TEOiYLsK8vkXMtk +OuSzSb4esprTt3OMvu7lqQKBgQCZsHuvgM7698w3tjNc5e120no+NE2/6+O21+H1 +GJg/FtHrh37Z2FYpNTWsEtkLu2cr0ngyCnWbrBHIcGV7zsRRyjqBPEPZKIA8PNot +3E6yUpZEfh0kXqTvapgcas9Q+8IVOTg4PddCcynIRG9GVUlO+2vh3YdRe8IBfCmJ +JOHnUwKBgCm0CgWDxsPrleDZuT6r8AvjNcS1Lmxh9MKMGQYzukCML4wiO6VPC5BX +BSNXDno5UobpCp/2pjLhd0irq+oP89ehaLl5G1XVtSl8hqP/q/WFs86aLYv1BaUN +B5NTUmSmbhxvz01/FCTO3h59YLegkNyLCoetS5HO26Qx4PsuF2zp +-----END RSA PRIVATE KEY----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app1Cert.pem b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app1Cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..f198a3a5bb9eff6d8055803d65e7ff81f76d5e08 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app1Cert.pem @@ -0,0 +1,82 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 3 (0x3) + Signature Algorithm: md5WithRSAEncryption + Issuer: C=CN, ST=JS, L=NJ, O=ZR, CN=demoCA + Validity + Not Before: Jun 19 02:30:58 2025 GMT + Not After : Jun 19 02:30:58 2026 GMT + Subject: C=CN, ST=JS, O=ZR, CN=app1 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:ba:7c:32:05:9b:d4:87:3b:78:bf:7c:86:ab:73: + 4c:62:59:92:7f:84:2a:0a:7f:d4:6a:96:7c:77:76: + 0f:38:5a:c5:d2:ed:cd:04:6e:83:7d:8f:07:7b:e3: + c6:a7:d2:92:5e:c1:a5:b8:2b:66:dc:74:9f:87:41: + 39:43:97:ae:c9:4e:b9:0a:b2:12:6b:1c:f6:96:b8: + c6:c3:52:15:f3:c6:c0:36:46:b6:5b:8e:d1:c5:17: + 4b:75:39:0f:7e:7b:a3:8d:a3:1b:e5:62:06:cc:85: + 5f:01:33:d8:a3:e1:86:f0:07:3e:7b:fb:29:ce:07: + c3:7d:12:c0:43:3b:c7:d2:24:1c:ba:dc:28:39:58: + a3:e0:e5:9d:d9:0f:e3:55:ac:2b:53:e1:e8:90:98: + 55:03:61:f5:6d:98:53:70:61:11:66:fd:40:14:af: + 44:f1:4f:f3:8e:19:dd:61:36:1a:ed:63:cc:63:1a: + f4:6f:63:7b:54:3f:31:d7:4d:65:8a:f9:be:6b:31: + 63:68:cc:1d:d1:b3:2e:d7:a1:df:96:14:a2:e3:79: + 4d:09:28:50:7e:4a:2b:c3:9a:4c:59:50:a2:e4:5d: + 8a:c1:3e:d9:6b:93:c4:a6:c3:d6:e5:3b:34:b2:50: + fa:29:fe:e5:31:ba:7e:0b:a8:d9:20:ed:89:82:5c: + 1e:2b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 9B:3F:65:39:57:61:C7:85:26:82:67:25:D5:5A:74:FD:F0:E8:62:A3 + X509v3 Authority Key Identifier: + DirName:/C=CN/ST=JS/L=NJ/O=ZR/CN=demoCA + serial:FF:63:39:EF:B0:3B:7A:5D + + Signature Algorithm: md5WithRSAEncryption + 7f:16:c8:f6:01:bd:6e:02:8c:e7:3a:8c:6e:a6:63:21:b8:f2: + d9:0d:b3:0c:2a:df:99:5b:95:5e:00:76:6e:16:38:ee:d4:d4: + f1:b7:d2:b2:40:89:85:0c:d0:59:0f:06:cb:9b:56:10:4e:f8: + 26:b8:bb:0b:c5:88:71:b5:88:35:81:22:74:9d:b2:8f:b3:3d: + 1e:a7:c7:8a:4c:b6:0e:c9:af:96:cd:9f:68:c3:91:10:15:ea: + 51:8c:9d:41:c0:9a:ec:04:3c:0b:4d:c0:bd:e7:f4:0e:fd:d4: + b7:a5:23:82:25:1d:91:cc:dc:27:36:43:2b:b2:2f:1a:9c:c9: + 92:68:19:3b:6b:fd:36:a1:c8:52:57:b3:59:78:41:46:12:10: + c4:49:ad:c9:06:ba:5e:cf:73:18:07:4a:f3:1d:8c:b6:8a:26: + 14:bc:60:d0:50:6a:0b:30:96:26:ae:28:0c:5d:f4:a2:68:9f: + 9c:75:c4:eb:97:24:3a:b4:45:96:a4:00:b9:d8:dc:0d:d0:32: + 29:66:b0:6c:5e:07:79:f3:d8:08:7b:54:91:1e:42:6b:03:5e: + 71:8f:3b:c2:69:cb:15:18:ba:8e:09:6c:63:7c:e3:c4:da:c9: + 7d:03:32:49:cd:80:be:81:76:d7:b3:08:31:ed:3e:5c:ba:3d: + fd:01:8b:1d +-----BEGIN CERTIFICATE----- +MIIDszCCApugAwIBAgIBAzANBgkqhkiG9w0BAQQFADBFMQswCQYDVQQGEwJDTjEL +MAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQKDAJaUjEPMA0GA1UEAwwG +ZGVtb0NBMB4XDTI1MDYxOTAyMzA1OFoXDTI2MDYxOTAyMzA1OFowNjELMAkGA1UE +BhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQKDAJaUjENMAsGA1UEAwwEYXBwMTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALp8MgWb1Ic7eL98hqtzTGJZ +kn+EKgp/1GqWfHd2DzhaxdLtzQRug32PB3vjxqfSkl7BpbgrZtx0n4dBOUOXrslO +uQqyEmsc9pa4xsNSFfPGwDZGtluO0cUXS3U5D357o42jG+ViBsyFXwEz2KPhhvAH +Pnv7Kc4Hw30SwEM7x9IkHLrcKDlYo+DlndkP41WsK1Ph6JCYVQNh9W2YU3BhEWb9 +QBSvRPFP844Z3WE2Gu1jzGMa9G9je1Q/MddNZYr5vmsxY2jMHdGzLteh35YUouN5 +TQkoUH5KK8OaTFlQouRdisE+2WuTxKbD1uU7NLJQ+in+5TG6fguo2SDtiYJcHisC +AwEAAaOBvDCBuTAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdl +bmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUmz9lOVdhx4Umgmcl1Vp0/fDo +YqMwXwYDVR0jBFgwVqFJpEcwRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQsw +CQYDVQQHDAJOSjELMAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQYIJAP9jOe+w +O3pdMA0GCSqGSIb3DQEBBAUAA4IBAQB/Fsj2Ab1uAoznOoxupmMhuPLZDbMMKt+Z +W5VeAHZuFjju1NTxt9KyQImFDNBZDwbLm1YQTvgmuLsLxYhxtYg1gSJ0nbKPsz0e +p8eKTLYOya+WzZ9ow5EQFepRjJ1BwJrsBDwLTcC95/QO/dS3pSOCJR2RzNwnNkMr +si8anMmSaBk7a/02ochSV7NZeEFGEhDESa3JBrpez3MYB0rzHYy2iiYUvGDQUGoL +MJYmrigMXfSiaJ+cdcTrlyQ6tEWWpAC52NwN0DIpZrBsXgd589gIe1SRHkJrA15x +jzvCacsVGLqOCWxjfOPE2sl9AzJJzYC+gXbXswgx7T5cuj39AYsd +-----END CERTIFICATE----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app2.csr b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app2.csr new file mode 100644 index 0000000000000000000000000000000000000000..7cc05a2bd4338f09238a50efb8e935e1f86ee3ab --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app2.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICezCCAWMCAQAwNjELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQK +DAJaUjENMAsGA1UEAwwEYXBwMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALOuA5nfAAfSxsGPI2dplqeOkIcXBHpM9ibul9Puqgg2TWufYmp1+Ln0nv3k +JwGP24mP5rtPIJzab5wlRzktTaJDI1v44biouccw/qFkyvWZMguUjbYhmt9k8cxD +05b284+gFkBSo3WByaoMoIpFBpHqIGuPsmFb4PPox+z9GX/0wyBxoepPI7onLJb7 +6HNoq1MmSPcnJseYFt5xN8xkP0fbD2Q9UrM81nZVwXYTTJbxRfMC6NxtnmA/PC1j +hBDJGAcccUOG+5gxIa8ddfnz4tiZSVz/hXw6wj0MDuXd9bVjY7d+V1FjUkE+nhOP +i/AHodVK8wOiUUlARBCf6Rf/Y+0CAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQAm +xjUjhpIllOtzdmBFC+8p1R6ab+VsWtClTD9sxlfzMQOd5vrhTSn8Sp/s7nzgDgIK +fExYgAikrEyHvZoElVg1MTO2sDDvzV+018+scTV75w0rlZKwSl161eyWNc/MVyPQ +bFaRTgwzVd4h5oK7zMh5YWzQiMAeAU6JBCu3Lzbs4tB8/TolCGDXDh8OkUFKruKN +RNZ+hNffBiN1xRpLdbyjcOoJQ2CQurcGbeVszRcJ2gavAhrs9TWeS/USJ9EhwnUI +9/bF/NH6OpSWnapva24Y6D5DQtOyrDF74OZdTeYYMiGEvWcHx2wwnk7WB3tH/FPJ +nb7jVAaUVR6nzgDwXSDR +-----END CERTIFICATE REQUEST----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app2.key b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app2.key new file mode 100644 index 0000000000000000000000000000000000000000..3c1cb958087d79bcedd877e4a3f458b200e24d68 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app2.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAs64Dmd8AB9LGwY8jZ2mWp46QhxcEekz2Ju6X0+6qCDZNa59i +anX4ufSe/eQnAY/biY/mu08gnNpvnCVHOS1NokMjW/jhuKi5xzD+oWTK9ZkyC5SN +tiGa32TxzEPTlvbzj6AWQFKjdYHJqgygikUGkeoga4+yYVvg8+jH7P0Zf/TDIHGh +6k8juicslvvoc2irUyZI9ycmx5gW3nE3zGQ/R9sPZD1SszzWdlXBdhNMlvFF8wLo +3G2eYD88LWOEEMkYBxxxQ4b7mDEhrx11+fPi2JlJXP+FfDrCPQwO5d31tWNjt35X +UWNSQT6eE4+L8Aeh1UrzA6JRSUBEEJ/pF/9j7QIDAQABAoIBAFKkQ9W+4qW2hWI7 +cr46q2dPxBvOM2oJAeJwNPbuO9hhGYTZnwt2TTtCTupZyLMINqJzxFz8jPR354O7 +BaI/uwhZtuazdyZWvHPojgUvdcY2evUmk3Nky3XaWPhpbeVumiHCMNnO6I3Abz++ +ZQyTqOzt8ZFnW1U6TCIDPAk9dEAMTmY2/YVWmyKyzJdhUVYpKSJpVdAxBW3xSFvA +p3a6KM4Dk8gZH5jUZ5G8Gz2h8Zyb5jImKb6KWhL8uJjceFun0WCDk1IOWYJmji4n +ZCUQRhxbl54nC3dkREhS2UuXyhAFtsMweznzSkXt6uQOczwtlZqjQ1mM/RQklkLn +1nH8x4ECgYEA7dkuGzxcjkeSxbP9VSZ2ebSUlTpY+WaFzP+8RrMoCAcusbDcFlOA +ICUpLT/kp6EfZB82risdp503Bw+kO9N6+04iKTwDy+/UwM/fhHBSJ8qhI4a+gWdl +qZPmI+2ITdZabyiSJ6lWYWJcBLFVUr2cSiQYPnt55dx5xSa9I9pk92ECgYEAwWRm +QW86EGeMTBlF5GuTV9lwBqptoj26BRGuSBRAzCXXVUUii1C/TJJIeD0IzFQRtSM2 +HEyacxGePudMiI4FChhNRDPDU+7IdBgFM0KLBPIMH4mTK6eDw1hUO4vlrARwfCft +f7+1DhNgul7Ca7ldHm52XituGR6cKfjxW7OTVA0CgYAi9dZKGJA+NZUETFWDS5kE +gJ+KY74qQoCORlTFS5Ypv+yEH8vp2DIwB2ZLCWYxoYQ8sj3WUe4U8g3hktIAHTCp +ea2ZxAGG22S5RpTDIcNhp+4Ri7+6w5j02RFt3H85ebVnO15oSAKzY8LEydARzl8H +otCRdpLPT53ydaQ9fd9zYQKBgQCoDAofCfu2jYQIDF4DYsciKzuBT079EA44oWiE +EbVMsAUxf2XJEV1puCNo+ABRLSxF7lbyuE3td32+w1Zpwp72aq+ZeDFfGbrtxoGe +TVBn97w5G17bLDD+6h4nsCTfGOx1tmxV+cvmc0g2KmlfGi+kZfBNXAfLpCGnBz8T +pDN9cQKBgQCs0hqCTf2nYbKLUw3BIA98RDdg5MRwDQvGQ/Vimie83WoUHzvT1a1K +ek99q7amKRxxxNnWrxiyPAMYC30EfXhnM2p1oRspBlz2zOjzvyjFIzUPdrbGvJbT +vRdJWYHiY0SZWw2aHR++IKHXSWUM2wt46tj31Ksf6G8hGldPhX2LsA== +-----END RSA PRIVATE KEY----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app2Cert.pem b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app2Cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..e0a2d96fa9646b590ba7621bc53dc35c7cd8b891 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/app2Cert.pem @@ -0,0 +1,82 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4 (0x4) + Signature Algorithm: md5WithRSAEncryption + Issuer: C=CN, ST=JS, L=NJ, O=ZR, CN=demoCA + Validity + Not Before: Jun 19 03:33:12 2025 GMT + Not After : Jun 19 03:33:12 2026 GMT + Subject: C=CN, ST=JS, O=ZR, CN=app2 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:b3:ae:03:99:df:00:07:d2:c6:c1:8f:23:67:69: + 96:a7:8e:90:87:17:04:7a:4c:f6:26:ee:97:d3:ee: + aa:08:36:4d:6b:9f:62:6a:75:f8:b9:f4:9e:fd:e4: + 27:01:8f:db:89:8f:e6:bb:4f:20:9c:da:6f:9c:25: + 47:39:2d:4d:a2:43:23:5b:f8:e1:b8:a8:b9:c7:30: + fe:a1:64:ca:f5:99:32:0b:94:8d:b6:21:9a:df:64: + f1:cc:43:d3:96:f6:f3:8f:a0:16:40:52:a3:75:81: + c9:aa:0c:a0:8a:45:06:91:ea:20:6b:8f:b2:61:5b: + e0:f3:e8:c7:ec:fd:19:7f:f4:c3:20:71:a1:ea:4f: + 23:ba:27:2c:96:fb:e8:73:68:ab:53:26:48:f7:27: + 26:c7:98:16:de:71:37:cc:64:3f:47:db:0f:64:3d: + 52:b3:3c:d6:76:55:c1:76:13:4c:96:f1:45:f3:02: + e8:dc:6d:9e:60:3f:3c:2d:63:84:10:c9:18:07:1c: + 71:43:86:fb:98:31:21:af:1d:75:f9:f3:e2:d8:99: + 49:5c:ff:85:7c:3a:c2:3d:0c:0e:e5:dd:f5:b5:63: + 63:b7:7e:57:51:63:52:41:3e:9e:13:8f:8b:f0:07: + a1:d5:4a:f3:03:a2:51:49:40:44:10:9f:e9:17:ff: + 63:ed + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 31:A4:01:D4:3E:66:AA:B1:8A:9E:D3:F3:B4:F8:10:29:66:17:A5:1F + X509v3 Authority Key Identifier: + DirName:/C=CN/ST=JS/L=NJ/O=ZR/CN=demoCA + serial:FF:63:39:EF:B0:3B:7A:5D + + Signature Algorithm: md5WithRSAEncryption + 57:3d:b8:ba:1a:47:92:81:c0:75:35:f3:e0:cf:48:bc:1f:a8: + 6b:2d:03:99:e2:01:ee:13:e1:d8:b4:c5:0c:d7:76:24:b8:cd: + 42:10:f1:09:d1:19:a7:2d:e9:92:1e:5e:4d:e9:24:12:56:a2: + 4b:5d:09:85:83:7b:cf:a7:96:2f:91:f7:74:d4:f8:9c:ee:b7: + fe:dc:45:79:a5:d1:3d:08:2c:70:63:09:aa:4d:fc:1e:c7:cc: + 20:cd:b3:06:3b:5b:8c:00:ce:59:0a:8b:76:7b:e2:5f:24:4d: + d6:c8:ab:9c:fa:dd:46:a8:77:ce:32:8d:a6:4a:22:0f:26:cd: + f3:fe:cd:e9:3d:a3:88:a4:9c:12:5f:08:e4:eb:b3:8d:49:3b: + 8e:10:36:d2:d6:01:69:37:f8:eb:cc:90:73:fe:bd:45:2b:9d: + 47:a9:dc:bf:03:9a:c0:e1:68:b9:1d:cd:7e:0f:58:a1:96:18: + 36:93:f2:67:4e:38:71:ae:36:ce:d9:e2:de:41:16:a3:8d:4b: + aa:be:26:4e:9b:78:29:c0:40:b2:37:b0:de:5e:6d:af:82:ad: + f5:00:45:66:07:b6:28:d2:cb:e3:55:00:1e:33:a7:a9:26:46: + 57:01:66:30:08:1b:49:18:72:6b:07:9d:c5:c3:66:c9:ab:47: + 94:cf:5a:3d +-----BEGIN CERTIFICATE----- +MIIDszCCApugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBFMQswCQYDVQQGEwJDTjEL +MAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQKDAJaUjEPMA0GA1UEAwwG +ZGVtb0NBMB4XDTI1MDYxOTAzMzMxMloXDTI2MDYxOTAzMzMxMlowNjELMAkGA1UE +BhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQKDAJaUjENMAsGA1UEAwwEYXBwMjCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOuA5nfAAfSxsGPI2dplqeO +kIcXBHpM9ibul9Puqgg2TWufYmp1+Ln0nv3kJwGP24mP5rtPIJzab5wlRzktTaJD +I1v44biouccw/qFkyvWZMguUjbYhmt9k8cxD05b284+gFkBSo3WByaoMoIpFBpHq +IGuPsmFb4PPox+z9GX/0wyBxoepPI7onLJb76HNoq1MmSPcnJseYFt5xN8xkP0fb +D2Q9UrM81nZVwXYTTJbxRfMC6NxtnmA/PC1jhBDJGAcccUOG+5gxIa8ddfnz4tiZ +SVz/hXw6wj0MDuXd9bVjY7d+V1FjUkE+nhOPi/AHodVK8wOiUUlARBCf6Rf/Y+0C +AwEAAaOBvDCBuTAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdl +bmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUMaQB1D5mqrGKntPztPgQKWYX +pR8wXwYDVR0jBFgwVqFJpEcwRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQsw +CQYDVQQHDAJOSjELMAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQYIJAP9jOe+w +O3pdMA0GCSqGSIb3DQEBBAUAA4IBAQBXPbi6GkeSgcB1NfPgz0i8H6hrLQOZ4gHu +E+HYtMUM13YkuM1CEPEJ0RmnLemSHl5N6SQSVqJLXQmFg3vPp5Yvkfd01Pic7rf+ +3EV5pdE9CCxwYwmqTfwex8wgzbMGO1uMAM5ZCot2e+JfJE3WyKuc+t1GqHfOMo2m +SiIPJs3z/s3pPaOIpJwSXwjk67ONSTuOEDbS1gFpN/jrzJBz/r1FK51Hqdy/A5rA +4Wi5Hc1+D1ihlhg2k/JnTjhxrjbO2eLeQRajjUuqviZOm3gpwECyN7DeXm2vgq31 +AEVmB7Yo0svjVQAeM6epJkZXAWYwCBtJGHJrB53Fw2bJq0eUz1o9 +-----END CERTIFICATE----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/democa.csr b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/democa.csr new file mode 100644 index 0000000000000000000000000000000000000000..25c3769f5950bad183aefa2f727d42dbc942a1a7 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/democa.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICijCCAXICAQAwRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQH +DAJOSjELMAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBANBgugJZg5zHF9DWUAWrpNawQRUZsVxgSsdYyUPd +T4SWuzB13BGyEeBOUR7QOY1fyB8hTzXAE7/1CJruHn7I5qkCMQmaTQVIoMEvmPqM +Hwois7fQUElJLeozcxia9eudNs3BED3+5hQadDI91VHQq19RGFw85LXnb7VA8fP8 +fX69ZiC/yihHoELM1zsitbSdLJs9cXrN86koetc5H46cznJC0gSSX+D42IVfF7Bc +r6NAq6jUSSS1mQMqX/u5FpPwo4nNyQoRXCQgquX0u0Rc2AykBXSycMutStPVw4ze +yzd29JVaEu5oB9B+6kjZdZbDrQhKOqfQuLzYm2zCxnqtbEcCAwEAAaAAMA0GCSqG +SIb3DQEBCwUAA4IBAQAETOZads56ZQg2VIgzb6pfIp/dRydrVB1MBRxd9J3YOMNV +/tpqKc2yg3b1IRFJmKAx9Xh3ERn3SaRzawDAHIksLlGIh/RjgQBtLQzrOOhBDT6N +t5MNO6GPl1vvP11bOBI0mzBPWPZ69D/vAFiN9cKByrPoJgNEweO3Ei8YMmsoeZKz +miV9ZJrysw28v0j+zBhF31RC79xWkC1dq0uEJxeROUC3aDfbgNxc8DeEDftXCDWb +yALPaJzP8AllvUkZt+DYVHEr2o9qgk0bGN+VGtogr/IvY5zRMA/yRRvB53VdR9I+ +VB6bcghhUUkC0a+7OteLO+ezIBh6Ta+FDpUAJfNE +-----END CERTIFICATE REQUEST----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/democa.key b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/democa.key new file mode 100644 index 0000000000000000000000000000000000000000..9892f997a87a15f7e077ed1b519a0bad39a588be --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/democa.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA0GC6AlmDnMcX0NZQBauk1rBBFRmxXGBKx1jJQ91PhJa7MHXc +EbIR4E5RHtA5jV/IHyFPNcATv/UImu4efsjmqQIxCZpNBUigwS+Y+owfCiKzt9BQ +SUkt6jNzGJr16502zcEQPf7mFBp0Mj3VUdCrX1EYXDzktedvtUDx8/x9fr1mIL/K +KEegQszXOyK1tJ0smz1xes3zqSh61zkfjpzOckLSBJJf4PjYhV8XsFyvo0CrqNRJ +JLWZAypf+7kWk/Cjic3JChFcJCCq5fS7RFzYDKQFdLJwy61K09XDjN7LN3b0lVoS +7mgH0H7qSNl1lsOtCEo6p9C4vNibbMLGeq1sRwIDAQABAoIBAQCFT9yw9CPHgXgz +G2lGt3FWCJ0aqr1VpCUzNBJPYJ8m7GgFsOGCULIvFuu/Eug/EjAt+ll6wc/g1xsS +Q5Uu98jaB5Tn19e+saBm99SfNlYFXf4scxFqUW8WjqPr8fezLXmKWSHTB+iao/IC +0pxPI3kAGhnDqRGJbu+AvnQM7FQ9aDcN7at98DAi+l1/lVt6sCTrCZGNM3Dog8ZL +jMZPuPYpNrwEZ7wBWtKwpZaPDSwWf+u4gCWJZbP4TKzv7XBIra/45VwnL9fmZezT +m/WY9uvig5P7tan/8cEQVnuEKRcUYJks4otK0FFH6ocbiw/PnM3ZZEe5aLM2smPM +eJwfabwBAoGBAOg2Tf1EzMslfxmrp3Xn1oAKkSUz4jjabJiXjAZMlYkcq913WN+2 +23LhYvRRksXkUBLizTGKSWzdrX56CC7Uw4lag2OAmoo+AGr+hArEYYtp6+iRtPBg +Ww5EhPR58RepoHSB+c7z/4e7SdoFkGkiKPy6PNfmABkJihsTMjtgOuNBAoGBAOW5 +X+oHBFg+5OoxiKm+7j3QCPqdWNzHq+skjE/XAxVBxvzJky3BWRxNVL++5OfRhooR +hPq52/8Gd4ZVIRo3QEtuBlLmJhVqEkKUyd/NIVIMeSj0tg3wjJnXnCd36cYhgA72 +7NebFpwq65sLigquQ0U/Cy5PnHowzkQt0iOya1WHAoGBAILPBIPlm8/cIYsebUk3 +/ldGnJjub0NDl+UliZWK0rnYUuCA+KmdYmWGna2vvhSIFqts49ZCZjZTcgZLTAzF +ghj/yf/lVCkH4Ehlc5B1K9XTJzdtzRWT0fdpldP6VVvVDDRVe5mfTZTyZhnRBJaU +za4AY4HjaK6x9wBlgeh8vu+BAoGAXF0SMVgs6QYwp/DOj+FSjMvOMGV/SxWFDAAf +4iIC/VL7HLw3TthEadq1znqEMqjNvUmZ++0qhPkmqX4k1xOL6EgOhto+SbHiMZ79 +I9yoHwMg29S4NhaXkWtdP4k5Fw51HI8vXujeSGABZs9W60Bxj6/vYOllcsOYy1TY +/r1H5pUCgYAM06kfMGmplc8KcysxOcqWLWAO8WgSaXcy9THjZ8v88cbi2b55JXRK +Otu9pp7t7fEpB2ims5uI5dPLttQLjBJVUTVpdSDnIz8lAU4cIp65Ctz5YL/pKvL+ +7GZUhVWRf34roxsyYr4P+RU42CvNSb+0jSyzmGF05gb+nnMjQvCRKQ== +-----END RSA PRIVATE KEY----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/democa.pem b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/democa.pem new file mode 100644 index 0000000000000000000000000000000000000000..3e8eb326a1ea318a9428fc9d58b55717874dd5c0 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/democa.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBjCCAe4CCQD/YznvsDt6XTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJD +TjELMAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQKDAJaUjEPMA0GA1UE +AwwGZGVtb0NBMB4XDTI1MDYxOTAyMTg0NloXDTM1MDYxNzAyMTg0NlowRTELMAkG +A1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjELMAkGA1UECgwCWlIx +DzANBgNVBAMMBmRlbW9DQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ANBgugJZg5zHF9DWUAWrpNawQRUZsVxgSsdYyUPdT4SWuzB13BGyEeBOUR7QOY1f +yB8hTzXAE7/1CJruHn7I5qkCMQmaTQVIoMEvmPqMHwois7fQUElJLeozcxia9eud +Ns3BED3+5hQadDI91VHQq19RGFw85LXnb7VA8fP8fX69ZiC/yihHoELM1zsitbSd +LJs9cXrN86koetc5H46cznJC0gSSX+D42IVfF7Bcr6NAq6jUSSS1mQMqX/u5FpPw +o4nNyQoRXCQgquX0u0Rc2AykBXSycMutStPVw4zeyzd29JVaEu5oB9B+6kjZdZbD +rQhKOqfQuLzYm2zCxnqtbEcCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEATXoPXIYE +V7WoJYuidkYyo2WTqGLV5PBx3w7SV7cBltYZucKHxqnc04bWr+GAk4U7d6SGwQVA +616D5cE3CisF/EZJMbO5dnSqOQJ0oqzoYfyJ4wv2zUTAwDUlS/knZ6nHOLi32OOI +EQwUx+nqPDSPzkjn+kUABqDMtbfcfUPeqsJwWcNmrE4yCWnmiHxExE1zCLwp+ji+ ++eY1F/FeCZfZJLVmRUjw835pZzGslT5N+vf5hPoAdxU/NWUgGCoOig7ty2Cy4Xwt +FOkZ0elcshmwa9gm2bxyReTXLJfE2m3ANqun5fnU43uMNVLAtr3keuIYbsIoii+u +FLtbiyO6KtRycQ== +-----END CERTIFICATE----- diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_governance.smime b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_governance.smime new file mode 100644 index 0000000000000000000000000000000000000000..b9493a3d8dd1c593379a1198bc9771375741a402 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_governance.smime @@ -0,0 +1,72 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----39C53051E16BFF44A0CDC5B2CCC2EDB5" + +This is an S/MIME signed message + +------39C53051E16BFF44A0CDC5B2CCC2EDB5 + + + + + + 0 + + FALSE + FALSE + NONE + NONE + NONE + + + * + FALSE + FALSE + FALSE + ENCRYPT + + NONE + + + + + + +------39C53051E16BFF44A0CDC5B2CCC2EDB5 +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIFqgYJKoZIhvcNAQcCoIIFmzCCBZcCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggMKMIIDBjCCAe4CCQD/YznvsDt6XTANBgkqhkiG9w0BAQUFADBF +MQswCQYDVQQGEwJDTjELMAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQK +DAJaUjEPMA0GA1UEAwwGZGVtb0NBMB4XDTI1MDYxOTAyMTg0NloXDTM1MDYxNzAy +MTg0NlowRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjEL +MAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBANBgugJZg5zHF9DWUAWrpNawQRUZsVxgSsdYyUPdT4SWuzB1 +3BGyEeBOUR7QOY1fyB8hTzXAE7/1CJruHn7I5qkCMQmaTQVIoMEvmPqMHwois7fQ +UElJLeozcxia9eudNs3BED3+5hQadDI91VHQq19RGFw85LXnb7VA8fP8fX69ZiC/ +yihHoELM1zsitbSdLJs9cXrN86koetc5H46cznJC0gSSX+D42IVfF7Bcr6NAq6jU +SSS1mQMqX/u5FpPwo4nNyQoRXCQgquX0u0Rc2AykBXSycMutStPVw4zeyzd29JVa +Eu5oB9B+6kjZdZbDrQhKOqfQuLzYm2zCxnqtbEcCAwEAATANBgkqhkiG9w0BAQUF +AAOCAQEATXoPXIYEV7WoJYuidkYyo2WTqGLV5PBx3w7SV7cBltYZucKHxqnc04bW +r+GAk4U7d6SGwQVA616D5cE3CisF/EZJMbO5dnSqOQJ0oqzoYfyJ4wv2zUTAwDUl +S/knZ6nHOLi32OOIEQwUx+nqPDSPzkjn+kUABqDMtbfcfUPeqsJwWcNmrE4yCWnm +iHxExE1zCLwp+ji++eY1F/FeCZfZJLVmRUjw835pZzGslT5N+vf5hPoAdxU/NWUg +GCoOig7ty2Cy4XwtFOkZ0elcshmwa9gm2bxyReTXLJfE2m3ANqun5fnU43uMNVLA +tr3keuIYbsIoii+uFLtbiyO6KtRycTGCAmQwggJgAgEBMFIwRTELMAkGA1UEBhMC +Q04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjELMAkGA1UECgwCWlIxDzANBgNV +BAMMBmRlbW9DQQIJAP9jOe+wO3pdMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3 +DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTI1MTIwMjA3MDk0OVow +LwYJKoZIhvcNAQkEMSIEICvr91Cn7m+2L//sJOsE4rvaJ/49VizLmiNxgemKXmbE +MHkGCSqGSIb3DQEJDzFsMGowCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglg +hkgBZQMEAQIwCgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMC +AgFAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIIBAIiU +6Fr4yTzSCub+/9sjo5gzxKoxpUEVmOTOkPMdi8ZPRlOUnqMc0SLzNMN6hfFT0x6A +VHr0PNKQ7i5wsux3xKS1z7llw5gzundBO+faGO87PmELiBrw8tR26esmF0MPBZ7e ++nRTzhV3Ey4j3DWx/nc/a1EleYp0IfBhI+T9KSKaxDyaDpI6MAnmQFp9eWEgqzdd +pVE5ve3UeBXHTCy6oUYZ0ZgpRvnpOcP0wEPFyzzWMF3f5QQ2wJ5BA0eNMGc+THPD +Zd/jf0kAiHMPoeEKUQ5pEugFvPmfPuVrcWNtOfkA6yPunvdYO+LUkaekYEB+ElrL +DqHyzdWTNCBJhUDoMMw= + +------39C53051E16BFF44A0CDC5B2CCC2EDB5-- + diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_governance.xml b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_governance.xml new file mode 100644 index 0000000000000000000000000000000000000000..e78dd72cd08905f4195f4f94ab05d0bb59902b6f --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_governance.xml @@ -0,0 +1,26 @@ + + + + + + 0 + + FALSE + FALSE + NONE + NONE + NONE + + + * + FALSE + FALSE + FALSE + ENCRYPT + + NONE + + + + + diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_permission.smime b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_permission.smime new file mode 100644 index 0000000000000000000000000000000000000000..a3989f0af6cc6ac56a7fbc9d20d2163715b8d3f5 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_permission.smime @@ -0,0 +1,67 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----6645A14F86395BF1A798C158E22A7967" + +This is an S/MIME signed message + +------6645A14F86395BF1A798C158E22A7967 + + + + + C=CN,ST=JS,O=ZR,CN=app1 + + 2020-10-19T10:54:00 + 2026-10-19T10:54:00 + + ALLOW + + + C=CN,ST=JS,O=ZR,CN=app2 + + 2020-10-19T10:54:00 + 2026-10-19T10:54:00 + + ALLOW + + + + +------6645A14F86395BF1A798C158E22A7967 +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIFqgYJKoZIhvcNAQcCoIIFmzCCBZcCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggMKMIIDBjCCAe4CCQD/YznvsDt6XTANBgkqhkiG9w0BAQUFADBF +MQswCQYDVQQGEwJDTjELMAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQK +DAJaUjEPMA0GA1UEAwwGZGVtb0NBMB4XDTI1MDYxOTAyMTg0NloXDTM1MDYxNzAy +MTg0NlowRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjEL +MAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBANBgugJZg5zHF9DWUAWrpNawQRUZsVxgSsdYyUPdT4SWuzB1 +3BGyEeBOUR7QOY1fyB8hTzXAE7/1CJruHn7I5qkCMQmaTQVIoMEvmPqMHwois7fQ +UElJLeozcxia9eudNs3BED3+5hQadDI91VHQq19RGFw85LXnb7VA8fP8fX69ZiC/ +yihHoELM1zsitbSdLJs9cXrN86koetc5H46cznJC0gSSX+D42IVfF7Bcr6NAq6jU +SSS1mQMqX/u5FpPwo4nNyQoRXCQgquX0u0Rc2AykBXSycMutStPVw4zeyzd29JVa +Eu5oB9B+6kjZdZbDrQhKOqfQuLzYm2zCxnqtbEcCAwEAATANBgkqhkiG9w0BAQUF +AAOCAQEATXoPXIYEV7WoJYuidkYyo2WTqGLV5PBx3w7SV7cBltYZucKHxqnc04bW +r+GAk4U7d6SGwQVA616D5cE3CisF/EZJMbO5dnSqOQJ0oqzoYfyJ4wv2zUTAwDUl +S/knZ6nHOLi32OOIEQwUx+nqPDSPzkjn+kUABqDMtbfcfUPeqsJwWcNmrE4yCWnm +iHxExE1zCLwp+ji++eY1F/FeCZfZJLVmRUjw835pZzGslT5N+vf5hPoAdxU/NWUg +GCoOig7ty2Cy4XwtFOkZ0elcshmwa9gm2bxyReTXLJfE2m3ANqun5fnU43uMNVLA +tr3keuIYbsIoii+uFLtbiyO6KtRycTGCAmQwggJgAgEBMFIwRTELMAkGA1UEBhMC +Q04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjELMAkGA1UECgwCWlIxDzANBgNV +BAMMBmRlbW9DQQIJAP9jOe+wO3pdMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3 +DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTI1MDgyMjAyMDkxOFow +LwYJKoZIhvcNAQkEMSIEIC/LUruoVr4dlZxMFQ4aqOis/xOeSJ+eUp1YrBpup8Oh +MHkGCSqGSIb3DQEJDzFsMGowCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglg +hkgBZQMEAQIwCgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMC +AgFAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIIBADgd +rJL8celWBrrRrbJ471944DTDDi5K0oBDwGsWWvLCBqcN4jzljWSpMIJUExVelg9M +FxJag0gYzsvGc8ToWnSy4C6L2rT6190Yd+IMe25PG2xVHWDs33ofVZOfk68oQYUY +wT3k7eBx/5pW7MqMpWHtcc1gST9/cq5zQ6ddIeck8FF+CjXdL/M7lzluoOMfMUf/ +6IDKUsXx2NboF5wTM3FBlKhZinEK0JLL4jvFUJbO1zElAMrkxTfCt54r46U9AIpb +gTHufvEa/awy0XHoafxgeNRMWqrpGuA+7l6/Heml4EZHUT0KxvhXeDX4tlyrQy/Z +dwVTe4Z4Cd6Mpmpllgk= + +------6645A14F86395BF1A798C158E22A7967-- + diff --git a/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_permission.xml b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_permission.xml new file mode 100644 index 0000000000000000000000000000000000000000..271a627096d9dbb41a1f8ee248a28462d83d03eb --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_payload_encrypt/encry_permission.xml @@ -0,0 +1,21 @@ + + + + + C=CN,ST=JS,O=ZR,CN=app1 + + 2020-10-19T10:54:00 + 2026-10-19T10:54:00 + + ALLOW + + + C=CN,ST=JS,O=ZR,CN=app2 + + 2020-10-19T10:54:00 + 2026-10-19T10:54:00 + + ALLOW + + + diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app1.csr b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app1.csr new file mode 100644 index 0000000000000000000000000000000000000000..b8e4fc28bc1ec583dbed98b8964e294c10a4a7e8 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app1.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICezCCAWMCAQAwNjELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQK +DAJaUjENMAsGA1UEAwwEYXBwMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALp8MgWb1Ic7eL98hqtzTGJZkn+EKgp/1GqWfHd2DzhaxdLtzQRug32PB3vj +xqfSkl7BpbgrZtx0n4dBOUOXrslOuQqyEmsc9pa4xsNSFfPGwDZGtluO0cUXS3U5 +D357o42jG+ViBsyFXwEz2KPhhvAHPnv7Kc4Hw30SwEM7x9IkHLrcKDlYo+DlndkP +41WsK1Ph6JCYVQNh9W2YU3BhEWb9QBSvRPFP844Z3WE2Gu1jzGMa9G9je1Q/MddN +ZYr5vmsxY2jMHdGzLteh35YUouN5TQkoUH5KK8OaTFlQouRdisE+2WuTxKbD1uU7 +NLJQ+in+5TG6fguo2SDtiYJcHisCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQCY +g5OqQbMDPu9OtbUZ4zAnghhwuIc8ZjZiq1hXq/cEwZ30FkPDsMTwwhLW1aWToygl ++b0zpBcAQxCHgETNOjzluCOtfqexgsKTMAeTlV3KU7AJ1t3iv7ubem0hYp2mFUWb +VG4ObEK/XeLMPAcUSUC+e5IweplCSW3IhdbnV/3NIBZCm4SSc4NI3folbF+D2MBf +dJYXP5T7VCoMZjGXEv149ArZVGWGFxY801oAofoZtdDXRzUG/VypMOIeWtSRK5Zb +aEJM7mwjTs3hFR6MUqOBIh6GyZ6EwDY83bjfbfkBepY72KbpJprg+shIAIuuB4CL +r95BdmYlrJr2Qk6F/ECI +-----END CERTIFICATE REQUEST----- diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app1.key b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app1.key new file mode 100644 index 0000000000000000000000000000000000000000..dd00553431881ffc6526505bd236b1209cb58515 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app1.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAunwyBZvUhzt4v3yGq3NMYlmSf4QqCn/UapZ8d3YPOFrF0u3N +BG6DfY8He+PGp9KSXsGluCtm3HSfh0E5Q5euyU65CrISaxz2lrjGw1IV88bANka2 +W47RxRdLdTkPfnujjaMb5WIGzIVfATPYo+GG8Ac+e/spzgfDfRLAQzvH0iQcutwo +OVij4OWd2Q/jVawrU+HokJhVA2H1bZhTcGERZv1AFK9E8U/zjhndYTYa7WPMYxr0 +b2N7VD8x101livm+azFjaMwd0bMu16HflhSi43lNCShQfkorw5pMWVCi5F2KwT7Z +a5PEpsPW5Ts0slD6Kf7lMbp+C6jZIO2JglweKwIDAQABAoIBAHJCCfv5wDujKpZY +W8LMf+56ZxIODhwkuiccUOJ4yVaD91UHMmgWtiXF7pXvtxW4JMo956VxojJMmjmq +ssVBOGxK+YEeHb7XHha228Fsl9qm2bnnlW9/j/MsFKWb8mxSoKD1YPAoIXZJ+S2p +cIDoe16xcY1RFAoSI6qMRJRtGj8bqK8mhPMJ2qqmWtf6gEMRFsQKu6mnhLo0gXIX +fzTDFzeh0UkpnT77oBoZVMQPtV3gENIPFb0oqt9aG+LO+pwKjOmv/NV8UZGCcr0D +7zw654fKFxnVe+P1Kbtva2m96U7l2unolU0UHfXjfo5wzO4ke89uAFeKcWBB9gEV +Pe0O51ECgYEA6ySQXY4Splfb0zbZreVeMHvMHSodHiZiG8N9j7UByBRtlBGg24KW +8FZObKBwGNgKqddH9qcXmHBG9nFJVQ/ru1NBrmhTTMB6SFylchKzA/zNHgRPjOZv +ktswD780FbrfgYI8lx/PctmFBlWR/l6otlMa8vLUfegMbAdEPjV0gS0CgYEAywbA +XB8Y+ALNi/X2wjlnQNOc3eZAKZQev3hlP0LWAqB5tYFPYAgCMiSe9bKnunbVHs8z +Wes+fCF8jZXDNEda62NW6NmzqwuPjc0fhEXEnsttIzMG3D6G7YTjBUs9HExyqdur +cWzsRjYMbtnzrnj7oXhK6UwnhYjex71jRcB5Q7cCgYBlB3q3l5lPuyQJ5eE1I/2K +G0ahqTyFfbxdbWr/WagATTafjcttRPiRHqPnbC99nSVHv+V9hmFO776tmBMH5yVD +gQwRYWWY7oIboSK8lmgv6GhA411CjqeVk3Nc8KvyQi5RuKFL1TEOiYLsK8vkXMtk +OuSzSb4esprTt3OMvu7lqQKBgQCZsHuvgM7698w3tjNc5e120no+NE2/6+O21+H1 +GJg/FtHrh37Z2FYpNTWsEtkLu2cr0ngyCnWbrBHIcGV7zsRRyjqBPEPZKIA8PNot +3E6yUpZEfh0kXqTvapgcas9Q+8IVOTg4PddCcynIRG9GVUlO+2vh3YdRe8IBfCmJ +JOHnUwKBgCm0CgWDxsPrleDZuT6r8AvjNcS1Lmxh9MKMGQYzukCML4wiO6VPC5BX +BSNXDno5UobpCp/2pjLhd0irq+oP89ehaLl5G1XVtSl8hqP/q/WFs86aLYv1BaUN +B5NTUmSmbhxvz01/FCTO3h59YLegkNyLCoetS5HO26Qx4PsuF2zp +-----END RSA PRIVATE KEY----- diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app1Cert.pem b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app1Cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..f198a3a5bb9eff6d8055803d65e7ff81f76d5e08 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app1Cert.pem @@ -0,0 +1,82 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 3 (0x3) + Signature Algorithm: md5WithRSAEncryption + Issuer: C=CN, ST=JS, L=NJ, O=ZR, CN=demoCA + Validity + Not Before: Jun 19 02:30:58 2025 GMT + Not After : Jun 19 02:30:58 2026 GMT + Subject: C=CN, ST=JS, O=ZR, CN=app1 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:ba:7c:32:05:9b:d4:87:3b:78:bf:7c:86:ab:73: + 4c:62:59:92:7f:84:2a:0a:7f:d4:6a:96:7c:77:76: + 0f:38:5a:c5:d2:ed:cd:04:6e:83:7d:8f:07:7b:e3: + c6:a7:d2:92:5e:c1:a5:b8:2b:66:dc:74:9f:87:41: + 39:43:97:ae:c9:4e:b9:0a:b2:12:6b:1c:f6:96:b8: + c6:c3:52:15:f3:c6:c0:36:46:b6:5b:8e:d1:c5:17: + 4b:75:39:0f:7e:7b:a3:8d:a3:1b:e5:62:06:cc:85: + 5f:01:33:d8:a3:e1:86:f0:07:3e:7b:fb:29:ce:07: + c3:7d:12:c0:43:3b:c7:d2:24:1c:ba:dc:28:39:58: + a3:e0:e5:9d:d9:0f:e3:55:ac:2b:53:e1:e8:90:98: + 55:03:61:f5:6d:98:53:70:61:11:66:fd:40:14:af: + 44:f1:4f:f3:8e:19:dd:61:36:1a:ed:63:cc:63:1a: + f4:6f:63:7b:54:3f:31:d7:4d:65:8a:f9:be:6b:31: + 63:68:cc:1d:d1:b3:2e:d7:a1:df:96:14:a2:e3:79: + 4d:09:28:50:7e:4a:2b:c3:9a:4c:59:50:a2:e4:5d: + 8a:c1:3e:d9:6b:93:c4:a6:c3:d6:e5:3b:34:b2:50: + fa:29:fe:e5:31:ba:7e:0b:a8:d9:20:ed:89:82:5c: + 1e:2b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 9B:3F:65:39:57:61:C7:85:26:82:67:25:D5:5A:74:FD:F0:E8:62:A3 + X509v3 Authority Key Identifier: + DirName:/C=CN/ST=JS/L=NJ/O=ZR/CN=demoCA + serial:FF:63:39:EF:B0:3B:7A:5D + + Signature Algorithm: md5WithRSAEncryption + 7f:16:c8:f6:01:bd:6e:02:8c:e7:3a:8c:6e:a6:63:21:b8:f2: + d9:0d:b3:0c:2a:df:99:5b:95:5e:00:76:6e:16:38:ee:d4:d4: + f1:b7:d2:b2:40:89:85:0c:d0:59:0f:06:cb:9b:56:10:4e:f8: + 26:b8:bb:0b:c5:88:71:b5:88:35:81:22:74:9d:b2:8f:b3:3d: + 1e:a7:c7:8a:4c:b6:0e:c9:af:96:cd:9f:68:c3:91:10:15:ea: + 51:8c:9d:41:c0:9a:ec:04:3c:0b:4d:c0:bd:e7:f4:0e:fd:d4: + b7:a5:23:82:25:1d:91:cc:dc:27:36:43:2b:b2:2f:1a:9c:c9: + 92:68:19:3b:6b:fd:36:a1:c8:52:57:b3:59:78:41:46:12:10: + c4:49:ad:c9:06:ba:5e:cf:73:18:07:4a:f3:1d:8c:b6:8a:26: + 14:bc:60:d0:50:6a:0b:30:96:26:ae:28:0c:5d:f4:a2:68:9f: + 9c:75:c4:eb:97:24:3a:b4:45:96:a4:00:b9:d8:dc:0d:d0:32: + 29:66:b0:6c:5e:07:79:f3:d8:08:7b:54:91:1e:42:6b:03:5e: + 71:8f:3b:c2:69:cb:15:18:ba:8e:09:6c:63:7c:e3:c4:da:c9: + 7d:03:32:49:cd:80:be:81:76:d7:b3:08:31:ed:3e:5c:ba:3d: + fd:01:8b:1d +-----BEGIN CERTIFICATE----- +MIIDszCCApugAwIBAgIBAzANBgkqhkiG9w0BAQQFADBFMQswCQYDVQQGEwJDTjEL +MAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQKDAJaUjEPMA0GA1UEAwwG +ZGVtb0NBMB4XDTI1MDYxOTAyMzA1OFoXDTI2MDYxOTAyMzA1OFowNjELMAkGA1UE +BhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQKDAJaUjENMAsGA1UEAwwEYXBwMTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALp8MgWb1Ic7eL98hqtzTGJZ +kn+EKgp/1GqWfHd2DzhaxdLtzQRug32PB3vjxqfSkl7BpbgrZtx0n4dBOUOXrslO +uQqyEmsc9pa4xsNSFfPGwDZGtluO0cUXS3U5D357o42jG+ViBsyFXwEz2KPhhvAH +Pnv7Kc4Hw30SwEM7x9IkHLrcKDlYo+DlndkP41WsK1Ph6JCYVQNh9W2YU3BhEWb9 +QBSvRPFP844Z3WE2Gu1jzGMa9G9je1Q/MddNZYr5vmsxY2jMHdGzLteh35YUouN5 +TQkoUH5KK8OaTFlQouRdisE+2WuTxKbD1uU7NLJQ+in+5TG6fguo2SDtiYJcHisC +AwEAAaOBvDCBuTAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdl +bmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUmz9lOVdhx4Umgmcl1Vp0/fDo +YqMwXwYDVR0jBFgwVqFJpEcwRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQsw +CQYDVQQHDAJOSjELMAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQYIJAP9jOe+w +O3pdMA0GCSqGSIb3DQEBBAUAA4IBAQB/Fsj2Ab1uAoznOoxupmMhuPLZDbMMKt+Z +W5VeAHZuFjju1NTxt9KyQImFDNBZDwbLm1YQTvgmuLsLxYhxtYg1gSJ0nbKPsz0e +p8eKTLYOya+WzZ9ow5EQFepRjJ1BwJrsBDwLTcC95/QO/dS3pSOCJR2RzNwnNkMr +si8anMmSaBk7a/02ochSV7NZeEFGEhDESa3JBrpez3MYB0rzHYy2iiYUvGDQUGoL +MJYmrigMXfSiaJ+cdcTrlyQ6tEWWpAC52NwN0DIpZrBsXgd589gIe1SRHkJrA15x +jzvCacsVGLqOCWxjfOPE2sl9AzJJzYC+gXbXswgx7T5cuj39AYsd +-----END CERTIFICATE----- diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app2.csr b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app2.csr new file mode 100644 index 0000000000000000000000000000000000000000..7cc05a2bd4338f09238a50efb8e935e1f86ee3ab --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app2.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICezCCAWMCAQAwNjELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQK +DAJaUjENMAsGA1UEAwwEYXBwMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALOuA5nfAAfSxsGPI2dplqeOkIcXBHpM9ibul9Puqgg2TWufYmp1+Ln0nv3k +JwGP24mP5rtPIJzab5wlRzktTaJDI1v44biouccw/qFkyvWZMguUjbYhmt9k8cxD +05b284+gFkBSo3WByaoMoIpFBpHqIGuPsmFb4PPox+z9GX/0wyBxoepPI7onLJb7 +6HNoq1MmSPcnJseYFt5xN8xkP0fbD2Q9UrM81nZVwXYTTJbxRfMC6NxtnmA/PC1j +hBDJGAcccUOG+5gxIa8ddfnz4tiZSVz/hXw6wj0MDuXd9bVjY7d+V1FjUkE+nhOP +i/AHodVK8wOiUUlARBCf6Rf/Y+0CAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQAm +xjUjhpIllOtzdmBFC+8p1R6ab+VsWtClTD9sxlfzMQOd5vrhTSn8Sp/s7nzgDgIK +fExYgAikrEyHvZoElVg1MTO2sDDvzV+018+scTV75w0rlZKwSl161eyWNc/MVyPQ +bFaRTgwzVd4h5oK7zMh5YWzQiMAeAU6JBCu3Lzbs4tB8/TolCGDXDh8OkUFKruKN +RNZ+hNffBiN1xRpLdbyjcOoJQ2CQurcGbeVszRcJ2gavAhrs9TWeS/USJ9EhwnUI +9/bF/NH6OpSWnapva24Y6D5DQtOyrDF74OZdTeYYMiGEvWcHx2wwnk7WB3tH/FPJ +nb7jVAaUVR6nzgDwXSDR +-----END CERTIFICATE REQUEST----- diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app2.key b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app2.key new file mode 100644 index 0000000000000000000000000000000000000000..3c1cb958087d79bcedd877e4a3f458b200e24d68 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app2.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAs64Dmd8AB9LGwY8jZ2mWp46QhxcEekz2Ju6X0+6qCDZNa59i +anX4ufSe/eQnAY/biY/mu08gnNpvnCVHOS1NokMjW/jhuKi5xzD+oWTK9ZkyC5SN +tiGa32TxzEPTlvbzj6AWQFKjdYHJqgygikUGkeoga4+yYVvg8+jH7P0Zf/TDIHGh +6k8juicslvvoc2irUyZI9ycmx5gW3nE3zGQ/R9sPZD1SszzWdlXBdhNMlvFF8wLo +3G2eYD88LWOEEMkYBxxxQ4b7mDEhrx11+fPi2JlJXP+FfDrCPQwO5d31tWNjt35X +UWNSQT6eE4+L8Aeh1UrzA6JRSUBEEJ/pF/9j7QIDAQABAoIBAFKkQ9W+4qW2hWI7 +cr46q2dPxBvOM2oJAeJwNPbuO9hhGYTZnwt2TTtCTupZyLMINqJzxFz8jPR354O7 +BaI/uwhZtuazdyZWvHPojgUvdcY2evUmk3Nky3XaWPhpbeVumiHCMNnO6I3Abz++ +ZQyTqOzt8ZFnW1U6TCIDPAk9dEAMTmY2/YVWmyKyzJdhUVYpKSJpVdAxBW3xSFvA +p3a6KM4Dk8gZH5jUZ5G8Gz2h8Zyb5jImKb6KWhL8uJjceFun0WCDk1IOWYJmji4n +ZCUQRhxbl54nC3dkREhS2UuXyhAFtsMweznzSkXt6uQOczwtlZqjQ1mM/RQklkLn +1nH8x4ECgYEA7dkuGzxcjkeSxbP9VSZ2ebSUlTpY+WaFzP+8RrMoCAcusbDcFlOA +ICUpLT/kp6EfZB82risdp503Bw+kO9N6+04iKTwDy+/UwM/fhHBSJ8qhI4a+gWdl +qZPmI+2ITdZabyiSJ6lWYWJcBLFVUr2cSiQYPnt55dx5xSa9I9pk92ECgYEAwWRm +QW86EGeMTBlF5GuTV9lwBqptoj26BRGuSBRAzCXXVUUii1C/TJJIeD0IzFQRtSM2 +HEyacxGePudMiI4FChhNRDPDU+7IdBgFM0KLBPIMH4mTK6eDw1hUO4vlrARwfCft +f7+1DhNgul7Ca7ldHm52XituGR6cKfjxW7OTVA0CgYAi9dZKGJA+NZUETFWDS5kE +gJ+KY74qQoCORlTFS5Ypv+yEH8vp2DIwB2ZLCWYxoYQ8sj3WUe4U8g3hktIAHTCp +ea2ZxAGG22S5RpTDIcNhp+4Ri7+6w5j02RFt3H85ebVnO15oSAKzY8LEydARzl8H +otCRdpLPT53ydaQ9fd9zYQKBgQCoDAofCfu2jYQIDF4DYsciKzuBT079EA44oWiE +EbVMsAUxf2XJEV1puCNo+ABRLSxF7lbyuE3td32+w1Zpwp72aq+ZeDFfGbrtxoGe +TVBn97w5G17bLDD+6h4nsCTfGOx1tmxV+cvmc0g2KmlfGi+kZfBNXAfLpCGnBz8T +pDN9cQKBgQCs0hqCTf2nYbKLUw3BIA98RDdg5MRwDQvGQ/Vimie83WoUHzvT1a1K +ek99q7amKRxxxNnWrxiyPAMYC30EfXhnM2p1oRspBlz2zOjzvyjFIzUPdrbGvJbT +vRdJWYHiY0SZWw2aHR++IKHXSWUM2wt46tj31Ksf6G8hGldPhX2LsA== +-----END RSA PRIVATE KEY----- diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app2Cert.pem b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app2Cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..e0a2d96fa9646b590ba7621bc53dc35c7cd8b891 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/app2Cert.pem @@ -0,0 +1,82 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4 (0x4) + Signature Algorithm: md5WithRSAEncryption + Issuer: C=CN, ST=JS, L=NJ, O=ZR, CN=demoCA + Validity + Not Before: Jun 19 03:33:12 2025 GMT + Not After : Jun 19 03:33:12 2026 GMT + Subject: C=CN, ST=JS, O=ZR, CN=app2 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:b3:ae:03:99:df:00:07:d2:c6:c1:8f:23:67:69: + 96:a7:8e:90:87:17:04:7a:4c:f6:26:ee:97:d3:ee: + aa:08:36:4d:6b:9f:62:6a:75:f8:b9:f4:9e:fd:e4: + 27:01:8f:db:89:8f:e6:bb:4f:20:9c:da:6f:9c:25: + 47:39:2d:4d:a2:43:23:5b:f8:e1:b8:a8:b9:c7:30: + fe:a1:64:ca:f5:99:32:0b:94:8d:b6:21:9a:df:64: + f1:cc:43:d3:96:f6:f3:8f:a0:16:40:52:a3:75:81: + c9:aa:0c:a0:8a:45:06:91:ea:20:6b:8f:b2:61:5b: + e0:f3:e8:c7:ec:fd:19:7f:f4:c3:20:71:a1:ea:4f: + 23:ba:27:2c:96:fb:e8:73:68:ab:53:26:48:f7:27: + 26:c7:98:16:de:71:37:cc:64:3f:47:db:0f:64:3d: + 52:b3:3c:d6:76:55:c1:76:13:4c:96:f1:45:f3:02: + e8:dc:6d:9e:60:3f:3c:2d:63:84:10:c9:18:07:1c: + 71:43:86:fb:98:31:21:af:1d:75:f9:f3:e2:d8:99: + 49:5c:ff:85:7c:3a:c2:3d:0c:0e:e5:dd:f5:b5:63: + 63:b7:7e:57:51:63:52:41:3e:9e:13:8f:8b:f0:07: + a1:d5:4a:f3:03:a2:51:49:40:44:10:9f:e9:17:ff: + 63:ed + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 31:A4:01:D4:3E:66:AA:B1:8A:9E:D3:F3:B4:F8:10:29:66:17:A5:1F + X509v3 Authority Key Identifier: + DirName:/C=CN/ST=JS/L=NJ/O=ZR/CN=demoCA + serial:FF:63:39:EF:B0:3B:7A:5D + + Signature Algorithm: md5WithRSAEncryption + 57:3d:b8:ba:1a:47:92:81:c0:75:35:f3:e0:cf:48:bc:1f:a8: + 6b:2d:03:99:e2:01:ee:13:e1:d8:b4:c5:0c:d7:76:24:b8:cd: + 42:10:f1:09:d1:19:a7:2d:e9:92:1e:5e:4d:e9:24:12:56:a2: + 4b:5d:09:85:83:7b:cf:a7:96:2f:91:f7:74:d4:f8:9c:ee:b7: + fe:dc:45:79:a5:d1:3d:08:2c:70:63:09:aa:4d:fc:1e:c7:cc: + 20:cd:b3:06:3b:5b:8c:00:ce:59:0a:8b:76:7b:e2:5f:24:4d: + d6:c8:ab:9c:fa:dd:46:a8:77:ce:32:8d:a6:4a:22:0f:26:cd: + f3:fe:cd:e9:3d:a3:88:a4:9c:12:5f:08:e4:eb:b3:8d:49:3b: + 8e:10:36:d2:d6:01:69:37:f8:eb:cc:90:73:fe:bd:45:2b:9d: + 47:a9:dc:bf:03:9a:c0:e1:68:b9:1d:cd:7e:0f:58:a1:96:18: + 36:93:f2:67:4e:38:71:ae:36:ce:d9:e2:de:41:16:a3:8d:4b: + aa:be:26:4e:9b:78:29:c0:40:b2:37:b0:de:5e:6d:af:82:ad: + f5:00:45:66:07:b6:28:d2:cb:e3:55:00:1e:33:a7:a9:26:46: + 57:01:66:30:08:1b:49:18:72:6b:07:9d:c5:c3:66:c9:ab:47: + 94:cf:5a:3d +-----BEGIN CERTIFICATE----- +MIIDszCCApugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBFMQswCQYDVQQGEwJDTjEL +MAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQKDAJaUjEPMA0GA1UEAwwG +ZGVtb0NBMB4XDTI1MDYxOTAzMzMxMloXDTI2MDYxOTAzMzMxMlowNjELMAkGA1UE +BhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQKDAJaUjENMAsGA1UEAwwEYXBwMjCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOuA5nfAAfSxsGPI2dplqeO +kIcXBHpM9ibul9Puqgg2TWufYmp1+Ln0nv3kJwGP24mP5rtPIJzab5wlRzktTaJD +I1v44biouccw/qFkyvWZMguUjbYhmt9k8cxD05b284+gFkBSo3WByaoMoIpFBpHq +IGuPsmFb4PPox+z9GX/0wyBxoepPI7onLJb76HNoq1MmSPcnJseYFt5xN8xkP0fb +D2Q9UrM81nZVwXYTTJbxRfMC6NxtnmA/PC1jhBDJGAcccUOG+5gxIa8ddfnz4tiZ +SVz/hXw6wj0MDuXd9bVjY7d+V1FjUkE+nhOPi/AHodVK8wOiUUlARBCf6Rf/Y+0C +AwEAAaOBvDCBuTAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdl +bmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUMaQB1D5mqrGKntPztPgQKWYX +pR8wXwYDVR0jBFgwVqFJpEcwRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQsw +CQYDVQQHDAJOSjELMAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQYIJAP9jOe+w +O3pdMA0GCSqGSIb3DQEBBAUAA4IBAQBXPbi6GkeSgcB1NfPgz0i8H6hrLQOZ4gHu +E+HYtMUM13YkuM1CEPEJ0RmnLemSHl5N6SQSVqJLXQmFg3vPp5Yvkfd01Pic7rf+ +3EV5pdE9CCxwYwmqTfwex8wgzbMGO1uMAM5ZCot2e+JfJE3WyKuc+t1GqHfOMo2m +SiIPJs3z/s3pPaOIpJwSXwjk67ONSTuOEDbS1gFpN/jrzJBz/r1FK51Hqdy/A5rA +4Wi5Hc1+D1ihlhg2k/JnTjhxrjbO2eLeQRajjUuqviZOm3gpwECyN7DeXm2vgq31 +AEVmB7Yo0svjVQAeM6epJkZXAWYwCBtJGHJrB53Fw2bJq0eUz1o9 +-----END CERTIFICATE----- diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/democa.csr b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/democa.csr new file mode 100644 index 0000000000000000000000000000000000000000..25c3769f5950bad183aefa2f727d42dbc942a1a7 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/democa.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICijCCAXICAQAwRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQH +DAJOSjELMAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBANBgugJZg5zHF9DWUAWrpNawQRUZsVxgSsdYyUPd +T4SWuzB13BGyEeBOUR7QOY1fyB8hTzXAE7/1CJruHn7I5qkCMQmaTQVIoMEvmPqM +Hwois7fQUElJLeozcxia9eudNs3BED3+5hQadDI91VHQq19RGFw85LXnb7VA8fP8 +fX69ZiC/yihHoELM1zsitbSdLJs9cXrN86koetc5H46cznJC0gSSX+D42IVfF7Bc +r6NAq6jUSSS1mQMqX/u5FpPwo4nNyQoRXCQgquX0u0Rc2AykBXSycMutStPVw4ze +yzd29JVaEu5oB9B+6kjZdZbDrQhKOqfQuLzYm2zCxnqtbEcCAwEAAaAAMA0GCSqG +SIb3DQEBCwUAA4IBAQAETOZads56ZQg2VIgzb6pfIp/dRydrVB1MBRxd9J3YOMNV +/tpqKc2yg3b1IRFJmKAx9Xh3ERn3SaRzawDAHIksLlGIh/RjgQBtLQzrOOhBDT6N +t5MNO6GPl1vvP11bOBI0mzBPWPZ69D/vAFiN9cKByrPoJgNEweO3Ei8YMmsoeZKz +miV9ZJrysw28v0j+zBhF31RC79xWkC1dq0uEJxeROUC3aDfbgNxc8DeEDftXCDWb +yALPaJzP8AllvUkZt+DYVHEr2o9qgk0bGN+VGtogr/IvY5zRMA/yRRvB53VdR9I+ +VB6bcghhUUkC0a+7OteLO+ezIBh6Ta+FDpUAJfNE +-----END CERTIFICATE REQUEST----- diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/democa.key b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/democa.key new file mode 100644 index 0000000000000000000000000000000000000000..9892f997a87a15f7e077ed1b519a0bad39a588be --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/democa.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA0GC6AlmDnMcX0NZQBauk1rBBFRmxXGBKx1jJQ91PhJa7MHXc +EbIR4E5RHtA5jV/IHyFPNcATv/UImu4efsjmqQIxCZpNBUigwS+Y+owfCiKzt9BQ +SUkt6jNzGJr16502zcEQPf7mFBp0Mj3VUdCrX1EYXDzktedvtUDx8/x9fr1mIL/K +KEegQszXOyK1tJ0smz1xes3zqSh61zkfjpzOckLSBJJf4PjYhV8XsFyvo0CrqNRJ +JLWZAypf+7kWk/Cjic3JChFcJCCq5fS7RFzYDKQFdLJwy61K09XDjN7LN3b0lVoS +7mgH0H7qSNl1lsOtCEo6p9C4vNibbMLGeq1sRwIDAQABAoIBAQCFT9yw9CPHgXgz +G2lGt3FWCJ0aqr1VpCUzNBJPYJ8m7GgFsOGCULIvFuu/Eug/EjAt+ll6wc/g1xsS +Q5Uu98jaB5Tn19e+saBm99SfNlYFXf4scxFqUW8WjqPr8fezLXmKWSHTB+iao/IC +0pxPI3kAGhnDqRGJbu+AvnQM7FQ9aDcN7at98DAi+l1/lVt6sCTrCZGNM3Dog8ZL +jMZPuPYpNrwEZ7wBWtKwpZaPDSwWf+u4gCWJZbP4TKzv7XBIra/45VwnL9fmZezT +m/WY9uvig5P7tan/8cEQVnuEKRcUYJks4otK0FFH6ocbiw/PnM3ZZEe5aLM2smPM +eJwfabwBAoGBAOg2Tf1EzMslfxmrp3Xn1oAKkSUz4jjabJiXjAZMlYkcq913WN+2 +23LhYvRRksXkUBLizTGKSWzdrX56CC7Uw4lag2OAmoo+AGr+hArEYYtp6+iRtPBg +Ww5EhPR58RepoHSB+c7z/4e7SdoFkGkiKPy6PNfmABkJihsTMjtgOuNBAoGBAOW5 +X+oHBFg+5OoxiKm+7j3QCPqdWNzHq+skjE/XAxVBxvzJky3BWRxNVL++5OfRhooR +hPq52/8Gd4ZVIRo3QEtuBlLmJhVqEkKUyd/NIVIMeSj0tg3wjJnXnCd36cYhgA72 +7NebFpwq65sLigquQ0U/Cy5PnHowzkQt0iOya1WHAoGBAILPBIPlm8/cIYsebUk3 +/ldGnJjub0NDl+UliZWK0rnYUuCA+KmdYmWGna2vvhSIFqts49ZCZjZTcgZLTAzF +ghj/yf/lVCkH4Ehlc5B1K9XTJzdtzRWT0fdpldP6VVvVDDRVe5mfTZTyZhnRBJaU +za4AY4HjaK6x9wBlgeh8vu+BAoGAXF0SMVgs6QYwp/DOj+FSjMvOMGV/SxWFDAAf +4iIC/VL7HLw3TthEadq1znqEMqjNvUmZ++0qhPkmqX4k1xOL6EgOhto+SbHiMZ79 +I9yoHwMg29S4NhaXkWtdP4k5Fw51HI8vXujeSGABZs9W60Bxj6/vYOllcsOYy1TY +/r1H5pUCgYAM06kfMGmplc8KcysxOcqWLWAO8WgSaXcy9THjZ8v88cbi2b55JXRK +Otu9pp7t7fEpB2ims5uI5dPLttQLjBJVUTVpdSDnIz8lAU4cIp65Ctz5YL/pKvL+ +7GZUhVWRf34roxsyYr4P+RU42CvNSb+0jSyzmGF05gb+nnMjQvCRKQ== +-----END RSA PRIVATE KEY----- diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/democa.pem b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/democa.pem new file mode 100644 index 0000000000000000000000000000000000000000..3e8eb326a1ea318a9428fc9d58b55717874dd5c0 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/democa.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBjCCAe4CCQD/YznvsDt6XTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJD +TjELMAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQKDAJaUjEPMA0GA1UE +AwwGZGVtb0NBMB4XDTI1MDYxOTAyMTg0NloXDTM1MDYxNzAyMTg0NlowRTELMAkG +A1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjELMAkGA1UECgwCWlIx +DzANBgNVBAMMBmRlbW9DQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ANBgugJZg5zHF9DWUAWrpNawQRUZsVxgSsdYyUPdT4SWuzB13BGyEeBOUR7QOY1f +yB8hTzXAE7/1CJruHn7I5qkCMQmaTQVIoMEvmPqMHwois7fQUElJLeozcxia9eud +Ns3BED3+5hQadDI91VHQq19RGFw85LXnb7VA8fP8fX69ZiC/yihHoELM1zsitbSd +LJs9cXrN86koetc5H46cznJC0gSSX+D42IVfF7Bcr6NAq6jUSSS1mQMqX/u5FpPw +o4nNyQoRXCQgquX0u0Rc2AykBXSycMutStPVw4zeyzd29JVaEu5oB9B+6kjZdZbD +rQhKOqfQuLzYm2zCxnqtbEcCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEATXoPXIYE +V7WoJYuidkYyo2WTqGLV5PBx3w7SV7cBltYZucKHxqnc04bWr+GAk4U7d6SGwQVA +616D5cE3CisF/EZJMbO5dnSqOQJ0oqzoYfyJ4wv2zUTAwDUlS/knZ6nHOLi32OOI +EQwUx+nqPDSPzkjn+kUABqDMtbfcfUPeqsJwWcNmrE4yCWnmiHxExE1zCLwp+ji+ ++eY1F/FeCZfZJLVmRUjw835pZzGslT5N+vf5hPoAdxU/NWUgGCoOig7ty2Cy4Xwt +FOkZ0elcshmwa9gm2bxyReTXLJfE2m3ANqun5fnU43uMNVLAtr3keuIYbsIoii+u +FLtbiyO6KtRycQ== +-----END CERTIFICATE----- diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_governance.smime b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_governance.smime new file mode 100644 index 0000000000000000000000000000000000000000..7d3eaa1e9cbb02722ae385dac156a648f0df7283 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_governance.smime @@ -0,0 +1,72 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----1FAB355738020C1F90BBAADC38FFC662" + +This is an S/MIME signed message + +------1FAB355738020C1F90BBAADC38FFC662 + + + + + + 0 + + FALSE + FALSE + NONE + NONE + ENCRYPT + + + * + FALSE + FALSE + FALSE + ENCRYPT + + ENCRYPT + + + + + + +------1FAB355738020C1F90BBAADC38FFC662 +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIFqgYJKoZIhvcNAQcCoIIFmzCCBZcCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggMKMIIDBjCCAe4CCQD/YznvsDt6XTANBgkqhkiG9w0BAQUFADBF +MQswCQYDVQQGEwJDTjELMAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQK +DAJaUjEPMA0GA1UEAwwGZGVtb0NBMB4XDTI1MDYxOTAyMTg0NloXDTM1MDYxNzAy +MTg0NlowRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjEL +MAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBANBgugJZg5zHF9DWUAWrpNawQRUZsVxgSsdYyUPdT4SWuzB1 +3BGyEeBOUR7QOY1fyB8hTzXAE7/1CJruHn7I5qkCMQmaTQVIoMEvmPqMHwois7fQ +UElJLeozcxia9eudNs3BED3+5hQadDI91VHQq19RGFw85LXnb7VA8fP8fX69ZiC/ +yihHoELM1zsitbSdLJs9cXrN86koetc5H46cznJC0gSSX+D42IVfF7Bcr6NAq6jU +SSS1mQMqX/u5FpPwo4nNyQoRXCQgquX0u0Rc2AykBXSycMutStPVw4zeyzd29JVa +Eu5oB9B+6kjZdZbDrQhKOqfQuLzYm2zCxnqtbEcCAwEAATANBgkqhkiG9w0BAQUF +AAOCAQEATXoPXIYEV7WoJYuidkYyo2WTqGLV5PBx3w7SV7cBltYZucKHxqnc04bW +r+GAk4U7d6SGwQVA616D5cE3CisF/EZJMbO5dnSqOQJ0oqzoYfyJ4wv2zUTAwDUl +S/knZ6nHOLi32OOIEQwUx+nqPDSPzkjn+kUABqDMtbfcfUPeqsJwWcNmrE4yCWnm +iHxExE1zCLwp+ji++eY1F/FeCZfZJLVmRUjw835pZzGslT5N+vf5hPoAdxU/NWUg +GCoOig7ty2Cy4XwtFOkZ0elcshmwa9gm2bxyReTXLJfE2m3ANqun5fnU43uMNVLA +tr3keuIYbsIoii+uFLtbiyO6KtRycTGCAmQwggJgAgEBMFIwRTELMAkGA1UEBhMC +Q04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjELMAkGA1UECgwCWlIxDzANBgNV +BAMMBmRlbW9DQQIJAP9jOe+wO3pdMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3 +DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTI1MTIwOTAxNDQyNlow +LwYJKoZIhvcNAQkEMSIEIOUg5SH8F4NH00nMsXnQA0Ey5mwasrSOataCytz7z/6i +MHkGCSqGSIb3DQEJDzFsMGowCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglg +hkgBZQMEAQIwCgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMC +AgFAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIIBAH19 +JvnhRTD4+c6Mi1ugGXPQIOFp70LbwJosaelCWMio+Eq1eLOJiSIO+9Z6AS1s3DBY +qn9uA8CqngR8CtnGofZ32VGpIMQIP1RAW/KX1ujV4CWztK+EBZrNXUysTdQ7Viu3 +lRW9mHgdUuqLP3M9cCXsYZRd7KCocvXMQArt7MGdttTNF0gYtXl7W5g8Xmd08mUo +3L8KISfb7X9sagyW9w+Km5ZmoxJ1OrvcDZYplO3CRfgEtCWrBye/nhXdd+CQwoFV +AiHifsVgMahF9gcmT+WptObTYUCYkiUkFEeYR5gkqaBn9qHiiBGKG/KjKAVQakK/ +FFVw1h9FYBML0CcclKA= + +------1FAB355738020C1F90BBAADC38FFC662-- + diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_governance.xml b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_governance.xml new file mode 100644 index 0000000000000000000000000000000000000000..f39003d27fb0587fd0ce86c5ef2e9857824d3a40 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_governance.xml @@ -0,0 +1,26 @@ + + + + + + 0 + + FALSE + FALSE + NONE + NONE + ENCRYPT + + + * + FALSE + FALSE + FALSE + ENCRYPT + + ENCRYPT + + + + + diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_permission.smime b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_permission.smime new file mode 100644 index 0000000000000000000000000000000000000000..a3989f0af6cc6ac56a7fbc9d20d2163715b8d3f5 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_permission.smime @@ -0,0 +1,67 @@ +MIME-Version: 1.0 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----6645A14F86395BF1A798C158E22A7967" + +This is an S/MIME signed message + +------6645A14F86395BF1A798C158E22A7967 + + + + + C=CN,ST=JS,O=ZR,CN=app1 + + 2020-10-19T10:54:00 + 2026-10-19T10:54:00 + + ALLOW + + + C=CN,ST=JS,O=ZR,CN=app2 + + 2020-10-19T10:54:00 + 2026-10-19T10:54:00 + + ALLOW + + + + +------6645A14F86395BF1A798C158E22A7967 +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MIIFqgYJKoZIhvcNAQcCoIIFmzCCBZcCAQExDzANBglghkgBZQMEAgEFADALBgkq +hkiG9w0BBwGgggMKMIIDBjCCAe4CCQD/YznvsDt6XTANBgkqhkiG9w0BAQUFADBF +MQswCQYDVQQGEwJDTjELMAkGA1UECAwCSlMxCzAJBgNVBAcMAk5KMQswCQYDVQQK +DAJaUjEPMA0GA1UEAwwGZGVtb0NBMB4XDTI1MDYxOTAyMTg0NloXDTM1MDYxNzAy +MTg0NlowRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjEL +MAkGA1UECgwCWlIxDzANBgNVBAMMBmRlbW9DQTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBANBgugJZg5zHF9DWUAWrpNawQRUZsVxgSsdYyUPdT4SWuzB1 +3BGyEeBOUR7QOY1fyB8hTzXAE7/1CJruHn7I5qkCMQmaTQVIoMEvmPqMHwois7fQ +UElJLeozcxia9eudNs3BED3+5hQadDI91VHQq19RGFw85LXnb7VA8fP8fX69ZiC/ +yihHoELM1zsitbSdLJs9cXrN86koetc5H46cznJC0gSSX+D42IVfF7Bcr6NAq6jU +SSS1mQMqX/u5FpPwo4nNyQoRXCQgquX0u0Rc2AykBXSycMutStPVw4zeyzd29JVa +Eu5oB9B+6kjZdZbDrQhKOqfQuLzYm2zCxnqtbEcCAwEAATANBgkqhkiG9w0BAQUF +AAOCAQEATXoPXIYEV7WoJYuidkYyo2WTqGLV5PBx3w7SV7cBltYZucKHxqnc04bW +r+GAk4U7d6SGwQVA616D5cE3CisF/EZJMbO5dnSqOQJ0oqzoYfyJ4wv2zUTAwDUl +S/knZ6nHOLi32OOIEQwUx+nqPDSPzkjn+kUABqDMtbfcfUPeqsJwWcNmrE4yCWnm +iHxExE1zCLwp+ji++eY1F/FeCZfZJLVmRUjw835pZzGslT5N+vf5hPoAdxU/NWUg +GCoOig7ty2Cy4XwtFOkZ0elcshmwa9gm2bxyReTXLJfE2m3ANqun5fnU43uMNVLA +tr3keuIYbsIoii+uFLtbiyO6KtRycTGCAmQwggJgAgEBMFIwRTELMAkGA1UEBhMC +Q04xCzAJBgNVBAgMAkpTMQswCQYDVQQHDAJOSjELMAkGA1UECgwCWlIxDzANBgNV +BAMMBmRlbW9DQQIJAP9jOe+wO3pdMA0GCWCGSAFlAwQCAQUAoIHkMBgGCSqGSIb3 +DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTI1MDgyMjAyMDkxOFow +LwYJKoZIhvcNAQkEMSIEIC/LUruoVr4dlZxMFQ4aqOis/xOeSJ+eUp1YrBpup8Oh +MHkGCSqGSIb3DQEJDzFsMGowCwYJYIZIAWUDBAEqMAsGCWCGSAFlAwQBFjALBglg +hkgBZQMEAQIwCgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMC +AgFAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIIBADgd +rJL8celWBrrRrbJ471944DTDDi5K0oBDwGsWWvLCBqcN4jzljWSpMIJUExVelg9M +FxJag0gYzsvGc8ToWnSy4C6L2rT6190Yd+IMe25PG2xVHWDs33ofVZOfk68oQYUY +wT3k7eBx/5pW7MqMpWHtcc1gST9/cq5zQ6ddIeck8FF+CjXdL/M7lzluoOMfMUf/ +6IDKUsXx2NboF5wTM3FBlKhZinEK0JLL4jvFUJbO1zElAMrkxTfCt54r46U9AIpb +gTHufvEa/awy0XHoafxgeNRMWqrpGuA+7l6/Heml4EZHUT0KxvhXeDX4tlyrQy/Z +dwVTe4Z4Cd6Mpmpllgk= + +------6645A14F86395BF1A798C158E22A7967-- + diff --git a/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_permission.xml b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_permission.xml new file mode 100644 index 0000000000000000000000000000000000000000..271a627096d9dbb41a1f8ee248a28462d83d03eb --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/config_rtps_sub_payload_encrypt/encry_permission.xml @@ -0,0 +1,21 @@ + + + + + C=CN,ST=JS,O=ZR,CN=app1 + + 2020-10-19T10:54:00 + 2026-10-19T10:54:00 + + ALLOW + + + C=CN,ST=JS,O=ZR,CN=app2 + + 2020-10-19T10:54:00 + 2026-10-19T10:54:00 + + ALLOW + + + diff --git a/example/travodds-helloworld/HelloWorld/dds_security_qos.xml b/example/travodds-helloworld/HelloWorld/dds_security_qos.xml new file mode 100644 index 0000000000000000000000000000000000000000..a6c36ddcc52c03bbe792935694967008af84fd8c --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/dds_security_qos.xml @@ -0,0 +1,65 @@ + + + + + + true + + + + + true + + + + + dds.sec.plugin_name + SecurityPlugin + false + + + dds.sec.auth.identity_ca + file:../config/identity_ca.cert.pem + false + + + dds.sec.auth.identity_certificate + file:../config/cert.pem + false + + + dds.sec.auth.private_key + file:../config/key.pem + false + + + dds.sec.access.permissions_ca + file:../config/permissions_ca.cert.pem + false + + + dds.sec.access.permissions + file:../config/permissions.p7s + false + + + dds.sec.access.governance + file:../config/governance.p7s + false + + + + + + + RELIABLE_RELIABILITY_QOS + + + + + RELIABLE_RELIABILITY_QOS + + + + + diff --git a/example/travodds-helloworld/HelloWorld/src/ConnectPoint.cpp b/example/travodds-helloworld/HelloWorld/src/ConnectPoint.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b1bb49c7de04b4b21252735da78e3ff9f9cb80ea --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/src/ConnectPoint.cpp @@ -0,0 +1,387 @@ +#include "dcps/domain/domainparticipant.h" +#include "dcps/topic/topic.h" +#include "HelloWorld.h" +#include "HelloWorldTypeSupport.h" +#include +#include "dcps/domain/domainparticipantfactory.h" +USING_TRAVODDS_NAMESPACE + +class myDataListener : public DataReaderListener { +public: + virtual void on_data_available(DataReader* reader); +}; +void myDataListener::on_data_available(DataReader* reader) +{ + SequenceData data_seq; + SampleInfoSeq info_seq; + ReturnCode_t retcode; + retcode = reader->take( + data_seq, info_seq, LENGTH_UNLIMITED, + ANY_SAMPLE_STATE, ANY_VIEW_STATE, ANY_INSTANCE_STATE); + + if (retcode == RETCODE_NO_DATA) { + return; + } + else if (retcode != RETCODE_OK) { + fprintf(stderr, "take error %d\n", retcode); + return; + } + for (uint32_t i = 0; i < data_seq.length(); ++i) { + printf("Received data, index %d, message %s\n", data_seq[i].index, data_seq[i].message.data()); + } +} + +static int publisher_shutdown( + DomainParticipant* participant) +{ + ReturnCode_t retcode; + int status = 0; + + if (participant != NULL) { + retcode = participant->delete_contained_entities(); + if (retcode != RETCODE_OK) { + fprintf(stderr, "delete_contained_entities error %d\n", retcode); + status = -1; + } + + retcode = TheParticipantFactory->delete_participant(participant); + if (retcode != RETCODE_OK) { + fprintf(stderr, "delete_participant error %d\n", retcode); + status = -1; + } + } + return status; +} + +static int subscriber_shutdown( + DomainParticipant* participant) +{ + ReturnCode_t retcode; + int status = 0; + + if (participant != NULL) { + retcode = participant->delete_contained_entities(); + if (retcode != RETCODE_OK) { + fprintf(stderr, "delete_contained_entities error %d\n", retcode); + status = -1; + } + + retcode = TheParticipantFactory->delete_participant(participant); + if (retcode != RETCODE_OK) { + fprintf(stderr, "delete_participant error %d\n", retcode); + status = -1; + } + } + return status; +} + +int main(int argc, char* argv[]) +{ + + std::string type = ""; + if (argc < 2) { + std::cerr << "input pub、 sub、pubnosec or subnosec" << std::endl; + std::cin >> type; + } + else { + type = argv[1]; + } + if (type == "pub") + { + DomainParticipantFactory* factory = TheParticipantFactory; + ReturnCode_t retCode; + retCode = factory->load_security_plugin( + "SecurityPlugin", + "SecurityPlugin.dll", //TODO 动态库实际路径和文件名 + "SecPluginGetInstance", + "SecPluginFinalize"); + if (retCode != 0) + { + printf("load_security_plugin failed(%d).", retCode); + return -1; + } + + int sample_count = 100; + DomainParticipant* participant = NULL; + Publisher* publisher = NULL; + Topic* topic = NULL; + DataWriter* writer = NULL; + HelloWorld instance = { 0,"a" }; + + ReturnCode_t retcode; + InstanceHandle_t instance_handle = HANDLE_NIL; + const char* type_name = NULL; + int count = 0; + + { + retCode = factory->load_qos_from_xml("../dds_security_qos.xml"); + if (retCode != 0) + { + printf("load_qos_from_xml failed(%d).", retCode); + return -1; + } + participant = factory->create_participant_with_profile( + 0, "default_lib", + "default_profile", "example_pub", NULL, PUBLICATION_MATCHED_STATUS); + if (participant == NULL) { + fprintf(stderr, "create_participant error\n"); + return -1; + } + } + publisher = participant->create_publisher( + PUBLISHER_QOS_DEFAULT, NULL, STATUS_MASK_NONE); + if (publisher == NULL) { + fprintf(stderr, "create_publisher error\n"); + publisher_shutdown(participant); + return -1; + } + + type_name = HelloWorldTypeSupport::get_instance()->get_typename(); + participant->registe_type(type_name, HelloWorldTypeSupport::get_instance()); + topic = participant->create_topic( + "rr/aReply", + type_name, TOPIC_QOS_DEFAULT, NULL, + STATUS_MASK_NONE); + if (topic == NULL) { + fprintf(stderr, "create_topic error\n"); + publisher_shutdown(participant); + return -1; + } + + DataWriterQos wrQos; + publisher->get_default_datawriter_qos(wrQos); + //wrQos.reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + wrQos.reliability.kind = RELIABLE_RELIABILITY_QOS; + writer = publisher->create_datawriter(topic, wrQos, nullptr, STATUS_MASK_ALL); + + for (count = 0; (sample_count == 0) || (count < sample_count); ++count) { + if (count % 20 == 0) + printf("Writing myData, count %d\n", count); + instance.index = count; + retcode = writer->write(&instance, instance_handle); + if (retcode != RETCODE_OK) { + fprintf(stderr, "write error %d\n", retcode); + } + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + } + + publisher_shutdown(participant); + } + else if (type == "sub") { + DomainParticipantFactory* factory = TheParticipantFactory; + int retCode; + retCode = factory->load_security_plugin( + "SecurityPlugin", + "SecurityPlugin.dll", + "SecPluginGetInstance", + "SecPluginFinalize"); + if (retCode != 0) + { + printf("load_security_plugin failed(%d).", retCode); + return -1; + } + + int sample_count = 0; + DomainParticipant* participant = NULL; + Topic* topic = NULL; + HelloWorld instance = { 0,"a" }; + + Subscriber* subscriber = NULL; + myDataListener* reader_listener = NULL; + DataReader* reader = NULL; + + InstanceHandle_t instance_handle = HANDLE_NIL; + const char* type_name = NULL; + int count = 0; + + { + retCode = factory->load_qos_from_xml("../dds_security_qos.xml"); + if (retCode != 0) + { + printf("load_qos_from_xml failed(%d).", retCode); + return -1; + } + participant = factory->create_participant_with_profile( + 0, "default_lib", + "default_profile", "example_pub", NULL, PUBLICATION_MATCHED_STATUS); + if (participant == NULL) { + fprintf(stderr, "create_participant error\n"); + return -1; + } + } + + subscriber = participant->create_subscriber( + SUBSCRIBER_QOS_DEFAULT, NULL, STATUS_MASK_NONE); + if (subscriber == NULL) { + fprintf(stderr, "create_subscriber error\n"); + subscriber_shutdown(participant); + return -1; + } + + type_name = HelloWorldTypeSupport::get_instance()->get_typename(); + participant->registe_type(type_name, HelloWorldTypeSupport::get_instance()); + + topic = participant->create_topic( + "rr/aReply", + type_name, TOPIC_QOS_DEFAULT, NULL, + STATUS_MASK_NONE); + if (topic == NULL) { + fprintf(stderr, "create_topic error\n"); + subscriber_shutdown(participant); + return -1; + } + + reader_listener = new myDataListener(); + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); //考虑时序性 + + DataReaderQos drQos; + subscriber->get_default_datareader_qos(drQos); + //drQos.reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + drQos.reliability.kind = RELIABLE_RELIABILITY_QOS; + reader = subscriber->create_datareader( + topic, drQos, reader_listener, + STATUS_MASK_ALL); + if (reader == NULL) { + fprintf(stderr, "create_datareader error\n"); + subscriber_shutdown(participant); + delete reader_listener; + return -1; + } + + /* Main loop */ + for (count = 0; (sample_count == 0) || (count < sample_count); ++count) { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + //break; + } + + return subscriber_shutdown(participant); + } + else if (type == "pubnosec") + { + DomainParticipantFactory* factory = TheParticipantFactory; + int sample_count = 0; + DomainParticipant* participant = NULL; + Publisher* publisher = NULL; + Topic* topic = NULL; + DataWriter* writer = NULL; + HelloWorld instance = { 0,"a" }; + ReturnCode_t retcode; + InstanceHandle_t instance_handle = HANDLE_NIL; + const char* type_name = NULL; + int count = 0; + participant = factory->create_participant( + 0, PARTICIPANT_QOS_DEFAULT, NULL, PUBLICATION_MATCHED_STATUS); + if (participant == NULL) { + fprintf(stderr, "create_participant error\n"); + return -1; + } + publisher = participant->create_publisher( + PUBLISHER_QOS_DEFAULT, NULL, STATUS_MASK_NONE); + if (publisher == NULL) { + fprintf(stderr, "create_publisher error\n"); + publisher_shutdown(participant); + return -1; + } + type_name = HelloWorldTypeSupport::get_instance()->get_typename(); + participant->registe_type(type_name, HelloWorldTypeSupport::get_instance()); + topic = participant->create_topic( + "rr/aReply", + type_name, TOPIC_QOS_DEFAULT, NULL, + STATUS_MASK_NONE); + if (topic == NULL) { + fprintf(stderr, "create_topic error\n"); + publisher_shutdown(participant); + return -1; + } + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); //考虑时序性 + DataWriterQos wrQos; + publisher->get_default_datawriter_qos(wrQos); + //wrQos.reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + wrQos.reliability.kind = RELIABLE_RELIABILITY_QOS; + writer = publisher->create_datawriter(topic, wrQos, nullptr, STATUS_MASK_ALL); + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + for (count = 0; (sample_count == 0) || (count < sample_count); ++count) { + if (count % 20 == 0) + printf("Writing myData, count %d\n", count); + instance.index = count; + retcode = writer->write(&instance, instance_handle); + if (retcode != RETCODE_OK) { + fprintf(stderr, "write error %d\n", retcode); + } + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + } + publisher_shutdown(participant); + } + else if (type == "subnosec") { + DomainParticipantFactory* factory = TheParticipantFactory; + int sample_count = 0; + DomainParticipant* participant = NULL; + Topic* topic = NULL; + HelloWorld instance = { 0,"a" }; + + Subscriber* subscriber = NULL; + myDataListener* reader_listener = NULL; + DataReader* reader = NULL; + + InstanceHandle_t instance_handle = HANDLE_NIL; + const char* type_name = NULL; + int count = 0; + participant = factory->create_participant( + 0, PARTICIPANT_QOS_DEFAULT, NULL, PUBLICATION_MATCHED_STATUS); + if (participant == NULL) { + fprintf(stderr, "create_participant error\n"); + return -1; + } + subscriber = participant->create_subscriber( + SUBSCRIBER_QOS_DEFAULT, NULL, STATUS_MASK_NONE); + if (subscriber == NULL) { + fprintf(stderr, "create_subscriber error\n"); + subscriber_shutdown(participant); + return -1; + } + + type_name = HelloWorldTypeSupport::get_instance()->get_typename(); + participant->registe_type(type_name, HelloWorldTypeSupport::get_instance()); + + topic = participant->create_topic( + "rr/aReply", + type_name, TOPIC_QOS_DEFAULT, NULL, + STATUS_MASK_NONE); + if (topic == NULL) { + fprintf(stderr, "create_topic error\n"); + subscriber_shutdown(participant); + return -1; + } + + reader_listener = new myDataListener(); + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); //考虑时序性 + + DataReaderQos drQos; + subscriber->get_default_datareader_qos(drQos); + //drQos.reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + drQos.reliability.kind = RELIABLE_RELIABILITY_QOS; + reader = subscriber->create_datareader( + topic, drQos, reader_listener, + STATUS_MASK_ALL); + if (reader == NULL) { + fprintf(stderr, "create_datareader error\n"); + subscriber_shutdown(participant); + delete reader_listener; + return -1; + } + + /* Main loop */ + for (count = 0; (sample_count == 0) || (count < sample_count); ++count) { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + //break; + } + + return subscriber_shutdown(participant); + } + else { + return 0; + } +} + diff --git a/example/travodds-helloworld/HelloWorld/src/HelloWorld.cpp b/example/travodds-helloworld/HelloWorld/src/HelloWorld.cpp new file mode 100644 index 0000000000000000000000000000000000000000..38b58bb156ae0496f2fc3c0eaaaeb0a628966ec1 --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/src/HelloWorld.cpp @@ -0,0 +1,12 @@ +#include "HelloWorld.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} + + + +#endif diff --git a/example/travodds-helloworld/HelloWorld/src/HelloWorld.h b/example/travodds-helloworld/HelloWorld/src/HelloWorld.h new file mode 100644 index 0000000000000000000000000000000000000000..f70b0f6a27078e03afe65dd66dd2830ae33be13c --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/src/HelloWorld.h @@ -0,0 +1,33 @@ +#ifndef HelloWorld_H +#define HelloWorld_H + +#include +#include +#include +#include +#include "cdr/travoddscdr.h" + +#if defined(DDS_TYPE_EXPORT) && defined(_WIN32) +#define DDS_TYPE_API __declspec(dllexport) +#else +#define DDS_TYPE_API +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +class DDS_TYPE_API HelloWorld { +public: + bool operator<(const HelloWorld& rhs) const { + (void)rhs; + return false; + } + unsigned int index; + std::string message; +}; + +#ifdef __cplusplus +} +#endif +#endif /* HelloWorld_H */ diff --git a/example/travodds-helloworld/HelloWorld/src/HelloWorldTypeSupport.cpp b/example/travodds-helloworld/HelloWorld/src/HelloWorldTypeSupport.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7b3ac83aca5e5c57d478e30df96fbc9562f30edc --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/src/HelloWorldTypeSupport.cpp @@ -0,0 +1,113 @@ +#include "HelloWorldTypeSupport.h" + +USING_TRAVODDS_NAMESPACE + +#ifdef __cplusplus +extern "C" { +#endif + +HelloWorldTypeSupport* HelloWorldTypeSupport::get_instance() { + static HelloWorldTypeSupport instance; + return &instance; +} + +void* HelloWorldTypeSupport::create_data() { + return new HelloWorld(); +} + +void HelloWorldTypeSupport::delete_data(void* data) { + delete static_cast(data); +} + +int HelloWorldTypeSupport::copy_data(void* dst, void* src) { + HelloWorld* dstData = static_cast(dst); + HelloWorld* srcData = static_cast(src); + *dstData = *srcData; + return 0; +} + +unsigned int HelloWorldTypeSupport::get_serialized_data_size(void* data, unsigned int currentAlignment) { + HelloWorld* structData = static_cast(data); + unsigned int initialAlignment = currentAlignment; + currentAlignment += TRAVODDS::CdrSerializer::getBaseTypeSize(sizeof(unsigned int), currentAlignment); + currentAlignment += TRAVODDS::CdrSerializer::getStringSize(structData->message.size() + 1, currentAlignment); + return currentAlignment - initialAlignment; +} + +unsigned int HelloWorldTypeSupport::get_max_serialized_data_size(void* data, unsigned int currentAlignment) { + return LENGTH_UNLIMITED; +} + +int HelloWorldTypeSupport::serialize_data(void* data, TRAVODDS::CdrSerializer* cdr, int endian) { + HelloWorld* structData = static_cast(data); + if (!cdr->serializeBaseType(structData->index)) { + fprintf(stderr, "Serialization failed for field: structData->index\n"); + return -1; + } + if (!cdr->serializeString(structData->message)) { + fprintf(stderr, "Serialization failed for field: structData->message\n"); + return -1; + } + return 0; +} + +int HelloWorldTypeSupport::deserialize_data(void* data, TRAVODDS::CdrDeserializer* cdr, int endian) { + HelloWorld* structData = static_cast(data); + if (!cdr->deserializeBaseType(structData->index)) { + fprintf(stderr, "Deserialization failed for field: structData->index\n"); + return -1; + } + if (!cdr->deserializeString(structData->message)) { + fprintf(stderr, "Deserialization failed for field: structData->message\n"); + return -1; + } + return 0; +} + +TypeObject* HelloWorldTypeSupport::get_typeobject() { + return nullptr; +} + +int HelloWorldTypeSupport::serialize_key(void* data, TRAVODDS::CdrSerializer* cdr, int endian) { + return 0; +} + +int HelloWorldTypeSupport::MakeKey(const void* data, InstanceHandle_t& iHandle, bool forceMd5) { + unsigned int serializedSize = get_serialized_data_size((void*)data, 0); + SerializedBuffer buffer; + buffer.buffer_size = serializedSize; + buffer.buffer = new char[buffer.buffer_size]; + TRAVODDS::CdrSerializer cdr(&buffer); + ReturnCode_t ret = get_instancehandle((void*)data, &cdr, iHandle, forceMd5); + delete[] buffer.buffer; + return ret == RETCODE_OK ? 0 : -1; +} + +ReturnCode_t HelloWorldTypeSupport::get_instancehandle(void* data, TRAVODDS::CdrSerializer* cdr, InstanceHandle_t& iHandle, bool forceMd5) { + if (!has_key()) { + iHandle = HANDLE_NIL; + return RETCODE_OK; + } + int ret = serialize_key(data, cdr, forceMd5); + if (ret != 0) { + fprintf(stderr, "Failed to serialize key.\n"); + return RETCODE_ERROR; + } + if (!cdr->getKeyHash((char*)&iHandle, forceMd5)) { + fprintf(stderr, "Failed to get key hash\n"); + return RETCODE_ERROR; + } + return RETCODE_OK; +} + +bool HelloWorldTypeSupport::has_key() { + return false; +} + +const char* HelloWorldTypeSupport::get_typename() { + return "HelloWorld"; +} + +#ifdef __cplusplus +} +#endif diff --git a/example/travodds-helloworld/HelloWorld/src/HelloWorldTypeSupport.h b/example/travodds-helloworld/HelloWorld/src/HelloWorldTypeSupport.h new file mode 100644 index 0000000000000000000000000000000000000000..86981d2c11abe747587dc40ff3d0043c5514d91f --- /dev/null +++ b/example/travodds-helloworld/HelloWorld/src/HelloWorldTypeSupport.h @@ -0,0 +1,48 @@ +#ifndef HelloWorldTypeSupport_H +#define HelloWorldTypeSupport_H + +#include "dcps/topic/typesupport.h" +#include "HelloWorld.h" + +#ifdef __cplusplus +extern "C" { +#endif + +class DDS_TYPE_API HelloWorldTypeSupport : public TRAVODDS::TypeSupport { +public: + static HelloWorldTypeSupport* get_instance(); + + virtual void* create_data() override; + + virtual void delete_data(void* data) override; + + virtual int copy_data(void* dst, void* src) override; + + virtual unsigned int get_serialized_data_size(void* data, unsigned int currentAlignment) override; + + virtual unsigned int get_max_serialized_data_size(void* data, unsigned int currentAlignment) override; + + virtual int serialize_data(void* data, TRAVODDS::CdrSerializer* cdr, int endian) override; + + virtual int deserialize_data(void* data, TRAVODDS::CdrDeserializer* cdr, int endian) override; + + virtual TRAVODDS::TypeObject* get_typeobject() override; + + virtual TRAVODDS::ReturnCode_t get_instancehandle(void* data, TRAVODDS::CdrSerializer* cdr, TRAVODDS::InstanceHandle_t& iHandle, bool forceMd5 = false) override; + + virtual bool has_key() override; + + virtual const char* get_typename() override; + + virtual int MakeKey(const void* data, TRAVODDS::InstanceHandle_t& iHandle, bool forceMd5 = false) override; + + int serialize_key(void* data, TRAVODDS::CdrSerializer* cdr, int endian); + +private: + HelloWorldTypeSupport() = default; +}; + +#ifdef __cplusplus +} +#endif +#endif /* HelloWorldTypeSupport_H */ diff --git a/include/securityplugin/cryptographicplugin.h b/include/securityplugin/cryptographicplugin.h index 941ee4cfd2a89d1b3b39aabc8713cf9861a23793..ef7054c00909bbffc7aa2e75195c9f99c67f46da 100644 --- a/include/securityplugin/cryptographicplugin.h +++ b/include/securityplugin/cryptographicplugin.h @@ -99,12 +99,12 @@ struct BuffersContainer const SerializedBuffer* src_buffer; /** @brief The buffers number */ unsigned int buffers_num; + /** @brief true to little endian of source data */ + bool little_endian; /** @brief The current using buffer */ unsigned int cur_buffer_index; /** @brief The current buffer offset */ unsigned int cur_buffer_offset; - /** @brief true to little endian of source data */ - bool little_endian; }; /** @@ -247,12 +247,16 @@ struct ParticipantCommon * 对于本地Participant而言,代表ParticipantKeyMaterial; * 对于远端Participant而言,代表Participant2ParticipantKeyMaterial。 */ KeyMaterial_AES_GCM_GMAC participant_key_material; + + std::mutex mac_mutex; /** @brief 用于加密/签名RTPS消息的MAC Context */ HMAC_CTX* participant_mac_ctx; /** @brief 该Participant所创建的数据读者列表 */ std::list datareaders; /** @brief 该Participant所创建的数据写者列表 */ std::list datawriters; + + std::mutex cipher_mutex; EVP_CIPHER_CTX* cipher_ctx; }; @@ -306,19 +310,23 @@ struct PrivateDatawriter { PrivateDatawriter(); ~PrivateDatawriter(); - bool is_volatile_message_writer; /** @brief 数据读者所属参与者. */ ParticipantCryptoHandle participant_handle; + bool is_volatile_message_writer; /** @brief 子消息保护类型 */ ProtectionKind submsg_protection_kind; + /** @brief 负载数据保护类型 */ + ProtectionKind payload_protection_kind; /** @brief 加密子消息使用的密钥. */ KeyMaterial_AES_GCM_GMAC submsg_key_material; + + std::mutex submsg_mac_mutex; HMAC_CTX* submsg_mac_ctx = NULL; SecurePrefixSubMsg secure_submsg_prefix; - /** @brief 负载数据保护类型 */ - ProtectionKind payload_protection_kind; /** @brief 加密数据负载使用的密钥. */ KeyMaterial_AES_GCM_GMAC payload_key_material; + + std::mutex payload_mac_mutex; HMAC_CTX* payload_mac_ctx; CryptoHeader payload_secure_header; /** @brief 与数据写者关联的数据读者集合. */ @@ -336,12 +344,14 @@ struct PrivateDatareader { PrivateDatareader(); ~PrivateDatareader(); - bool is_volatile_message_reader; /** @brief 数据读者所属参与者. */ ParticipantCryptoHandle participant_handle; + bool is_volatile_message_reader; ProtectionKind submsg_protection_kind; /** @brief 加密子消息使用的密钥. */ KeyMaterial_AES_GCM_GMAC submsg_key_material; + + std::mutex mac_mutex; HMAC_CTX* submsg_mac_ctx; SecurePrefixSubMsg secure_submsg_prefix; /** @brief 与数据读者关联的数据写者集合. */ diff --git a/include/securityplugin/pkidhauthentication.h b/include/securityplugin/pkidhauthentication.h index 282483989f127385045f8d88cd64ce6bcca0f6d5..75fc1fa0cf6af80a8594b973462230343f0a956d 100644 --- a/include/securityplugin/pkidhauthentication.h +++ b/include/securityplugin/pkidhauthentication.h @@ -195,7 +195,7 @@ public: bool set_listener( AuthenticationListener *listener, SecurityException *exception) { - //listenerΪ¿Õ£¬Ôò²»ÉèÖÃlistener + (void)exception; if (listener == NULL) { return true; @@ -221,7 +221,9 @@ public: bool return_identity_handle( const IdentityHandle identity_handle, SecurityException *exception) { - //delete(IdentityHandleImpl*)identity_handle; + (void)identity_handle; + (void)exception; + //delete(IdentityHandleImpl*)identity_handle; //TODO return true; } @@ -229,6 +231,7 @@ public: bool return_sharedsecret_handle( const SharedSecretHandle shared_secret_handle, SecurityException *exception) { + (void)exception; delete (SharedSecretHandleImpl*)shared_secret_handle; return true; } diff --git a/src/commonutils.cpp b/src/commonutils.cpp index 0238d0ad7214642d028d589bc47661b8a508a75f..07ae1bc7408d422c69d5d59fe2973c0adfbccdaf 100644 --- a/src/commonutils.cpp +++ b/src/commonutils.cpp @@ -16,7 +16,7 @@ unsigned int split_str(const char* str, char c, std::vector& result } result.clear(); std::string tmp; - unsigned int strLength = strlen(str); + unsigned int strLength = static_cast(strlen(str)); if (strLength == 0) { return 0; @@ -40,7 +40,7 @@ unsigned int split_str(const char* str, char c, std::vector& result { result.push_back(tmp); } - return result.size(); + return static_cast(result.size()); } bool match_str(const std::string& pattern, const std::string& str) diff --git a/src/cryptographicplugin.cpp b/src/cryptographicplugin.cpp index 1c48bd800ad6485d92f5bb18cff8918440d66abe..f4bef5cdac5d769c6524c59aeab91fe3b0808469 100644 --- a/src/cryptographicplugin.cpp +++ b/src/cryptographicplugin.cpp @@ -245,7 +245,6 @@ bool CryptographicPluginUtility::read_data_from_buffers( return true; } total_length = elements_num * element_length; - unsigned char temp; for (unsigned int i = 0; i < total_length; i += element_length) { switch (element_length) @@ -327,7 +326,7 @@ bool BuiltinCryptoTransform::aes_gcm_gmac_encrypt(EVP_CIPHER_CTX* cipher_ctx, if (key_kind == CRYPTO_TRANSFORMATION_KIND_AES128_GCM || key_kind == CRYPTO_TRANSFORMATION_KIND_AES256_GCM) { - if (*ciphertext_length < total_length + curBuffer->buffer_size) + if (*ciphertext_length < static_cast(total_length + curBuffer->buffer_size)) { return false; } @@ -346,7 +345,7 @@ bool BuiltinCryptoTransform::aes_gcm_gmac_encrypt(EVP_CIPHER_CTX* cipher_ctx, if (key_kind == CRYPTO_TRANSFORMATION_KIND_AES128_GCM || key_kind == CRYPTO_TRANSFORMATION_KIND_AES256_GCM) { - if (*ciphertext_length < total_length + plaintext[i].buffer_size) + if (*ciphertext_length < static_cast(total_length + plaintext[i].buffer_size)) { return false; } @@ -370,7 +369,7 @@ bool BuiltinCryptoTransform::aes_gcm_gmac_encrypt(EVP_CIPHER_CTX* cipher_ctx, } //加密结束,该函数之后不再update - int ret = EVP_EncryptFinal_ex(cipher_ctx, NULL, &cur_buf_length); + EVP_EncryptFinal_ex(cipher_ctx, NULL, &cur_buf_length); //签名 EVP_CIPHER_CTX_ctrl(cipher_ctx, EVP_CTRL_AEAD_GET_TAG, tag_length, tag); if (key_kind == CRYPTO_TRANSFORMATION_KIND_AES128_GCM @@ -536,9 +535,9 @@ void BuiltinCryptoTransform::get_rec_spe_key_material( unsigned char* write_ptr = CryptographicPluginUtility::write_data( input_char, (const unsigned char*)char_session_receiver_key, - strlen(char_session_receiver_key), + static_cast(strlen(char_session_receiver_key)), 1, true); - char_length += strlen(char_session_receiver_key); + char_length += static_cast(strlen(char_session_receiver_key)); write_ptr = CryptographicPluginUtility::write_data( write_ptr, sender_crypto.master_salt, key_size, 1, true); char_length += key_size; @@ -670,7 +669,7 @@ int BuiltinCryptoTransform::serialize_secure_payload( buf_write_ptr = CryptographicPluginUtility::write_data( buf_write_ptr, data_tag->common_mac, sizeof(data_tag->common_mac), 1, false); - int recer_mac_num = data_tag->receiver_specific_macs.size(); + int recer_mac_num = static_cast(data_tag->receiver_specific_macs.size()); // 根据body_length的长度添加对齐 const unsigned char padding[8] = { 0 }; uint32_t padLen = (4 - (data_body->body_length % 4)) % 4; @@ -681,17 +680,17 @@ int BuiltinCryptoTransform::serialize_secure_payload( buf_write_ptr = CryptographicPluginUtility::write_data( buf_write_ptr, (unsigned char*)&recer_mac_num, 1, 4, false); ReceiverSpecificMAC receiver_mac; - for (int i = 0; i < data_tag->receiver_specific_macs.size(); ++i) + for (size_t i = 0; i < data_tag->receiver_specific_macs.size(); ++i) { // 根据协议使用大端序列化 - data_tag->receiver_specific_macs.front(); + static_cast(data_tag->receiver_specific_macs.front()); receiver_mac = data_tag->receiver_specific_macs[i]; buf_write_ptr = CryptographicPluginUtility::write_data( buf_write_ptr, receiver_mac.receiver_mac_key_id.data, 4, 1, false); buf_write_ptr = CryptographicPluginUtility::write_data( buf_write_ptr, receiver_mac.receiver_mac, 16, 1, false); } - length += (data_tag->receiver_specific_macs.size() * (4 + 16)); + length += static_cast(data_tag->receiver_specific_macs.size() * (4 + 16)); if (output_buf_length < length) { return -10; @@ -703,6 +702,7 @@ int BuiltinCryptoTransform::serialize_crypto_content( unsigned char* output_buf, unsigned int output_buf_length, const CryptoContent* data_body, bool little_endian) { + (void)output_buf_length; int serialize_length = 0; if (data_body->body_flag == CryptoContent::ENCRYPT) { @@ -788,12 +788,12 @@ int BuiltinCryptoTransform::serialize_secure_submessage( buf_write_ptr = CryptographicPluginUtility::write_data(buf_write_ptr, data_tag->sec_data_tag.common_mac, sizeof(data_tag->sec_data_tag.common_mac), 1, false); length += sizeof(data_tag->sec_data_tag.common_mac); - int recer_mac_num = data_tag->sec_data_tag.receiver_specific_macs.size(); + int recer_mac_num = static_cast(data_tag->sec_data_tag.receiver_specific_macs.size()); buf_write_ptr = CryptographicPluginUtility::write_data(buf_write_ptr, (unsigned char*)&recer_mac_num, 1, 4, false); length += 4; ReceiverSpecificMAC receiver_mac; - for (int i = 0; i < data_tag->sec_data_tag.receiver_specific_macs.size(); ++i) + for (size_t i = 0; i < data_tag->sec_data_tag.receiver_specific_macs.size(); ++i) { receiver_mac = data_tag->sec_data_tag.receiver_specific_macs[i]; buf_write_ptr = CryptographicPluginUtility::write_data(buf_write_ptr, @@ -801,8 +801,8 @@ int BuiltinCryptoTransform::serialize_secure_submessage( buf_write_ptr = CryptographicPluginUtility::write_data(buf_write_ptr, receiver_mac.receiver_mac, 16, 1, false); } - length += (data_tag->sec_data_tag.receiver_specific_macs.size() * (4 + 16)); - if (output_buf_length < length) + length += static_cast(data_tag->sec_data_tag.receiver_specific_macs.size() * (4 + 16)); + if (static_cast(output_buf_length) < length) { return -1; } @@ -874,12 +874,12 @@ int BuiltinCryptoTransform::serialize_secure_rtps_message( buf_write_ptr, data_tag->sec_data_tag.common_mac, sizeof(data_tag->sec_data_tag.common_mac), 1, false); length += sizeof(data_tag->sec_data_tag.common_mac); - int recer_mac_num = data_tag->sec_data_tag.receiver_specific_macs.size(); + int recer_mac_num = static_cast(data_tag->sec_data_tag.receiver_specific_macs.size()); buf_write_ptr = CryptographicPluginUtility::write_data( buf_write_ptr, (unsigned char*)&recer_mac_num, 1, 4, false); length += 4; ReceiverSpecificMAC receiver_mac; - for (int i = 0; i < data_tag->sec_data_tag.receiver_specific_macs.size(); ++i) + for (size_t i = 0; i < data_tag->sec_data_tag.receiver_specific_macs.size(); ++i) { receiver_mac = data_tag->sec_data_tag.receiver_specific_macs[i]; buf_write_ptr = CryptographicPluginUtility::write_data( @@ -887,7 +887,7 @@ int BuiltinCryptoTransform::serialize_secure_rtps_message( buf_write_ptr = CryptographicPluginUtility::write_data( buf_write_ptr, receiver_mac.receiver_mac, 16, 1, false); } - length += (data_tag->sec_data_tag.receiver_specific_macs.size() * (4 + 16)); + length += (static_cast(data_tag->sec_data_tag.receiver_specific_macs.size()) * (4 + 16)); if (output_buf_length < length) { return -1; @@ -981,7 +981,7 @@ bool BuiltinCryptoTransform::deserialize_data_body_and_postfix( } else { - memcpy(&postfix, &cur_submsg, sizeof(cur_submsg)); + memcpy(static_cast(&postfix), &cur_submsg, sizeof(SubMsgHeader)); deserialize_data_tag(postfix.sec_data_tag, buffers); break; } @@ -1227,7 +1227,7 @@ bool BuiltinCryptoTransform::deserialize_data_tag( SecureSubmessageCategory_t BuiltinCryptoTransform::get_submessage_kind( unsigned char* submessage_data, int data_length) { - bool ret = false; + (void)data_length; unsigned char msg_kind = *submessage_data; if (msg_kind == ACKNACK || msg_kind == NACK_FRAG) { @@ -1261,11 +1261,11 @@ bool BuiltinCryptoTransform::verify_receiver_macs( return true; } ReceiverSpecificMAC receiver_mac; - int tag_length = 16; + //int tag_length = 16; bool ret = false; unsigned char rec_session_key[32]; get_rec_spe_key_material(rec_session_key, IV, key_material); - int mac_num = data_tag->receiver_specific_macs.size(); + int mac_num = static_cast(data_tag->receiver_specific_macs.size()); CryptoTransformKind key_kind = CRYPTO_TRANSFORMATION_KIND_NONE; if (key_material.transformation_kind == CRYPTO_TRANSFORMATION_KIND_AES256_GMAC || key_material.transformation_kind == CRYPTO_TRANSFORMATION_KIND_AES256_GCM) @@ -1375,10 +1375,13 @@ bool BuiltinCryptoTransform::encode_serialized_payload( local_writer->payload_secure_header.initialization_vector_suffix, sizeof(local_writer->payload_secure_header.initialization_vector_suffix)); // 创建key - get_key_material(session_key, - local_writer->payload_mac_ctx, - local_writer->payload_secure_header.session_id, - sender_key); + { + std::lock_guard lock(local_writer->payload_mac_mutex); + get_key_material(session_key, + local_writer->payload_mac_ctx, + local_writer->payload_secure_header.session_id, + sender_key); + } if (sender_key.transformation_kind == CRYPTO_TRANSFORMATION_KIND_AES128_GMAC || sender_key.transformation_kind == CRYPTO_TRANSFORMATION_KIND_AES256_GMAC) @@ -1419,7 +1422,7 @@ bool BuiltinCryptoTransform::encode_serialized_payload( //填写Tag create_secure_payload_footer(&data_tag, tag); - data_body.header.octets_to_next_header = sizeof(data_body.body_length) + data_body.body_length; + data_body.header.octets_to_next_header = static_cast(sizeof(data_body.body_length)) + data_body.body_length; } else { @@ -1474,7 +1477,7 @@ bool BuiltinCryptoTransform::encode_datawriter_submessage( } //获取密钥信息 PrivateDatawriter* local_datawriter = (PrivateDatawriter*)sending_datawriter_crypto; - LocalParticipant* local_participant = (LocalParticipant*)local_datawriter->participant_handle; + //LocalParticipant* local_participant = (LocalParticipant*)local_datawriter->participant_handle; KeyMaterial_AES_GCM_GMAC* sender_key = &(local_datawriter->submsg_key_material); CryptoHeader& secure_data_header = local_datawriter->secure_submsg_prefix.sec_data_header; if (local_datawriter->is_volatile_message_writer) @@ -1526,10 +1529,14 @@ bool BuiltinCryptoTransform::encode_datawriter_submessage( secure_data_header.initialization_vector_suffix, sizeof(secure_data_header.initialization_vector_suffix)); //创建key - get_key_material(session_key, - local_datawriter->submsg_mac_ctx, - secure_data_header.session_id, - *sender_key); + { + std::lock_guard lock(local_datawriter->submsg_mac_mutex); + get_key_material(session_key, + local_datawriter->submsg_mac_ctx, + secure_data_header.session_id, + *sender_key); + } + if (local_datawriter->is_volatile_message_writer) { HMAC_CTX_reset(local_datawriter->submsg_mac_ctx); @@ -1601,7 +1608,7 @@ bool BuiltinCryptoTransform::encode_datawriter_submessage( data_post.octets_to_next_header = 16 // common mac + 4 // receiver_specific_macs length - + data_tag->receiver_specific_macs.size() * (4 + 16); + + static_cast(data_tag->receiver_specific_macs.size()) * (4 + 16); //组成密文 int rst = serialize_secure_submessage(encoded_buf, encoded_buf_length, &local_datawriter->secure_submsg_prefix, &data_body, &data_post, true); @@ -1690,10 +1697,14 @@ bool BuiltinCryptoTransform::encode_datareader_submessage( secure_data_header.initialization_vector_suffix, sizeof(secure_data_header.initialization_vector_suffix)); //创建key - get_key_material(session_key, - local_reader->submsg_mac_ctx, - secure_data_header.session_id, - *sender_key); + { + std::lock_guard lock(local_reader->mac_mutex); + get_key_material(session_key, + local_reader->submsg_mac_ctx, + secure_data_header.session_id, + *sender_key); + } + if (local_reader->is_volatile_message_reader) { HMAC_CTX_reset(local_reader->submsg_mac_ctx); @@ -1767,7 +1778,7 @@ bool BuiltinCryptoTransform::encode_datareader_submessage( data_post.octets_to_next_header = 16 // common mac + 4 // receiver_specific_macs length - + data_tag->receiver_specific_macs.size() * (4 + 16); + + static_cast(data_tag->receiver_specific_macs.size()) * (4 + 16); int serialize_rst = serialize_secure_submessage( encoded_buf, encoded_rtps_submessage->buffer_size, &local_reader->secure_submsg_prefix, &data_body, &data_post, true); @@ -1851,7 +1862,7 @@ bool BuiltinCryptoTransform::encode_rtps_message( new_rtps_buffer = stack_buf; } unsigned char info_source_header[4]; - int plain_length = plain_rtps_message_length + 4; + //int plain_length = plain_rtps_message_length + 4; info_source_header[0] = INFO_SRC; info_source_header[1] = 0x01; unsigned short header_length = 20; @@ -1869,7 +1880,7 @@ bool BuiltinCryptoTransform::encode_rtps_message( unsigned char* rtps_header_write_ptr = local_participant->secure_rtps_prefix.rtps_header; for (i = 0; i < plain_rtps_message_count; ++i) { - if (rtps_header_remained_length <= plain_rtps_message[i].buffer_size) + if (rtps_header_remained_length <= static_cast(plain_rtps_message[i].buffer_size)) { memcpy(rtps_header_write_ptr, plain_rtps_message[i].buffer, @@ -1893,10 +1904,13 @@ bool BuiltinCryptoTransform::encode_rtps_message( secure_data_header.initialization_vector_suffix, sizeof(secure_data_header.initialization_vector_suffix)); //创建key - get_key_material(session_key, - local_participant->participant_mac_ctx, - secure_data_header.session_id, - sender_key); + { + std::lock_guard lock(local_participant->mac_mutex); + get_key_material(session_key, + local_participant->participant_mac_ctx, + secure_data_header.session_id, + sender_key); + } if (key_kind == CRYPTO_TRANSFORMATION_KIND_AES128_GMAC || key_kind == CRYPTO_TRANSFORMATION_KIND_AES256_GMAC) @@ -1961,9 +1975,9 @@ bool BuiltinCryptoTransform::encode_rtps_message( //填写receiver的mac信息 RemoteParticipant* remote_participant = NULL; - for (int i = 0; i < receiving_crypto_list_num; ++i) + for (int index_receiving_crypto = 0; index_receiving_crypto < receiving_crypto_list_num; ++index_receiving_crypto) { - remote_participant = (RemoteParticipant*)receiving_crypto_list[i]; + remote_participant = (RemoteParticipant*)receiving_crypto_list[index_receiving_crypto]; if (local_participant->remote_participants.find(remote_participant) == local_participant->remote_participants.end()) { @@ -1983,7 +1997,7 @@ bool BuiltinCryptoTransform::encode_rtps_message( data_post.octets_to_next_header = 16 // common mac + 4 // receiver_specific_macs length - + data_tag->receiver_specific_macs.size() * (16 + 4); + + static_cast(data_tag->receiver_specific_macs.size()) * (16 + 4); //组成密文 int rst = serialize_secure_rtps_message( encoded_buf, encoded_rtps_message->buffer_size, @@ -2074,13 +2088,21 @@ bool BuiltinCryptoTransform::decode_rtps_message( unsigned int plain_data_buf_length = data_body.body_length; get_initialzation_vector(&data_header.sec_data_header, IV); - get_key_material(session_key, sender_handle->participant_mac_ctx, - data_header.sec_data_header.session_id, *p2p_key_material); + + { + std::lock_guard lock(sender_handle->mac_mutex); + get_key_material(session_key, sender_handle->participant_mac_ctx, + data_header.sec_data_header.session_id, *p2p_key_material); + } BuffersContainer body_buffers = data_body.data_buffers; - ret = aes_gcm_gmac_decrypt(sender_handle->cipher_ctx, - data_header.sec_data_header.transform_identifier.transformation_kind, - session_key, IV, data_body.data_buffers, data_body.body_length, - data_tag.sec_data_tag.common_mac, plain_data_buf, &plain_data_buf_length); + + { + std::lock_guard lock(sender_handle->cipher_mutex); + ret = aes_gcm_gmac_decrypt(sender_handle->cipher_ctx, + data_header.sec_data_header.transform_identifier.transformation_kind, + session_key, IV, data_body.data_buffers, data_body.body_length, + data_tag.sec_data_tag.common_mac, plain_data_buf, &plain_data_buf_length); + } if (!ret) { ExceptionPrinter(exception, 2205, 7) << "Decrypting RTPS message failed."; @@ -2090,6 +2112,7 @@ bool BuiltinCryptoTransform::decode_rtps_message( if (receiver_handle->remote_participants.find(sender_handle) != receiver_handle->remote_participants.end()) { + std::lock_guard lock(sender_handle->cipher_mutex); if (!verify_receiver_macs(sender_handle->cipher_ctx, &data_tag.sec_data_tag, IV, sender_handle->participant_key_material)) { @@ -2241,7 +2264,7 @@ bool BuiltinCryptoTransform::decode_datawriter_submessage( } CryptoTransformKeyId sender_id = data_header.sec_data_header.transform_identifier.transformation_key_id; - CryptoTransformKind key_kind = data_header.sec_data_header.transform_identifier.transformation_kind; + //CryptoTransformKind key_kind = data_header.sec_data_header.transform_identifier.transformation_kind; // 获取session_id而不是直接使用IV unsigned char session_id[4]; @@ -2265,14 +2288,22 @@ bool BuiltinCryptoTransform::decode_datawriter_submessage( } KeyMaterial_AES_GCM_GMAC& volatile_key = remote_participant->p2p_kx_key_material; - HMAC_CTX_reset(sender_handle->submsg_mac_ctx); // 重置HMAC上下文 - get_key_material(session_key, sender_handle->submsg_mac_ctx, session_id, volatile_key); // 传递session_id,不是IV - + + { + std::lock_guard lock(sender_handle->submsg_mac_mutex); + HMAC_CTX_reset(sender_handle->submsg_mac_ctx); // 重置HMAC上下文 + get_key_material(session_key, sender_handle->submsg_mac_ctx, session_id, volatile_key); // 传递session_id,不是IV + } } else { KeyMaterial_AES_GCM_GMAC& sender_key = sender_handle->submsg_key_material; //普通消息使用submsg_key_material - HMAC_CTX_reset(sender_handle->submsg_mac_ctx); // 重置HMAC上下文 - get_key_material(session_key, sender_handle->submsg_mac_ctx, session_id, sender_key); // 传递session_id,不是IV + //HMAC_CTX_reset(sender_handle->submsg_mac_ctx); // 重置HMAC上下文 + //get_key_material(session_key, sender_handle->submsg_mac_ctx, session_id, sender_key); // 传递session_id,不是IV + { + std::lock_guard lock(sender_handle->submsg_mac_mutex); + HMAC_CTX_reset(sender_handle->submsg_mac_ctx); // 重置HMAC上下文 + get_key_material(session_key, sender_handle->submsg_mac_ctx, session_id, sender_key); // 传递session_id,不是IV + } } std::set::iterator w2r_sending_iter = @@ -2379,7 +2410,14 @@ bool BuiltinCryptoTransform::decode_datareader_submessage( return false; } KeyMaterial_AES_GCM_GMAC& sender_key = sender_handle->submsg_key_material; - get_key_material(session_key, sender_handle->submsg_mac_ctx, IV, sender_key); + //get_key_material(session_key, sender_handle->submsg_mac_ctx, IV, sender_key); + + { + std::lock_guard lock(sender_handle->mac_mutex); + HMAC_CTX_reset(sender_handle->submsg_mac_ctx); // 重置HMAC上下文 + get_key_material(session_key, sender_handle->submsg_mac_ctx, IV, sender_key); + } + //根据密钥类型进行相应的解密处理 ret = aes_gcm_gmac_decrypt(sender_handle->cipher_ctx, data_header.sec_data_header.transform_identifier.transformation_kind, @@ -2405,7 +2443,7 @@ bool BuiltinCryptoTransform::decode_datareader_submessage( { receiver_key = &sender_key; } - bool ret = verify_receiver_macs((*w2r_iter)->cipher_ctx, + ret = verify_receiver_macs((*w2r_iter)->cipher_ctx, &data_tag.sec_data_tag, IV, *receiver_key); if (!ret) { @@ -2427,6 +2465,8 @@ bool BuiltinCryptoTransform::decode_serialized_payload( DatawriterCryptoHandle sending_datawriter_crypto, SecurityException* exception) { + (void)inline_qos; + (void)inline_qos_count; //cout << "plugin BuiltinCryptoKeyFactory::decode_serialized_payload" << endl; if (plain_buffer == NULL || encoded_buffer == NULL @@ -2441,7 +2481,7 @@ bool BuiltinCryptoTransform::decode_serialized_payload( return false; } PrivateDatawriter* sender_handle = (PrivateDatawriter*)sending_datawriter_crypto; - PrivateDatareader* receiver_handle = (PrivateDatareader*)receiving_datareader_crypto; + //PrivateDatareader* receiver_handle = (PrivateDatareader*)receiving_datareader_crypto; if (sender_handle->payload_key_material.transformation_kind == CRYPTO_TRANSFORMATION_KEY_ID_NONE) { ExceptionPrinter(exception, 2208, 2) @@ -2492,6 +2532,7 @@ bool BuiltinCryptoTransform::get_payload_encode_attributes( DatawriterCryptoHandle datawriter_crypto, CryptoPayloadEncodeAttributes* payload_encode_attributes) { + (void)datawriter_crypto; //body的长度4位 payload_encode_attributes->headerFixLength = sizeof(CryptoHeader) + sizeof(int); @@ -2504,6 +2545,7 @@ bool BuiltinCryptoTransform::get_datawriter_submessage_encode_attributes( DatawriterCryptoHandle sending_datawriter_crypto, CryptoWriterSubmessageAttributes* writer_submessage_encode_attributes) { + (void)sending_datawriter_crypto; //body的头4位,body的长度4位 writer_submessage_encode_attributes->headerFixLength = sizeof(SecurePrefixSubMsg) + sizeof(int) + sizeof(int); @@ -2518,6 +2560,7 @@ bool BuiltinCryptoTransform::get_datareader_submessage_encode_attributes( DatareaderCryptoHandle datareader_crypto, CryptoReaderSubmessageAttributes* reader_submessage_encode_attributes) { + (void)datareader_crypto; //body的头4位,body的长度4位 reader_submessage_encode_attributes->headerFixLength = sizeof(SecurePrefixSubMsg) + sizeof(int) + sizeof(int); @@ -2532,6 +2575,7 @@ bool BuiltinCryptoTransform::get_rtps_message_encode_attributes( ParticipantCryptoHandle participant_crypto, CryptoRtpsMessageAttributes* rtps_message_encode_attributes) { + (void)participant_crypto; //body的头4位,body的长度4位,body中会增加一个infoSour的头,24大小 rtps_message_encode_attributes->headerFixLength = sizeof(SecureRTPSPostfixSubMsg) + sizeof(int) + sizeof(int) + 24; @@ -2593,11 +2637,10 @@ bool BuiltinCryptoTransform::preprocess_secure_submsg( ExceptionPrinter(exception, 2209, 3) << "Reader the encoded_buffer fail."; return false; } - // 提取sender_id(这是关键信息) + // 提取sender_id CryptoTransformKeyId sender_id = data_header.sec_data_header.transform_identifier.transformation_key_id; - CryptoTransformKind key_kind = data_header.sec_data_header.transform_identifier.transformation_kind; - unsigned char IV[12]; + //CryptoTransformKind key_kind = data_header.sec_data_header.transform_identifier.transformation_kind; LocalParticipant* local_participant = (LocalParticipant*)receiving_crypto; RemoteParticipant* remote_participant = (RemoteParticipant*)sending_crypto; @@ -2820,7 +2863,7 @@ bool BuiltinCryptoKeyExchange::set_remote_participant_crypto_tokens( return false; } SerializedBuffer serialize_buf; - serialize_buf.buffer_size = crypto_property->value.size(); + serialize_buf.buffer_size = static_cast(crypto_property->value.size()); serialize_buf.origin_buffer = (char*)&(crypto_property->value[0]); serialize_buf.buffer = serialize_buf.origin_buffer; serialize_buf.writer_position = serialize_buf.buffer_size; @@ -2938,7 +2981,7 @@ bool BuiltinCryptoKeyExchange::create_local_datawriter_crypto_tokens( serialize_buf.origin_buffer = new char[serialize_buf.buffer_size]; serialize_buf.buffer = serialize_buf.origin_buffer; CdrSerializer serializer(&serialize_buf, false); - int key_material_seq_len = 0; + //int key_material_seq_len = 0; SecurityException sub_exception; int rst = serlialize_key_material( @@ -2975,7 +3018,7 @@ bool BuiltinCryptoKeyExchange::create_local_datawriter_crypto_tokens( serialize_buf.origin_buffer = new char[serialize_buf.buffer_size]; serialize_buf.buffer = serialize_buf.origin_buffer; CdrSerializer serializer(&serialize_buf, false); - int key_material_seq_len = 0; + //int key_material_seq_len = 0; SecurityException sub_exception; int rst = serlialize_key_material( @@ -3043,7 +3086,7 @@ bool BuiltinCryptoKeyExchange::create_local_datareader_crypto_tokens( serialize_buf.origin_buffer = new char[serialize_buf_len]; serialize_buf.buffer = serialize_buf.origin_buffer; CdrSerializer serializer(&serialize_buf, false); //和fast同为大端 - int key_material_seq_len = 1; + //int key_material_seq_len = 1; SecurityException sub_exception; local_datareader_crypto_tokens->clear(); @@ -3115,14 +3158,14 @@ bool BuiltinCryptoKeyExchange::set_remote_datawriter_crypto_tokens( return false; } SerializedBuffer serialize_buf; - serialize_buf.buffer_size = crypto_property->value.size(); + serialize_buf.buffer_size = static_cast(crypto_property->value.size()); serialize_buf.origin_buffer = (char*)&(crypto_property->value[0]); serialize_buf.buffer = serialize_buf.origin_buffer; serialize_buf.writer_position = serialize_buf.buffer_size; CdrDeserializer deserializer(&serialize_buf); //如果是两个,第一个是子消息key material,第二个是payload - int keymat_len = remote_datawriter_token->size(); + int keymat_len = static_cast(remote_datawriter_token->size()); SecurityException sub_exception; int ret = deserlialize_key_material( @@ -3146,7 +3189,7 @@ bool BuiltinCryptoKeyExchange::set_remote_datawriter_crypto_tokens( } SerializedBuffer serialize_buf_2; - serialize_buf_2.buffer_size = crypto_property_2->value.size(); + serialize_buf_2.buffer_size = static_cast(crypto_property_2->value.size()); serialize_buf_2.origin_buffer = (char*)&(crypto_property_2->value[0]); serialize_buf_2.buffer = serialize_buf_2.origin_buffer; serialize_buf_2.writer_position = serialize_buf_2.buffer_size; @@ -3274,7 +3317,7 @@ bool BuiltinCryptoKeyExchange::set_remote_datareader_crypto_tokens( << "Failed to initialize deserializer"; return false; } - serialize_buf.buffer_size = crypto_property->value.size(); + serialize_buf.buffer_size = static_cast(crypto_property->value.size()); serialize_buf.origin_buffer = (char*)&(crypto_property->value[0]); serialize_buf.buffer = serialize_buf.origin_buffer; serialize_buf.writer_position = serialize_buf.buffer_size; @@ -3347,7 +3390,7 @@ bool BuiltinCryptoKeyExchange::return_crypto_tokens( const BinaryProperty_t* BuiltinCryptoKeyExchange::get_crypto_property( const ParticipantCryptoTokenSeq* remote_tokens) { - int token_num = remote_tokens->size(); + int token_num = static_cast(remote_tokens->size()); if (token_num == 0) { return NULL; @@ -3355,7 +3398,7 @@ const BinaryProperty_t* BuiltinCryptoKeyExchange::get_crypto_property( DataHolder* data_token = NULL; int ret = 0; //遍历seq中的数据,并拷贝出来 - for (size_t i = 0; i < token_num; ++i) + for (int i = 0; i < token_num; ++i) { data_token = (DataHolder*)&((*remote_tokens)[i]); //data_token = (DataHolder*)&remote_tokens->at(i); @@ -3370,7 +3413,7 @@ const BinaryProperty_t* BuiltinCryptoKeyExchange::get_crypto_property( return NULL; } //获取密钥类型 - int binary_num = data_token->binary_properties.size(); + int binary_num = static_cast(data_token->binary_properties.size()); BinaryProperty_t* binary_t = NULL; ret = 0; for (int i = 0; i < binary_num; ++i) @@ -3389,7 +3432,7 @@ BinaryProperty_t* BuiltinCryptoKeyExchange::get_crypto_property_from_token( const DataHolder* data_token) { //获取密钥类型 - int binary_num = data_token->binary_properties.size(); + int binary_num = static_cast(data_token->binary_properties.size()); BinaryProperty_t* binary_t = NULL; int ret = 0; for (int i = 0; i < binary_num; ++i) @@ -3483,7 +3526,6 @@ int BuiltinCryptoKeyExchange::deserlialize_key_material( KeyMaterial_AES_GCM_GMAC* key_material, SecurityException& exception) { - bool ret = false; unsigned int u32_temp = 0; unsigned char u8_temp = 0; @@ -3614,6 +3656,7 @@ int BuiltinCryptoKeyExchange::deserlialize_key_material( int BuiltinCryptoKeyExchange::create_crypto_token( Token* new_token, unsigned char* buff, int buff_length, SecurityException& exception) { + (void)exception; new_token->class_id = token_class_id; //int seq_max_length = new_token->binary_properties.size(); //seq_max_length++; @@ -3672,6 +3715,7 @@ bool BuiltinCryptoKeyFactory::init_key_material_from_shared_secret( KeyMaterial_AES_GCM_GMAC& key_material, SecurityException* exception) { + (void)local_participant; if (shared_handle == NULL) { ExceptionPrinter(exception, 2010, 1) @@ -3965,11 +4009,9 @@ bool BuiltinCryptoKeyFactory::is_volatile_entity(const PropertySeq* properties) { return false; } - int ret = false; Property_t* pro; - int pro_length = properties->size(); - // 验证属性列表中的内容是否存在以下信息 - // 如果存在则为volatile实体 + int pro_length = static_cast(properties->size()); + // 验证属性列表中的内容是否存在以下信息 如果存在则为volatile实体 for (int i = 0; i < pro_length; i++) { //pro = (Property_t*)&(properties[i]); @@ -4417,7 +4459,7 @@ DatareaderCryptoHandle BuiltinCryptoKeyFactory::register_matched_remote_dataread bool relay_only, SecurityException* exception) { - //cout << "plugin BuiltinCryptoKeyFactory::register_matched_remote_datareader" << endl; + (void)shared_secret; if (local_datawriter_crypto_handle == NULL || remote_participant_crypto == NULL) { ExceptionPrinter(exception, 2005, 1) << "There is a NULL input parameter."; @@ -4511,7 +4553,7 @@ DatawriterCryptoHandle BuiltinCryptoKeyFactory::register_matched_remote_datawrit SharedSecretHandle shared_secret, SecurityException* exception) { - //cout << "plugin BuiltinCryptoKeyFactory::register_matched_remote_datawriter" << endl; + (void)shared_secret; if (local_datareader_crypto_handle == NULL || remote_participant_crypto == NULL) { @@ -4677,6 +4719,7 @@ bool BuiltinCryptoKeyFactory::unregister_datawriter( DatawriterCryptoHandle datawriter_crypto_handle, SecurityException* exception) { + (void)exception; if (datawriter_crypto_handle == NULL) { return true; @@ -4729,6 +4772,7 @@ bool BuiltinCryptoKeyFactory::unregister_datareader( DatareaderCryptoHandle datareader_crypto_handle, SecurityException* exception) { + (void)exception; if (datareader_crypto_handle == NULL) { return true; diff --git a/src/permissionsaccesscontrol.cpp b/src/permissionsaccesscontrol.cpp index 73869b39f70887b9c14bec606743f432461e5892..4e35711649b703bd8949ae995302d224a171378e 100644 --- a/src/permissionsaccesscontrol.cpp +++ b/src/permissionsaccesscontrol.cpp @@ -317,7 +317,7 @@ bool PermissionsAccessControl::parse_subject_name( split_str(name, ',', list); //把每个类别根据‘=’,分成一个键值对。 - for (int i = 0; i < list.size(); ++i) { + for (size_t i = 0; i < list.size(); ++i) { std::vector kv_list; //解析出来的键值对数据 split_str(list[i].c_str(), '=', kv_list); if (kv_list.size() != 2) @@ -326,7 +326,7 @@ bool PermissionsAccessControl::parse_subject_name( } std::string kv_arr[2]; int arr_index = 0; - for (int j = 0; j < kv_list.size(); ++j, arr_index++) { + for (size_t j = 0; j < kv_list.size(); ++j, arr_index++) { size_t len = kv_list[j].size(); size_t header = 0, tail = len - 1; std::string &str = kv_list[j]; @@ -416,7 +416,7 @@ bool PermissionsAccessControl::xml_to_governance( return false; } tinyxml2::XMLElement *root = governance_xml; - const char* str = root->Name(); + //const char* str = root->Name(); if (!root || strcmp(root->Name(), "dds") != 0) { ExceptionPrinter(exception, 1032, 2) @@ -1101,7 +1101,7 @@ bool DDSSecXMLElement_to_criteria( FindChildElement(data_tags, "tag", tag_node); while (tag_node != NULL) { - PermissionsDataTags data_tags; + PermissionsDataTags permissionsDataTags = {}; tinyxml2::XMLElement *data_tag_name = NULL; FindChildElement(tag_node, "name", data_tag_name); while (data_tag_name != NULL) @@ -1121,7 +1121,7 @@ bool DDSSecXMLElement_to_criteria( data_tag.value = data_tag_value->GetText(); data_tag_name = data_tag_value->NextSiblingElement(); } - criteria->data_tags.push_back(data_tags); + criteria->data_tags.push_back(permissionsDataTags); tag_node = tag_node->NextSiblingElement("name"); } }//end else @@ -1301,6 +1301,7 @@ bool PermissionsAccessControl::xml_to_permissions( AccessControlPermissions *access_control_permissions, SecurityException *exception) { + (void)domain_id; //判断参数是否正确 if (permissions_xml == NULL || name == NULL) { @@ -1457,7 +1458,6 @@ bool PermissionsAccessControl::xml_to_permissions( continue; } PermissionsRule cur_rule; - SecurityException subProcException; if (!xml_to_permission_rule(rule_node, &cur_rule, &subProcException)) { ExceptionPrinter(exception, 1035, 16) @@ -1520,10 +1520,10 @@ bool PermissionsAccessControl::check_signer(X509* ca, const char* signedContent, // 再验证前保存内容 BUF_MEM* bufMem = NULL; std::string strOriginalContent; - int result; + int result = 0; BIO_get_mem_ptr(contentBIO, &bufMem); if (bufMem && bufMem->length > 0) { - BIO* vertifyBio = BIO_new_mem_buf(bufMem->data, bufMem->length); + BIO* vertifyBio = BIO_new_mem_buf(bufMem->data, static_cast(bufMem->length)); result = CMS_verify(cms, certStack, NULL, vertifyBio, NULL, CMS_NOVERIFY | CMS_NOINTERN | CMS_DETACHED); if (result == 1) { @@ -1536,7 +1536,7 @@ bool PermissionsAccessControl::check_signer(X509* ca, const char* signedContent, *originalContent = new char[strOriginalContent.size() + 1]; memcpy(*originalContent, strOriginalContent.data(), strOriginalContent.size()); (*originalContent)[strOriginalContent.size()] = '\0'; - return result == 1; + return (result == 1); } void PermissionsAccessControl::process_protection_kind( @@ -1565,6 +1565,7 @@ PermissionsHandle PermissionsAccessControl::validate_local_permissions( const DomainParticipantQos *participant_qos, SecurityException *exception) { + (void)participant_qos; //判断参数是否正确 if (auth_plugin == NULL) { @@ -1604,7 +1605,7 @@ PermissionsHandle PermissionsAccessControl::validate_local_permissions( } size_t token_length = identity_token.properties.size(); char *subject_name = NULL; - for (int i = 0; i < token_length; i++) + for (size_t i = 0; i < token_length; i++) { if (identity_token.properties[i].name == "dds.cert.sn") { @@ -1757,6 +1758,7 @@ PermissionsHandle PermissionsAccessControl::validate_remote_permissions( AuthenticatedPeerCredentialToken *remote_credential_token, SecurityException *exception) { + (void)remote_permissions_token; //判断参数是否正确 if (auth_plugin == NULL) { @@ -1777,7 +1779,7 @@ PermissionsHandle PermissionsAccessControl::validate_remote_permissions( const char* id_value = NULL; const char* permission_value = NULL; size_t property_length = remote_credential_token->binary_properties.size(); - for (int i = 0; i < property_length; i++) + for (size_t i = 0; i < property_length; i++) { BinaryProperty_t* cur_property = &remote_credential_token->binary_properties[i]; if (cur_property->name == "") @@ -1900,7 +1902,7 @@ bool PermissionsAccessControl::check_create_participant( (AccessControlPermissions*)permissions_handle; //看domain_id是否符合 - if (domain_id != access_control_permissions->id) + if (domain_id != static_cast(access_control_permissions->id)) { ExceptionPrinter(exception, 1003, 3) << "domain id of participant(" << domain_id << ") not match config in permission(" @@ -2075,7 +2077,7 @@ bool PermissionsAccessControl::check_create_topic( AccessControlPermissions *access_control_permissions = (AccessControlPermissions*)permissions_handle; //看domain_id是否符合 - if (access_control_permissions->id != domain_id) + if (static_cast(access_control_permissions->id) != domain_id) { ExceptionPrinter(exception, 1006, 4) << "domain id(" << domain_id << ") of Topic \"" @@ -2210,7 +2212,7 @@ bool PermissionsAccessControl::check_remote_participant( (AccessControlPermissions*)permissions_handle; //查看domain_id是否符合 - if (domain_id != access_control_permissions->id) + if (domain_id != static_cast(access_control_permissions->id)) { ExceptionPrinter(exception, 1009, 3) << "domain id(" << domain_id << ") of DomainParticipant not match config in permission(" @@ -2344,17 +2346,27 @@ bool PermissionsAccessControl::check_remote_topic( const TopicBuiltinTopicData *topic_data, SecurityException *exception) { + (void)permissions_handle; + (void)domain_id; + (void)topic_data; + (void)exception; return true; } bool PermissionsAccessControl::check_local_datawriter_match( - const PermissionsHandle writer_permisions_handle, + const PermissionsHandle writer_permissions_handle, const PermissionsHandle reader_permissions_handle, const PartitionQosPolicy *publisher_partition, const DataTags_t *writer_data_tag, const DataTags_t *reader_data_tag, SecurityException *exception) { + (void)writer_permissions_handle; + (void)reader_permissions_handle; + (void)publisher_partition; + (void)reader_data_tag; + (void)writer_data_tag; + (void)exception; return true; } @@ -2366,6 +2378,12 @@ bool PermissionsAccessControl::check_local_datareader_match( const DataTags_t *writer_data_tag, SecurityException *exception) { + (void)reader_permissions_handle; + (void)writer_permissions_handle; + (void)subscriber_partiton; + (void)reader_data_tag; + (void)writer_data_tag; + (void)exception; return true; } @@ -2397,7 +2415,7 @@ bool PermissionsAccessControl::get_permissions_token( AccessControlPermissions *access_control_permissions = (AccessControlPermissions*)handle; permissions_token->class_id = "DDS:Access:Permissions"; - size_t seq_length = permissions_token->properties.size(); + //size_t seq_length = permissions_token->properties.size(); //if (!DDS_PropertySeq_ensure_length(&(permissions_token->properties), seq_length, 2)) //{ // ExceptionPrinter(exception, 1017, 3) << "not enough space in properties"; @@ -2438,7 +2456,7 @@ bool PermissionsAccessControl::get_permissions_credential_token( } AccessControlPermissions *access_control_permissions = (AccessControlPermissions*)handle; permissions_credential_token->class_id = "DDS:Access:PermissionsCredential"; - size_t token_length = permissions_credential_token->properties.size(); + //size_t token_length = permissions_credential_token->properties.size(); //if (!DDS_PropertySeq_ensure_length(&(permissions_credential_token->properties), token_length, 1)) //{ // ExceptionPrinter(exception, 1018, 3) << "not enough space in properties"; @@ -2456,6 +2474,7 @@ bool PermissionsAccessControl::set_listener( AccessControlListener *listener, SecurityException *exception) { + (void)exception; m_listener = listener; return true; } @@ -2619,6 +2638,8 @@ bool PermissionsAccessControl::get_datawriter_sec_attributes( EndpointSecurityAttributes *attributes, SecurityException *exception) { + (void)partition; + (void)data_tag; //判断参数是否正确 if (permissions_handle == NULL) { @@ -2893,6 +2914,8 @@ bool PermissionsAccessControl::get_datareader_sec_attributes( EndpointSecurityAttributes *attributes, SecurityException *exception) { + (void)partition; + (void)data_tag; //判断参数是否正确 if (permissions_handle == NULL) { @@ -3220,6 +3243,8 @@ bool PermissionsAccessControl::check_writer_or_reader( bool relay_only, SecurityException *exception) { + (void)data_tag; + (void)relay_only; //判断参数是否正确 if (permissions_handle == NULL) { @@ -3235,7 +3260,7 @@ bool PermissionsAccessControl::check_writer_or_reader( (AccessControlPermissions*)permissions_handle; //看domain_id是否符合 - if (domain_id != access_control_permissions->id) + if (domain_id != static_cast(access_control_permissions->id)) { ExceptionPrinter(exception, 1050, 4) << "domain id(" << domain_id << ") of DataWriter in topic \"" diff --git a/src/pkidhauthentication.cpp b/src/pkidhauthentication.cpp index dfc3e2ead4d269fdeb305e0b4f0a51a583e73a06..0023c902c6cbf2d241c1a42265e0f108aa1e853b 100644 --- a/src/pkidhauthentication.cpp +++ b/src/pkidhauthentication.cpp @@ -221,7 +221,7 @@ ValidationResult_t PKIDHAuthentication::validate_local_identity( //验证输入有效性 IdentityHandleImpl *identity = new IdentityHandleImpl(); Property_t *prikey = NULL; //私钥 - Property_t *prikey_password = NULL; //私钥 + //Property_t *prikey_password = NULL; //私钥 Property_t *permission = NULL; //auth_permission.smime Property_t *governance = NULL; //auth_governance.smime Property_t *certificate = NULL; //用户证书 @@ -254,11 +254,11 @@ ValidationResult_t PKIDHAuthentication::validate_local_identity( continue; } //私钥 - if (curProperty->name == "dds.sec.auth.password") - { - prikey_password = curProperty; - continue; - } + //if (curProperty->name == "dds.sec.auth.password") + //{ + // prikey_password = curProperty; + // continue; + //} //证书注销列表 if (curProperty->name == "dds.sec.auth.certificate_revocation_list") { @@ -642,8 +642,8 @@ ValidationResult_t PKIDHAuthentication::validate_remote_identity( IdentityHandleImpl *localIdentity = (IdentityHandleImpl*)local_identity_handle; IdentityHandleImpl *remoteIdentity = new IdentityHandleImpl(); remoteIdentity->domain_id = localIdentity->domain_id; - Property_t *certificate = NULL; - Property_t *ca = NULL; + //Property_t *certificate = NULL; + //Property_t *ca = NULL; //验证远端class_id if (remote_identity_token.class_id != "DDS:Auth:PKI-DH:1.0") { @@ -873,7 +873,7 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( Sequence c_properties; //hashc2实际计算的内容都以c开头 对端需要校验哈希值 int ensure_length = 0; Sequence signature_seq; - char *participant_key = NULL; + //char *participant_key = NULL; //解析接收的对端的handshake_message_in,存到握手句柄handle,保存到dpInfo HandShakeHandleImpl *handle = new HandShakeHandleImpl(); handle->is_initiator = false; @@ -903,11 +903,11 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( std::string seqStr = ""; X509* cert = create_certificate_from_text( // 证书验证 (char*)initiatorIdentity->identity_certificate.c_str(), - certificate_property->value.size()); - int ret = validate_certificate(replierIdentity, + static_cast(certificate_property->value.size())); + int ret_validate = validate_certificate(replierIdentity, cert, &subException); X509_free(cert); - if (ret < 0) + if (ret_validate < 0) { delete handle; ExceptionPrinter(exception, 4, 5) @@ -916,12 +916,12 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( return VALIDATION_FAILED; } //添加公钥 - RSA *rsa_pubencrypt = NULL; + //RSA *rsa_pubencrypt = NULL; BIO *pbio = NULL; X509 *usercert = NULL; //解密signature //证书内容 - int l_certificate = certificate_property->value.size(); + int l_certificate = static_cast(certificate_property->value.size()); pbio = BIO_new_mem_buf(initiatorIdentity->identity_certificate.c_str(), l_certificate); usercert = PEM_read_bio_X509(pbio, NULL, NULL, NULL); BIO_free(pbio); @@ -957,7 +957,7 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( //participantkey_property->value.to_array(valPtr, participantkey_property->value.length()); SerializedBuffer buf; buf.buffer = (char*)valPtr; - buf.buffer_size = participantkey_property->value.size(); + buf.buffer_size = static_cast(participantkey_property->value.size()); buf.writer_position = buf.buffer_size; CdrDeserializer cdr(&buf, false); //大端 while (true) @@ -1008,7 +1008,7 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( unsigned char sub_sha256[32] = { 0 }; const unsigned char *pder = NULL; size_t len = 0; - pbio = BIO_new_mem_buf(certificate_property->value.data(), certificate_property->value.size()); + pbio = BIO_new_mem_buf(certificate_property->value.data(), static_cast(certificate_property->value.size())); X509 *scert = PEM_read_bio_X509(pbio, NULL, NULL, NULL); X509_NAME_get0_der(X509_get_subject_name(scert), &pder, &len); SHA256(pder, len, sub_sha256); @@ -1033,7 +1033,7 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( //生成自己的认证材料 BinaryProperty_t property_temp1; property_temp1.name = "c.id"; //证书 - for (int i = 0; i < replierIdentity->identity_certificate.length(); ++i) { + for (size_t i = 0; i < replierIdentity->identity_certificate.length(); ++i) { unsigned char ch = replierIdentity->identity_certificate[i]; property_temp1.value.push_back(ch); } @@ -1080,7 +1080,7 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( uint32_t length = 0; SerializedBuffer buffer; //ret = cdrBinaryPropertySeq(length, buffer, /*c_properties*/handle->handshake_request_message_token.binary_properties); - ret = cdrBinaryPropertySeq(length, buffer, c_properties); + bool ret = cdrBinaryPropertySeq(length, buffer, c_properties); property_temp6.name = "hash_c2"; handle->hash_local = new char[32]; @@ -1147,10 +1147,10 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( { property_seek = curProperty; handle->dh_remote = new unsigned char[property_seek->value.size()]; - for (int j = 0; j < property_seek->value.size(); ++j) { + for (size_t j = 0; j < property_seek->value.size(); ++j) { handle->dh_remote[j] = property_seek->value[j]; } - handle->dh_remote_length = property_seek->value.size(); + handle->dh_remote_length = static_cast(property_seek->value.size()); break; } } @@ -1178,7 +1178,7 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( { const char *name[] = { "c.id", "c.perm", "c.pdata", "c.dsign_algo", "c.kagree_algo" }; Sequence perp; //length 5 - for (int i = 0; i < sizeof(name) / sizeof(char*); i++) + for (size_t i = 0; i < sizeof(name) / sizeof(char*); i++) { for (unsigned int j = 0; j < handshake_message_in->binary_properties.size(); j++) { @@ -1190,14 +1190,14 @@ ValidationResult_t PKIDHAuthentication::begin_handshake_reply( } } } - uint32_t length = 0; - SerializedBuffer buffer; - bool ret = cdrBinaryPropertySeq(length, buffer, perp); + length = 0; + SerializedBuffer buffer_c; + ret = cdrBinaryPropertySeq(length, buffer_c, perp); if (!ret) { // TODO } handle->hash_remote = new char[32]; - SHA256((unsigned char*)buffer.buffer, length, (unsigned char*)handle->hash_remote); + SHA256((unsigned char*)buffer_c.buffer, length, (unsigned char*)handle->hash_remote); BinaryProperty_t tmp_property; tmp_property.name = "hash_c1"; tmp_property.value.resize(32); @@ -1388,7 +1388,7 @@ ValidationResult_t PKIDHAuthentication::process_handshake( } //验证证书 SecurityException subException; - int len = certificate_property->value.size(); + int len = static_cast(certificate_property->value.size()); X509* cert = create_certificate_from_text((const char*)certificate_property->value.data(), len); int ret = validate_certificate(handshake_impl->local_identity_handle, cert, &subException); @@ -1402,8 +1402,8 @@ ValidationResult_t PKIDHAuthentication::process_handshake( } //验证challenge1 分别在handle和token中 - len = handshake_impl->handshake_request_message_token.binary_properties.size(); - for (unsigned int tokenEleIndex = 0; tokenEleIndex < len; tokenEleIndex++) + len = static_cast(handshake_impl->handshake_request_message_token.binary_properties.size()); + for (int tokenEleIndex = 0; tokenEleIndex < len; tokenEleIndex++) { BinaryProperty_t* curProperty = &handshake_impl->handshake_request_message_token.binary_properties[tokenEleIndex]; if (curProperty->name == "challenge1") @@ -1424,10 +1424,8 @@ ValidationResult_t PKIDHAuthentication::process_handshake( return VALIDATION_FAILED; } - bool check = true; for (int i = 0; i < 32; ++i) { if (challenge_in_handle->value[i] != challenge_in_token->value[i]) { - check = false; } if (challenge_in_handle->value[i] != challenge_in_token->value[i]) { ExceptionPrinter(exception, 5, 8) << "check 'challenge1' failed"; @@ -1436,13 +1434,13 @@ ValidationResult_t PKIDHAuthentication::process_handshake( } //验证digital signature //利用对方的公钥进行解密 - RSA *rsa_pubencrypt = NULL; + //RSA *rsa_pubencrypt = NULL; BIO *pbio = NULL; X509 *usercert = NULL; EVP_PKEY *pkey = NULL; //解密signature //证书内容 - int l_certificate = certificate_property->value.size(); + int l_certificate = static_cast(certificate_property->value.size()); //分配空间 pbio = BIO_new_mem_buf(certificate_property->value.data(), l_certificate); //读取证书 @@ -1450,7 +1448,7 @@ ValidationResult_t PKIDHAuthentication::process_handshake( BIO_free(pbio); pbio = NULL; pkey = X509_get0_pubkey(usercert); - rsa_pubencrypt = (RSA*)EVP_PKEY_get0_RSA(pkey); + EVP_PKEY_get0_RSA(pkey); //获取原始hash值 BinaryProperty_t* bpropertyPtr = NULL; Sequence binary_properties; @@ -1643,9 +1641,9 @@ ValidationResult_t PKIDHAuthentication::process_handshake( } } - uint32_t length = 0; + length = 0; SerializedBuffer prepBuffer; - bool res = cdrBinaryPropertySeq(length, prepBuffer, perp); + res = cdrBinaryPropertySeq(length, prepBuffer, perp); if (!res) { // TODO } @@ -1737,9 +1735,6 @@ ValidationResult_t PKIDHAuthentication::process_handshake( temp_property.name = "signature"; temp_property.value.resize(signResLen); memcpy(temp_property.value.data(), signRes, signResLen); - //for (int i = 0; i < signResLen; ++i) { - // temp_property.value.push_back(signRes[i]); - //} handshake_message_out->binary_properties.push_back(temp_property); //delete[]signBuffer.buffer; //查找dds.sec 作为permissionscertificate @@ -1751,7 +1746,7 @@ ValidationResult_t PKIDHAuthentication::process_handshake( { bpropertyPtr = curProperty; handshake_impl->remote_identity_handle->identity_certificate = ""; - for (int i = 0; i < bpropertyPtr->value.size(); ++i) { + for (size_t i = 0; i < bpropertyPtr->value.size(); ++i) { handshake_impl->remote_identity_handle->identity_certificate.push_back(bpropertyPtr->value[i]); } continue; @@ -1761,7 +1756,7 @@ ValidationResult_t PKIDHAuthentication::process_handshake( { bpropertyPtr = curProperty; handshake_impl->remote_identity_handle->access_permission = ""; - for (int i = 0; i < bpropertyPtr->value.size(); ++i) { + for (size_t i = 0; i < bpropertyPtr->value.size(); ++i) { handshake_impl->remote_identity_handle->access_permission.push_back(bpropertyPtr->value[i]); } continue; @@ -1786,19 +1781,19 @@ ValidationResult_t PKIDHAuthentication::process_handshake( << "search 'dh2' in handshake_message_in(reply) failed "; return VALIDATION_FAILED; } - int length_pubkey = 256; - int length_sharedkey = DH_size(handshake_impl->dh_local); + //int length_pubkey = 256; + //int length_sharedkey = DH_size(handshake_impl->dh_local); //char *shared_key = new char[length_sharedkey + 1]; BIGNUM *pub_key_ptr = BN_new(); - BN_bin2bn((unsigned char*)bpropertyPtr->value.data(), bpropertyPtr->value.size(), pub_key_ptr); + BN_bin2bn((unsigned char*)bpropertyPtr->value.data(), static_cast(bpropertyPtr->value.size()), pub_key_ptr); //int len_compute = DH_compute_key((unsigned char*)shared_key, // pub_key_ptr, handshake_impl->dh_local); std::vector shared_secret = computeSharedSecret(handshake_impl->dh_local, generate_dh_peer_key(pub_key_ptr)); - int len_compute = shared_secret.size(); + int len_compute = static_cast(shared_secret.size()); BN_free(pub_key_ptr); if (len_compute == -1) @@ -1823,7 +1818,7 @@ ValidationResult_t PKIDHAuthentication::process_handshake( if (curProperty->name == "challenge1") { bpropertyPtr = curProperty; - handshake_impl->sharedsecret->Challeng1Len = bpropertyPtr->value.size(); + handshake_impl->sharedsecret->Challeng1Len = static_cast(bpropertyPtr->value.size()); handshake_impl->sharedsecret->Challeng1 = new char[bpropertyPtr->value.size()]; memcpy(handshake_impl->sharedsecret->Challeng1, bpropertyPtr->value.data(), bpropertyPtr->value.size()); @@ -1833,7 +1828,7 @@ ValidationResult_t PKIDHAuthentication::process_handshake( if (curProperty->name == "challenge2") { bpropertyPtr = curProperty; - handshake_impl->sharedsecret->Challeng2Len = bpropertyPtr->value.size(); + handshake_impl->sharedsecret->Challeng2Len = static_cast(bpropertyPtr->value.size()); handshake_impl->sharedsecret->Challeng2 = new char[bpropertyPtr->value.size()]; memcpy(handshake_impl->sharedsecret->Challeng2, bpropertyPtr->value.data(), bpropertyPtr->value.size()); @@ -2100,9 +2095,9 @@ ValidationResult_t PKIDHAuthentication::process_handshake( return VALIDATION_FAILED; } - int len_sharedkey = DH_size(handshake_impl->dh_local); - char *sharedkey = new char[len_sharedkey]; - int length_pubkey = 256; + DH_size(handshake_impl->dh_local); + //char *sharedkey = new char[len_sharedkey]; + //int length_pubkey = 256; BIGNUM *pub_key_ptr = BN_new(); BN_bin2bn(handshake_impl->dh_remote, handshake_impl->dh_remote_length, pub_key_ptr); @@ -2110,7 +2105,7 @@ ValidationResult_t PKIDHAuthentication::process_handshake( //int len_compute = DH_compute_key( // (unsigned char*)sharedkey, pub_key_ptr, handshake_impl->dh_local); std::vector shared_secret = computeSharedSecret(handshake_impl->dh_local, generate_dh_peer_key(pub_key_ptr)); - int len_compute = shared_secret.size(); + int len_compute = static_cast(shared_secret.size()); if (len_compute == -1) { //delete[] sharedkey; @@ -2125,7 +2120,7 @@ ValidationResult_t PKIDHAuthentication::process_handshake( //memcpy(handshake_impl->sharedsecret->sharedSecret, sharedkey, len_compute); memcpy(handshake_impl->sharedsecret->sharedSecret, shared_secret.data(), len_compute); //delete[] sharedkey; - sharedkey = NULL; + //sharedkey = NULL; for (unsigned int i = 0; i < handshake_message_in->binary_properties.size(); i++) { BinaryProperty_t* curProperty = &handshake_message_in->binary_properties[i]; @@ -2133,12 +2128,11 @@ ValidationResult_t PKIDHAuthentication::process_handshake( if (curProperty->name == "challenge1") { temp_binaryproperty = curProperty; - handshake_impl->sharedsecret->Challeng1Len = - temp_binaryproperty->value.size(); + handshake_impl->sharedsecret->Challeng1Len = static_cast(temp_binaryproperty->value.size()); handshake_impl->sharedsecret->Challeng1 = new char[temp_binaryproperty->value.size()]; unsigned char *challengeBuffer = new unsigned char[temp_binaryproperty->value.size() + 1]; - for (int i = 0; i < temp_binaryproperty->value.size(); ++i) { - challengeBuffer[i] = temp_binaryproperty->value[i]; + for (size_t index_challenge1 = 0; index_challenge1 < temp_binaryproperty->value.size(); ++index_challenge1) { + challengeBuffer[index_challenge1] = temp_binaryproperty->value[index_challenge1]; } memcpy(handshake_impl->sharedsecret->Challeng1, challengeBuffer, temp_binaryproperty->value.size()); delete[] challengeBuffer; @@ -2149,19 +2143,18 @@ ValidationResult_t PKIDHAuthentication::process_handshake( if (curProperty->name == "challenge2") { temp_binaryproperty = curProperty; - handshake_impl->sharedsecret->Challeng2Len = - temp_binaryproperty->value.size(); + handshake_impl->sharedsecret->Challeng2Len = static_cast(temp_binaryproperty->value.size()); handshake_impl->sharedsecret->Challeng2 = new char[temp_binaryproperty->value.size()]; unsigned char *challenge2Buffer = new unsigned char[temp_binaryproperty->value.size() + 1]; - for (int i = 0; i < temp_binaryproperty->value.size(); ++i) { - challenge2Buffer[i] = temp_binaryproperty->value[i]; + for (size_t index_c2 = 0; index_c2 < temp_binaryproperty->value.size(); ++index_c2) { + challenge2Buffer[index_c2] = temp_binaryproperty->value[index_c2]; } memcpy(handshake_impl->sharedsecret->Challeng2, challenge2Buffer, temp_binaryproperty->value.size()); continue; } } BN_free(pub_key_ptr); - sharedkey = NULL; + //sharedkey = NULL; pub_key_ptr = NULL; handshake_impl->previous_call = INDENTITYSTATE_PROCESS_HANDSHAKE; handshake_impl->return_value = VALIDATION_OK; @@ -2177,6 +2170,8 @@ ValidationResult_t PKIDHAuthentication::process_handshake( SharedSecretHandle PKIDHAuthentication::get_shared_secret( const HandshakeHandle handshake_handle, SecurityException *exception) { + (void)handshake_handle; + (void)exception; SharedSecretHandleImpl *sharedsecret = new SharedSecretHandleImpl(); HandShakeHandleImpl* handshakeImpl = (HandShakeHandleImpl*)handshake_handle; //密钥长度 @@ -2351,7 +2346,8 @@ bool PKIDHAuthentication::return_authenticated_peer_credential_token( bool PKIDHAuthentication::return_handshake_handle( const HandshakeHandle handshake_handle, SecurityException *exception) { - //TODO SPDP中崩溃 + (void)handshake_handle; + (void)exception; //delete(HandShakeHandleImpl*)handshake_handle; return true; } @@ -2373,7 +2369,8 @@ int PKIDHAuthentication::validate_certificate( X509* certificate, SecurityException *exception) { - BIO *pbio = NULL; + (void)exception; + //BIO *pbio = NULL; if (EVP_PKEY_size(X509_get0_pubkey(certificate)) != 256) { return VALIDATION_FAILED; @@ -2414,7 +2411,7 @@ int PKIDHAuthentication::generate_adjusted_participant_key( size_t len = 0; //用户证书、分配空间 BIO *pbio = BIO_new_mem_buf(local_identity_handle->identity_certificate.c_str(), - local_identity_handle->identity_certificate.length() + 1); + static_cast(local_identity_handle->identity_certificate.length() + 1)); X509 *usercert = PEM_read_bio_X509(pbio, NULL, NULL, NULL); //提取主题名的der编码和长度 X509_NAME_get0_der(X509_get_subject_name(usercert), &pder, &len); @@ -2475,9 +2472,10 @@ DH* PKIDHAuthentication::gen_key() int PKIDHAuthentication::read_property_value(const char* value, char*& readBuf, SecurityException *exception) { + (void)exception; int file_header_length = sizeof("file:") - 1; int data_header_length = sizeof("data:,") - 1; - int value_length = strlen(value); + int value_length = static_cast(strlen(value)); int content_length = 0; if (strncmp(value, "file:", file_header_length) == 0) { @@ -2497,7 +2495,17 @@ int PKIDHAuthentication::read_property_value(const char* value, char*& readBuf, fclose(f); return -1; } - fread(readBuf, 1, file_length, f); + size_t bytes_read = fread(readBuf, 1, static_cast(file_length), f); + if (bytes_read != static_cast(file_length)) { + if (feof(f)) { + perror("Unexpected end of file"); + } + else if (ferror(f)) { + perror("Error reading file"); + } + fclose(f); + return -1; + } readBuf[file_length] = '\0'; content_length = file_length; fclose(f); @@ -2505,13 +2513,13 @@ int PKIDHAuthentication::read_property_value(const char* value, char*& readBuf, else if (strncmp(value, "data:,", data_header_length) == 0) { //以data方式存储 - char *readBuf = new char[value_length - data_header_length + 1]; - if (readBuf == NULL) + char *readBuf_data = new char[value_length - data_header_length + 1]; + if (readBuf_data == NULL) { return -1; } content_length = value_length - data_header_length; - memcpy(readBuf, + memcpy(readBuf_data, value + data_header_length, value_length - data_header_length + 1); } diff --git a/src/secpluginutility.cpp b/src/secpluginutility.cpp index ca7d3ddb843e74d7e4d2c04760da896ec6072a1d..f3a588d8eaa227ac1341ba2b1f8232b5fad445f2 100644 --- a/src/secpluginutility.cpp +++ b/src/secpluginutility.cpp @@ -90,7 +90,7 @@ SecurityExceptionPrinter& SecurityExceptionPrinter::operator<<(const char* data) { return *this; } - unsigned len = strlen(data); + unsigned int len = static_cast(strlen(data)); if (len + m_index >= m_maxLen) { len = m_maxLen - m_index; @@ -107,7 +107,7 @@ SecurityExceptionPrinter& SecurityExceptionPrinter::operator<<(std::string data) { return *this; } - unsigned len = data.size(); + unsigned int len = static_cast(data.size()); if (len + m_index >= m_maxLen) { len = m_maxLen - m_index; diff --git a/travodds-security-plugin_1.1.0.orig.tar.gz b/travodds-security-plugin_1.1.0.orig.tar.gz index 7876c888623d980203f987969a125d41e06e942d..8e321726a886f5170d7ea595cd4d3a846b2d56a5 100644 Binary files a/travodds-security-plugin_1.1.0.orig.tar.gz and b/travodds-security-plugin_1.1.0.orig.tar.gz differ