SET(ODE_SERVER ${PROJECT_SOURCE_DIR}/server)
SET(ODE_TOOLS ${PROJECT_SOURCE_DIR}/tools)
SET(ODE_TESTS ${PROJECT_SOURCE_DIR}/tests)
+SET(ODE_DUMMY_KSP ${PROJECT_SOURCE_DIR}/dummy-ksp)
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
SET(CXX_STD "c++0x")
ADD_SUBDIRECTORY(${ODE_SERVER})
ADD_SUBDIRECTORY(${ODE_TOOLS})
ADD_SUBDIRECTORY(${ODE_TESTS})
+ADD_SUBDIRECTORY(${ODE_DUMMY_KSP})
--- /dev/null
+#
+# Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# 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.
+#
+SET(DUMMY_PLUGIN ${KEY_STORAGE_PLUGIN})
+
+ADD_LIBRARY(${DUMMY_PLUGIN} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/main.c)
+
+TARGET_INCLUDE_DIRECTORIES(${DUMMY_PLUGIN} PRIVATE ${ODE_KEY_STORAGE_PLUGIN})
+
+SET_TARGET_PROPERTIES(${DUMMY_PLUGIN} PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
+SET_TARGET_PROPERTIES(${DUMMY_PLUGIN} PROPERTIES SOVERSION "0")
+SET_TARGET_PROPERTIES(${DUMMY_PLUGIN} PROPERTIES VERSION "1")
+
+INSTALL(TARGETS ${DUMMY_PLUGIN} DESTINATION ${KEY_STORAGE_PLUGIN_DIR} COMPONENT DevelopmentLibraries)
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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
+ */
+#include <ode-key-storage-plugin.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+static int copy(const unsigned char* in, size_t in_len,
+ unsigned char** out, size_t* out_len)
+{
+ if (in == NULL || in_len == 0 || out == NULL || out_len == NULL)
+ return ODE_KSP_ERROR_INVALID_PARAMETER;
+
+ *out = malloc(in_len * sizeof(unsigned char));
+ if (*out == NULL)
+ return ODE_KSP_ERROR_UNKNOWN;
+
+ memcpy(*out, in, in_len * sizeof(unsigned char));
+ *out_len = in_len;
+
+ return ODE_KSP_ERROR_NONE;
+}
+
+int ode_ksp_store(const unsigned char* key, size_t key_len,
+ unsigned char** token, size_t* token_len)
+{
+ return copy(key, key_len, token, token_len);
+}
+
+int ode_ksp_load(const unsigned char* token, size_t token_len,
+ unsigned char** key, size_t* key_len)
+{
+ return copy(token, token_len, key, key_len);
+}
+
+int ode_ksp_remove(const unsigned char* token, size_t token_len)
+{
+ return ODE_KSP_ERROR_NONE;
+}
%manifest ode.manifest
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/ode-engine-unit-tests
+
+## Dummy key storage plugin Package ###########################################################
+%package dummy-ksp
+Summary: Dummy key storage plugin for FOTA binary upgrade testing
+Group: Security/Testing
+
+%description dummy-ksp
+The ode-dummy-ksp package includes the dummy key storage plugin that can be used
+for testing the binary upgrade process (FOTA). The plugin will be used by ode to
+store the master encryption key in a file to use during FOTA process.
+
+%files dummy-ksp
+%manifest ode.manifest
+%attr(755,root,root) %{key_storage_plugin_dir}/*