Add privileges to APIs 90/113190/2
authorSungbae Yoo <sungbae.yoo@samsung.com>
Mon, 6 Feb 2017 08:23:33 +0000 (17:23 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Tue, 7 Feb 2017 04:41:30 +0000 (13:41 +0900)
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Change-Id: Iddbef3d16fd277ba6c4d5ea68298931ab7eff968

server/external-encryption.cpp
server/internal-encryption.cpp
server/secure-erase.cpp

index bcca38c..85233e9 100644 (file)
@@ -44,6 +44,8 @@
 #define EXTERNAL_OPTION_ONLY_NEW_FILE_VCONF_KEY VCONFKEY_SDE_ENCRYPT_NEWFILE
 #define EXTERNAL_OPTION_EXCEPT_FOR_MEDIA_FILE_VCONF_KEY VCONFKEY_SDE_EXCLUDE_MEDIAFILE
 
+#define PRIVILEGE_PLATFORM "http://tizen.org/privilege/internal/default/platform"
+
 namespace ode {
 
 namespace {
@@ -160,15 +162,15 @@ void setOptions(unsigned int options)
 ExternalEncryption::ExternalEncryption(ODEControlContext &ctx) :
        context(ctx)
 {
-       context.expose(this, "", (int)(ExternalEncryption::mount)(std::string));
-       context.expose(this, "", (int)(ExternalEncryption::umount)());
-       context.expose(this, "", (int)(ExternalEncryption::encrypt)(std::string, unsigned int));
-       context.expose(this, "", (int)(ExternalEncryption::decrypt)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(ExternalEncryption::mount)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(ExternalEncryption::umount)());
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(ExternalEncryption::encrypt)(std::string, unsigned int));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(ExternalEncryption::decrypt)(std::string));
        context.expose(this, "", (int)(ExternalEncryption::isPasswordInitialized)());
-       context.expose(this, "", (int)(ExternalEncryption::initPassword)(std::string));
-       context.expose(this, "", (int)(ExternalEncryption::cleanPassword)(std::string));
-       context.expose(this, "", (int)(ExternalEncryption::changePassword)(std::string, std::string));
-       context.expose(this, "", (int)(ExternalEncryption::verifyPassword)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(ExternalEncryption::initPassword)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(ExternalEncryption::cleanPassword)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(ExternalEncryption::changePassword)(std::string, std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(ExternalEncryption::verifyPassword)(std::string));
        context.expose(this, "", (int)(ExternalEncryption::getState)());
        context.expose(this, "", (unsigned int)(ExternalEncryption::getSupportedOptions)());
 
index e0439d1..70ade69 100644 (file)
@@ -36,6 +36,8 @@
 #define INTERNAL_STATE_VCONF_KEY VCONFKEY_ODE_CRYPTO_STATE
 #define INTERNAL_OPTION_ONLY_USED_REGION_VCONF_KEY VCONFKEY_ODE_FAST_ENCRYPTION
 
+#define PRIVILEGE_PLATFORM "http://tizen.org/privilege/internal/default/platform"
+
 namespace ode {
 
 namespace {
@@ -116,15 +118,15 @@ void setOptions(unsigned int options)
 InternalEncryption::InternalEncryption(ODEControlContext& ctx) :
        context(ctx)
 {
-       context.expose(this, "", (int)(InternalEncryption::mount)(std::string));
-       context.expose(this, "", (int)(InternalEncryption::umount)());
-       context.expose(this, "", (int)(InternalEncryption::encrypt)(std::string, unsigned int));
-       context.expose(this, "", (int)(InternalEncryption::decrypt)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryption::mount)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryption::umount)());
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryption::encrypt)(std::string, unsigned int));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryption::decrypt)(std::string));
        context.expose(this, "", (int)(InternalEncryption::isPasswordInitialized)());
-       context.expose(this, "", (int)(InternalEncryption::initPassword)(std::string));
-       context.expose(this, "", (int)(InternalEncryption::cleanPassword)(std::string));
-       context.expose(this, "", (int)(InternalEncryption::changePassword)(std::string, std::string));
-       context.expose(this, "", (int)(InternalEncryption::verifyPassword)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryption::initPassword)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryption::cleanPassword)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryption::changePassword)(std::string, std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryption::verifyPassword)(std::string));
        context.expose(this, "", (int)(InternalEncryption::getState)());
        context.expose(this, "", (unsigned int)(InternalEncryption::getSupportedOptions)());
 }
index 368c62e..47eca6b 100644 (file)
@@ -31,6 +31,8 @@
 #include "block-device.h"
 #include "ext4-tool.h"
 
+#define PRIVILEGE_PLATFORM "http://tizen.org/privilege/internal/default/platform"
+
 namespace ode {
 
 namespace {
@@ -70,8 +72,8 @@ static int getTotalFileCount(const std::string &name)
 SecureErase::SecureErase(ODEControlContext &ctx) :
        context(ctx), devicePath("")
 {
-       context.expose(this, "", (int)(SecureErase::erase)(std::string));
-       context.expose(this, "", (int)(SecureErase::clean)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(SecureErase::erase)(std::string));
+       context.expose(this, PRIVILEGE_PLATFORM, (int)(SecureErase::clean)(std::string));
 }
 
 SecureErase::~SecureErase()