Merge "Fix crash of osp-security-service" into tizen_2.1
authorhb.min <hb.min@samsung.com>
Mon, 1 Apr 2013 08:48:55 +0000 (17:48 +0900)
committerGerrit Code Review <gerrit2@kim11>
Mon, 1 Apr 2013 08:48:55 +0000 (17:48 +0900)
inc/CertificateServiceStub.h [changed mode: 0644->0755]
src/CertificateServiceStub.cpp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 2d2a5a3..32d6892
@@ -86,7 +86,7 @@ public:
 
        bool OnInsertCertificateChainWithPrivateKey(Tizen::Io::_IpcBuffer certChainPrivateKeyBufferIpc, int certChainPrivateKeyLength, result* pRet);
 
-       bool OnInstallPkcs12Content(Tizen::Io::_IpcBuffer pkcs12FilePath, Tizen::Io::_IpcBuffer pkcs12ImportPassword, result* pRet);
+       bool OnInstallPkcs12Content(Tizen::Io::_IpcBuffer pkcs12FilePath, Tizen::Io::_IpcBuffer pkcs12ImportPassword, bool checkPrivilege, result* pRet);
 
        bool OnDeleteUserCertChainByCertId(int certID, result* pRet);
 
old mode 100644 (file)
new mode 100755 (executable)
index 9b3aa9f..c322b8f
@@ -205,12 +205,15 @@ _CertServiceStub::OnInsertCertificateChainWithPrivateKey(Tizen::Io::_IpcBuffer c
 }
 
 bool
-_CertServiceStub::OnInstallPkcs12Content(Tizen::Io::_IpcBuffer pkcs12FilePath, Tizen::Io::_IpcBuffer pkcs12ImportPassword, result* pRet)
+_CertServiceStub::OnInstallPkcs12Content(Tizen::Io::_IpcBuffer pkcs12FilePath, Tizen::Io::_IpcBuffer pkcs12ImportPassword, bool checkPrivilege, result* pRet)
 {
        result r = E_SUCCESS;
 
-       *pRet = _AccessController::CheckSystemPrivilege(__pIpcServer->GetClientAppId(), _PRV_CERTIFICATE_WRITE);
-       TryCatchResult(!IsFailed(*pRet), *pRet = E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       if(checkPrivilege == true)
+       {
+               *pRet = _AccessController::CheckSystemPrivilege(__pIpcServer->GetClientAppId(), _PRV_CERTIFICATE_WRITE);
+               TryCatchResult(!IsFailed(*pRet), *pRet = E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       }
 
        *pRet = _CertServer::InsertPkcs12Content(static_cast< char* >(pkcs12FilePath.pBuffer), static_cast< char* >(pkcs12ImportPassword.pBuffer));