Add deprecated attributes and logs 77/82577/6
authorKyungwook Tak <k.tak@samsung.com>
Thu, 4 Aug 2016 08:47:03 +0000 (17:47 +0900)
committerkyungwook tak <k.tak@samsung.com>
Mon, 22 Aug 2016 02:14:46 +0000 (19:14 -0700)
Change-Id: I511f7dc4fc711f433ef23448badf468c8169afef
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
src/CMakeLists.txt
src/include/ckmc/ckmc-control.h
src/include/ckmc/ckmc-manager.h
src/include/ckmc/ckmc-type.h
src/manager/client-capi/ckmc-control.cpp
src/manager/client-capi/ckmc-manager.cpp
src/manager/client-capi/ckmc-type.cpp

index 23a55e2..081b265 100644 (file)
@@ -158,7 +158,7 @@ ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
 SET_TARGET_PROPERTIES(
     ${TARGET_KEY_MANAGER_CLIENT}
     PROPERTIES
-        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
+        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden -Wno-deprecated-declarations"
         SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
         VERSION ${KEY_MANAGER_CLIENT_VERSION}
     )
@@ -196,7 +196,7 @@ ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CL
 SET_TARGET_PROPERTIES(
     ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
     PROPERTIES
-        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
+        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden  -Wno-deprecated-declarations"
         SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
         VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
     )
index dc7670f..cec7569 100644 (file)
@@ -24,6 +24,7 @@
 
 
 #include <sys/types.h>
+#include <tizen.h>
 #include <ckmc/ckmc-error.h>
 #include <ckmc/ckmc-type.h>
 
@@ -206,7 +207,8 @@ int ckmc_allow_access_by_adm(uid_t user,
                                                         const char *owner,
                                                         const char *alias,
                                                         const char *accessor,
-                                                        ckmc_access_right_e granted);
+                                                        ckmc_access_right_e granted)
+TIZEN_DEPRECATED_API;
 
 /**
  * @brief Allows another application to access client's application data
@@ -216,7 +218,7 @@ int ckmc_allow_access_by_adm(uid_t user,
  * @privilege %http://tizen.org/privilege/keymanager.admin
  *
  * @remarks Data identified by @a alias should exist
- * @remarks @a alias must contain owner label (<owner label><ckmc_label_name_separator><name>)
+ * @remarks @a alias must contain owner label (<owner label><ckmc_owner_id_separator><name>)
  *
  * @param[in] user        User ID of a user whose data will be affected
  * @param[in] alias       Data alias for which access will be granted
@@ -274,7 +276,8 @@ int ckmc_set_permission_by_adm(uid_t user, const char *alias,
  * @see ckmc_set_permission_by_adm()
  */
 int ckmc_deny_access_by_adm(uid_t user, const char *owner, const char *alias,
-                                                       const char *accessor);
+                                                       const char *accessor)
+TIZEN_DEPRECATED_API;
 
 /**
  * @}
index c35fdb6..41f5414 100644 (file)
@@ -114,7 +114,8 @@ int ckmc_save_key(const char *alias, const ckmc_key_s key,
  * @see ckmc_get_key()
  * @see ckmc_get_key_alias_list()
  */
-int ckmc_remove_key(const char *alias);
+int ckmc_remove_key(const char *alias)
+TIZEN_DEPRECATED_API;
 
 /**
  * @brief Gets a key from key manager.
@@ -257,7 +258,8 @@ int ckmc_save_cert(const char *alias, const ckmc_cert_s cert,
  * @see ckmc_get_cert()
  * @see ckmc_get_cert_alias_list()
  */
-int ckmc_remove_cert(const char *alias);
+int ckmc_remove_cert(const char *alias)
+TIZEN_DEPRECATED_API;
 
 /**
  * @brief Gets a certificate from key manager.
@@ -475,7 +477,8 @@ int ckmc_save_data(const char *alias, ckmc_raw_buffer_s data,
  * @see ckmc_get_data()
  * @see ckmc_get_data_alias_list()
  */
-int ckmc_remove_data(const char *alias);
+int ckmc_remove_data(const char *alias)
+TIZEN_DEPRECATED_API;
 
 /**
  * @brief Gets a data from key manager.
@@ -895,7 +898,8 @@ int ckmc_get_cert_chain(const ckmc_cert_s *cert,
  */
 int ckmc_get_cert_chain_with_alias(const ckmc_cert_s *cert,
                                                                   const ckmc_alias_list_s *untrustedcerts,
-                                                                  ckmc_cert_list_s **ppcert_chain_list);
+                                                                  ckmc_cert_list_s **ppcert_chain_list)
+TIZEN_DEPRECATED_API;
 
 /**
  * @brief Verifies a certificate chain and returns that chain using user entered trusted and
@@ -1002,7 +1006,8 @@ int ckmc_ocsp_check(const ckmc_cert_list_s *pcert_chain_list,
  * @see ckmc_deny_access()
  */
 int ckmc_allow_access(const char *alias, const char *accessor,
-                                         ckmc_access_right_e granted);
+                                         ckmc_access_right_e granted)
+TIZEN_DEPRECATED_API;
 
 /**
  * @brief Allows another application to access client's application data.
@@ -1064,7 +1069,8 @@ int ckmc_set_permission(const char *alias, const char *accessor,
  * @see ckmc_allow_access()
  * @see ckmc_set_permission()
  */
