From: sangwan.kwon Date: Thu, 13 Apr 2017 05:16:20 +0000 (+0900) Subject: Fix visibility to hidden X-Git-Tag: submit/tizen/20170623.014003~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bddad6293dcb31e0811651f00e62a5168d9d8b94;p=platform%2Fcore%2Fsecurity%2Ftrust-anchor.git Fix visibility to hidden Change-Id: Icf005ec5d9e35adb3a7771936df5bf1ce098e674 Signed-off-by: sangwan.kwon --- diff --git a/api/tanchor/trust-anchor.hxx b/api/tanchor/trust-anchor.hxx index fe165eb..ef6e910 100644 --- a/api/tanchor/trust-anchor.hxx +++ b/api/tanchor/trust-anchor.hxx @@ -29,9 +29,12 @@ #include +#define TANCHOR_API __attribute__((visibility("default"))) + + namespace tanchor { -class TrustAnchor { +class TANCHOR_API TrustAnchor { public: explicit TrustAnchor(const std::string &packageId, const std::string &certsDir, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b8a2919..849d68c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,9 +31,8 @@ INCLUDE_DIRECTORIES(SYSTEM ${TANCHOR_INCLUDE} ADD_LIBRARY(${TARGET_TANCHOR_LIB} SHARED ${${TARGET_TANCHOR_LIB}_SRCS}) -# TODO(sangwan.kwon) visibility needed to be hidden SET_TARGET_PROPERTIES(${TARGET_TANCHOR_LIB} - PROPERTIES COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default" + PROPERTIES COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden" SOVERSION ${API_VERSION} VERSION ${LIB_VERSION} ) diff --git a/src/api.cpp b/src/api.cpp index 890af6c..45abae7 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -22,8 +22,11 @@ #include "tanchor/trust-anchor.h" #include "tanchor/trust-anchor.hxx" +#include "macros.hxx" + using namespace tanchor; +TANCHOR_API int trust_anchor_global_install(const char *package_id, const char *app_certificates_path, bool with_system_certificates) @@ -32,6 +35,7 @@ int trust_anchor_global_install(const char *package_id, return ta.install(with_system_certificates); } +TANCHOR_API int trust_anchor_usr_install(const char *package_id, const char *app_certificates_path, uid_t uid, @@ -41,6 +45,7 @@ int trust_anchor_usr_install(const char *package_id, return ta.install(with_system_certificates); } +TANCHOR_API int trust_anchor_global_launch(const char *package_id, const char *app_certificates_path, bool with_system_certificates) @@ -49,6 +54,7 @@ int trust_anchor_global_launch(const char *package_id, return ta.launch(with_system_certificates); } +TANCHOR_API int trust_anchor_usr_launch(const char *package_id, const char *app_certificates_path, uid_t uid, @@ -58,6 +64,7 @@ int trust_anchor_usr_launch(const char *package_id, return ta.launch(with_system_certificates); } +TANCHOR_API int trust_anchor_global_uninstall(const char *package_id, const char *app_certificates_path) { @@ -65,6 +72,7 @@ int trust_anchor_global_uninstall(const char *package_id, return ta.uninstall(); } +TANCHOR_API int trust_anchor_usr_uninstall(const char *package_id, const char *app_certificates_path, uid_t uid) diff --git a/src/macros.hxx b/src/macros.hxx new file mode 100644 index 0000000..cae4f25 --- /dev/null +++ b/src/macros.hxx @@ -0,0 +1,26 @@ +/* + * 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 + */ +/* + * @file macros.hxx + * @author Sangwan Kwon (sangwan.kwon@samsung.com) + * @version 0.1 + * @brief Preprocessor macros + */ +#pragma once + +#ifndef TANCHOR_API +#define TANCHOR_API __attribute__((visibility("default"))) +#endif diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3ed8e83..869a38d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -57,7 +57,9 @@ SET(CAPI_LAUNCHER_SRCS main.cpp SET(INTERNAL_SRCS main.cpp test-curl.cpp test-util.cpp - test-certificate.cpp) + test-certificate.cpp + + ${TANCHOR_SRC}/certificate.cpp) SET(TEST_INSTALLER ${TARGET_TANCHOR_TEST}-installer) SET(TEST_LAUNCHER ${TARGET_TANCHOR_TEST}-launcher)