%license LICENSE
%{_bindir}/device-certificate-managerd
%{_libdir}/libdevice-certificate-manager.so.*
+%{_libdir}/libdevice-certificate-manager-ext.so.*
%{_unitdir}/device-certificate-manager.service
%{_unitdir}/sockets.target.wants/device-certificate-manager.socket
%{_unitdir}/device-certificate-manager.socket
%files ext-devel
%manifest %{name}.manifest
%license LICENSE
+%{_libdir}/libdevice-certificate-manager-ext.so
%{_includedir}/device-certificate-manager/device_certificate_manager_ext.h
%{_includedir}/device-certificate-manager/device_certificate_manager_ext_types.h
+%{_libdir}/pkgconfig/device-certificate-manager-ext.pc
%files backend-devel
%manifest %{name}.manifest
-# Copyright (c) 2019 - 2020 Samsung Electronics Co., Ltd All Rights Reserved
+# Copyright (c) 2019 - 2021 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.
#
CONFIGURE_FILE(device-certificate-manager.pc.in device-certificate-manager.pc @ONLY)
+CONFIGURE_FILE(device-certificate-manager-ext.pc.in device-certificate-manager-ext.pc @ONLY)
CONFIGURE_FILE(device-certificate-manager-backend.pc.in device-certificate-manager-backend.pc @ONLY)
INSTALL(FILES
${CMAKE_CURRENT_BINARY_DIR}/device-certificate-manager.pc
+ ${CMAKE_CURRENT_BINARY_DIR}/device-certificate-manager-ext.pc
${CMAKE_CURRENT_BINARY_DIR}/device-certificate-manager-backend.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
--- /dev/null
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=${prefix}/include
+
+Name: device-certificate-manager-ext
+Description: Device Certificate Manager Extension Package
+Version: @PROJECT_VERSION@
+Libs: -L${libdir} -ldevice-certificate-manager-ext
+Cflags: -I${includedir}/device-certificate-manager
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS dcm_support.proto)
SET(TARGET_CLIENT "device-certificate-manager")
+SET(TARGET_CLIENT_EXT "device-certificate-manager-ext")
+
ADD_LIBRARY(${TARGET_CLIENT}
SHARED
dcm_client.cpp
${PROTO_SRCS}
${PROTO_HDRS})
+ADD_LIBRARY(${TARGET_CLIENT_EXT}
+ SHARED
+ device_certificate_manager_ext.cpp
+ ../shared/log.cpp
+ )
+
TARGET_LINK_LIBRARIES(${TARGET_CLIENT}
${Boost_SYSTEM_LIBRARY}
${PROTOBUF_LITE_LIBRARIES}
${CLIENT_DEPS_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
+TARGET_LINK_LIBRARIES(${TARGET_CLIENT_EXT}
+ ${Boost_SYSTEM_LIBRARY}
+ ${CLIENT_DEPS_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT})
+
SET_PROPERTY(TARGET ${TARGET_CLIENT} APPEND PROPERTY LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/version_script.lds")
+SET_PROPERTY(TARGET ${TARGET_CLIENT_EXT} APPEND PROPERTY LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/version_script_ext.lds")
+
SET_TARGET_PROPERTIES(${TARGET_CLIENT}
PROPERTIES
VERSION ${PROJECT_VERSION}
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden)
-INSTALL(TARGETS ${TARGET_CLIENT}
+SET_TARGET_PROPERTIES(${TARGET_CLIENT_EXT}
+ PROPERTIES
+ VERSION ${PROJECT_VERSION}
+ DEFINE_SYMBOL DEVICE_CERTIFICATE_MANAGER_EXT_EXPORT
+ VISIBILITY_INLINES_HIDDEN TRUE
+ C_VISIBILITY_PRESET hidden
+ CXX_VISIBILITY_PRESET hidden)
+
+INSTALL(TARGETS ${TARGET_CLIENT} ${TARGET_CLIENT_EXT}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(FILES
--- /dev/null
+/******************************************************************
+ *
+ * Copyright 2021 Samsung Electronics 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 "device_certificate_manager_ext.h"
+#include "log.h"
+
+#ifndef API_DEVICE_CERTIFICATE_MANAGER_EXT_EXPORT
+#define API_DEVICE_CERTIFICATE_MANAGER_EXT_EXPORT __attribute__((visibility("default")))
+#endif
+
+API_DEVICE_CERTIFICATE_MANAGER_EXT_EXPORT
+int dcm_ext_call_api(const char* method_name, const char* input_data, size_t input_len,
+ char** output_data, size_t* output_len)
+{
+ (void) method_name;
+ (void) input_data;
+ (void) input_len;
+ (void) output_data;
+ (void) output_len;
+ LOGE("No implementation yet - TODO");
+ return DCM_EXT_ERROR_UNKNOWN;
+}
--- /dev/null
+DCMEXTCLIENT_1.0 {
+ global:
+ dcm_ext_call_api;
+ local:
+ *;
+};