-int ckmc_deny_access(const char *alias, const char *accessor);
+int ckmc_deny_access(const char *alias, const char *accessor)
+TIZEN_DEPRECATED_API;
 
 /**
  * @brief Removes a an entry (no matter of type) from the key manager.
index 49c3446..913d4a9 100644 (file)
@@ -577,7 +577,8 @@ int ckmc_pkcs12_new(ckmc_key_s *private_key,
 int ckmc_load_from_pkcs12_file(const char *file_path,
                                                           const char *passphrase,
                                                           ckmc_key_s **private_key, ckmc_cert_s **cert,
-                                                          ckmc_cert_list_s **ca_cert_list);
+                                                          ckmc_cert_list_s **ca_cert_list)
+TIZEN_DEPRECATED_API;
 
 /**
  * @brief Creates a new @a ckmc_pkcs12_s handle from a given PKCS#12 file and returns it.
index bd7a7d1..ff3d603 100644 (file)
  *  limitations under the License
  *
  *
- * @file        ckmc-control.h
+ * @file        ckmc-control.cpp
  * @author      Yuseok Jeon(yuseok.jeon@samsung.com)
  * @version     1.0
- * @brief       provides conversion methods to C from C++ for key-manager control functions.
+ * @brief       Wrap C++ functions to provide C APIs
  */
 
+#include <dpl/log/log.h>
 #include <ckm/ckm-control.h>
 #include <ckmc/ckmc-control.h>
 #include <ckmc/ckmc-error.h>
@@ -82,6 +83,9 @@ KEY_MANAGER_CAPI
 int ckmc_allow_access_by_adm(uid_t user, const char *owner, const char *alias,
                                                         const char *accessor, ckmc_access_right_e granted)
 {
+       LogWarning("DEPRECATION WARNING: " << __func__ << "() is deprecated and will be "
+                          "removed from next release. Use ckmc_set_permission_by_adm() instead.");
+
        if (!owner || !alias)
                return CKMC_ERROR_INVALID_PARAMETER;
 
@@ -113,6 +117,9 @@ KEY_MANAGER_CAPI
 int ckmc_deny_access_by_adm(uid_t user, const char *owner, const char *alias,
                                                        const char *accessor)
 {
+       LogWarning("DEPRECATION WARNING: " << __func__ << "() is deprecated and will be "
+                          "removed from next release. Use ckmc_set_permission_by_adm() instead.");
+
        if (!owner || !alias)
                return CKMC_ERROR_INVALID_PARAMETER;
 
index 1cc412b..53a183e 100644 (file)
  *  limitations under the License
  *
  *
- * @file        ckmc-control.h
+ * @file        ckmc-manager.cpp
  * @author      Yuseok Jeon(yuseok.jeon@samsung.com)
  * @version     1.0
- * @brief       provides conversion methods to C from C++ for key-manager control functions.
+ * @brief       Wrap C++ functions to provide C APIs
  */
 
 #include <dpl/log/log.h>
@@ -202,6 +202,8 @@ int ckmc_save_key(const char *alias, const ckmc_key_s key,
 KEY_MANAGER_CAPI
 int ckmc_remove_key(const char *alias)
 {
+       LogWarning("DEPRECATION WARNING: " << __func__ << "() is deprecated and will be "
+                          "removed from next release. Use ckmc_remove_alias() instead.");
        return ckmc_remove_alias(alias);
 }
 
@@ -299,6 +301,8 @@ int ckmc_save_cert(const char *alias, const ckmc_cert_s cert,
 KEY_MANAGER_CAPI
 int ckmc_remove_cert(const char *alias)
 {
+       LogWarning("DEPRECATION WARNING: " << __func__ << "() is deprecated and will be "
+                          "removed from next release. Use ckmc_remove_alias() instead.");
        return ckmc_remove_alias(alias);
 }
 
@@ -475,6 +479,8 @@ int ckmc_save_data(const char *alias, ckmc_raw_buffer_s data,
 KEY_MANAGER_CAPI
 int ckmc_remove_data(const char *alias)
 {
+       LogWarning("DEPRECATION WARNING: " << __func__ << "() is deprecated and will be "
+                          "removed from next release. Use ckmc_remove_alias() instead.");
        return ckmc_remove_alias(alias);
 }
 
@@ -824,6 +830,9 @@ int ckmc_allow_access(const char *alias, const char *accessor,
 {
        EXCEPTION_GUARD_START_CAPI
 
+       LogWarning("DEPRECATION WARNING: " << __func__ << "() is deprecated and will be "
+                          "removed from next release. Use ckmc_set_permission() instead.");
+
        int permissionMask;
        int ret = access_to_permission_mask(granted, permissionMask);
 
@@ -855,6 +864,9 @@ int ckmc_deny_access(const char *alias, const char *accessor)
 {
        EXCEPTION_GUARD_START_CAPI
 
+       LogWarning("DEPRECATION WARNING: " << __func__ << "() is deprecated and will be "
+                          "removed from next release. Use ckmc_set_permission() instead.");
+
        if (!alias || !accessor)
                return CKMC_ERROR_INVALID_PARAMETER;
 
index e6e020f..a80b8b2 100644 (file)
@@ -35,6 +35,7 @@
 #include <openssl/pem.h>
 #include <fstream>
 #include <crypto-init.h>
+#include <dpl/log/log.h>
 
 namespace {
 
@@ -460,6 +461,9 @@ int ckmc_load_from_pkcs12_file(const char *file_path, const char *passphrase,
                }
        };
 
+       LogWarning("DEPRECATION WARNING: " << __func__ << "() is deprecated and will be "
+                          "removed from next release. Use ckmc_pkcs12_load() instead.");
+
        CKM::initOpenSslOnce();
 
        int ret = CKMC_ERROR_NONE;