remove _TrustZoneService class
authorKyungwooNoh <kw1004.noh@samsung.com>
Mon, 24 Jun 2013 05:42:11 +0000 (14:42 +0900)
committerKyungwooNoh <kw1004.noh@samsung.com>
Mon, 24 Jun 2013 05:42:11 +0000 (14:42 +0900)
Change-Id: I44d3c7c5e1eb5a71e32333153a5d54d2a21892c2
Signed-off-by: KyungwooNoh <kw1004.noh@samsung.com>
src/security/CMakeLists.txt
src/security/crypto/FSecCrypto_TrustZoneService.cpp [deleted file]
src/security/crypto/FSecCrypto_TrustZoneServiceMessage.cpp [deleted file]
src/security/inc/FSecCrypto_TrustZoneService.h [deleted file]
src/security/inc/FSecCrypto_TrustZoneServiceMessage.h [deleted file]

index abdbc2d..b62ccfd 100755 (executable)
@@ -37,8 +37,6 @@ SET (${this_target}_SOURCE_FILES
   crypto/FSecCryptoSkipJackCipher.cpp
   crypto/FSecCryptoRsaCipher.cpp
   crypto/FSecCryptoRsaSignature.cpp
-  crypto/FSecCrypto_TrustZoneService.cpp
-  crypto/FSecCrypto_TrustZoneServiceMessage.cpp
   pkcs/FSecPkcsAlgorithmIdentifier.cpp
   pkcs/FSecPkcs_AlgorithmIdentifierImpl.cpp
   pkcs/FSecPkcsInitialVector.cpp
diff --git a/src/security/crypto/FSecCrypto_TrustZoneService.cpp b/src/security/crypto/FSecCrypto_TrustZoneService.cpp
deleted file mode 100755 (executable)
index f0681cf..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// Copyright (c) 2013 Samsung Electronics Co., Ltd.
-//
-// 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       FSec_TrustZoneService.cpp
- * @brief      This is the implementation for the _AccessController class.
- */
-
-#include <unique_ptr.h>
-#include <FBaseSysLog.h>
-#include <FBaseString.h>
-#include <FBaseColArrayList.h>
-#include <FIoFile.h>
-#include <FIo_IpcClient.h>
-#include <FBase.h>
-#include <FIo_IpcCommonParamTraits.h>
-#include <FSecCryptoAesCipher.h>
-#include "FSecCrypto_TrustZoneService.h"
-#include "FSecCrypto_TrustZoneServiceMessage.h"
-
-
-using namespace Tizen::Io;
-using namespace Tizen::Base;
-using namespace Tizen::Security;
-
-namespace Tizen { namespace Security { namespace Crypto
-{
-
-_TrustZoneService* _TrustZoneService::__pTrustZoneService = null;
-_IpcClient* _TrustZoneService::__pIpcClient = null;
-unsigned int _TrustZoneService::__refCount = 0;
-
-_TrustZoneService::_TrustZoneService(void)
-{
-
-}
-
-_TrustZoneService::~_TrustZoneService(void)
-{
-
-}
-
-_TrustZoneService*
-_TrustZoneService::GetInstance(void)
-{
-       static pthread_once_t once_block = PTHREAD_ONCE_INIT;
-       if(!__pTrustZoneService)
-       {
-               pthread_once(&once_block, Initialize);
-       }
-
-       if(!__pIpcClient && __refCount == 0)
-       {
-               std::unique_ptr<_IpcClient> pIpcClient(new (std::nothrow) _IpcClient());
-               SysTryReturn(NID_SEC_CRYPTO, pIpcClient != null, null, E_OUT_OF_MEMORY, "The memory is insufficient.");
-
-               __pIpcClient = pIpcClient.release();
-
-               result r = __pIpcClient->Construct("osp.security.ipcserver.trustzoneservice");
-               SysTryReturn(NID_SEC_CRYPTO, r == E_SUCCESS, null, E_SYSTEM, "Failed to construct the instance of IPC.");
-       }
-       __refCount++;
-
-       return __pTrustZoneService;
-}
-
-ByteBuffer*
-_TrustZoneService::EncryptN(const ByteBuffer& appInfo, const ByteBuffer& plainBuffer)
-{
-       
-       result ret = E_SUCCESS;
-       std::unique_ptr<IPC::Message> pMessage(null);
-       ByteBuffer* pEncryptedBuffer = null;
-
-       _IpcBuffer ipcBuffer;
-       ipcBuffer.size = 0;
-       ipcBuffer.pBuffer = null;
-
-       pMessage.reset(new (std::nothrow) TrustZoneService_Encrypt(appInfo, plainBuffer, &ipcBuffer, &ret));
-       TryReturnResult(pMessage != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
-
-       result r = __pIpcClient->SendRequest(pMessage.get());
-       TryReturnResult(r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] Failed to send IPC message.");
-       TryReturnResult(ret == E_SUCCESS, null, ret, "[%s] Failed to encrypt", GetErrorMessage(ret));
-
-       byte* pBuffer = static_cast<byte*>(ipcBuffer.pBuffer);
-       TryReturnResult(pBuffer != null && ipcBuffer.size != 0, null, E_SYSTEM, "[E_SYSTEM] Failed to get encrypted data(%d).", ipcBuffer.size);
-
-       pEncryptedBuffer = new (std::nothrow) ByteBuffer();
-       TryReturnResult(pEncryptedBuffer != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
-
-       r = pEncryptedBuffer->Construct(ipcBuffer.size);
-       r = pEncryptedBuffer->SetArray(pBuffer, 0, ipcBuffer.size);
-       TryReturnResult(r == E_SUCCESS, null, r, "[%s] propagating.", r);
-       pEncryptedBuffer->Flip();
-
-       free(pBuffer); 
-
-       return pEncryptedBuffer;
-}
-
-ByteBuffer*
-_TrustZoneService::DecryptN(const ByteBuffer& appInfo, const ByteBuffer& encryptedBuffer)
-{
-       
-       result ret = E_SUCCESS;
-       std::unique_ptr<IPC::Message> pMessage(null);
-       ByteBuffer* pPlainBuffer = null;
-
-       _IpcBuffer ipcBuffer;
-       ipcBuffer.size = 0;
-       ipcBuffer.pBuffer = null;
-
-       pMessage.reset(new (std::nothrow) TrustZoneService_Decrypt(appInfo, encryptedBuffer, &ipcBuffer, &ret));
-       TryReturnResult(pMessage != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
-
-       result r = __pIpcClient->SendRequest(pMessage.get());
-       TryReturnResult(r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] Failed to send IPC message.");
-       TryReturnResult(ret == E_SUCCESS, null, ret, "[%s] Failed to Decrypt", GetErrorMessage(ret));
-
-       byte* pBuffer = static_cast<byte*>(ipcBuffer.pBuffer);
-       TryReturnResult(pBuffer != null && ipcBuffer.size != 0, null, E_SYSTEM, "[E_SYSTEM] Failed to Decrtype");
-
-       pPlainBuffer = new (std::nothrow) ByteBuffer();
-       TryReturnResult(pPlainBuffer != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
-
-       r = pPlainBuffer->Construct(ipcBuffer.size);
-       r = pPlainBuffer->SetArray(pBuffer, 0, ipcBuffer.size);
-       TryReturnResult(r == E_SUCCESS, null, r, "[%s] propagating.", r);
-       pPlainBuffer->Flip();
-
-       free(pBuffer);
-
-       return pPlainBuffer;
-}
-
-
-void
-_TrustZoneService::Initialize(void)
-{
-
-       static _TrustZoneService trustZoneService;
-       _TrustZoneService::__pTrustZoneService = &trustZoneService;
-
-}
-
-void
-_TrustZoneService::Release()
-{
-       if(--(__refCount) == 0)
-       {
-               SysLog(NID_SEC_CRYPTO, "Close IPC connection");
-               delete __pIpcClient;
-               __pIpcClient = null;
-       }
-}
-
-}}} // Tizen::Security::Crypto
diff --git a/src/security/crypto/FSecCrypto_TrustZoneServiceMessage.cpp b/src/security/crypto/FSecCrypto_TrustZoneServiceMessage.cpp
deleted file mode 100644 (file)
index f021de8..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// 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       FSec_TrustZoneService.cpp
- * @brief      This is the message type of the IPC communication of _TrustZoneService daemon.
- */
-
-#define IPC_MESSAGE_IMPL
-#include "FSecCrypto_TrustZoneServiceMessage.h"
-
-// Generate constructors.
-#include <ipc/struct_constructor_macros.h>
-#include "FSecCrypto_TrustZoneServiceMessage.h"
-// Generate destructors.
-
-#include <ipc/struct_destructor_macros.h>
-#include "FSecCrypto_TrustZoneServiceMessage.h"
-
-// Generate param traits write methods.
-#include <ipc/param_traits_write_macros.h>
-namespace IPC
-{
-#include "FSecCrypto_TrustZoneServiceMessage.h"
-}  // namespace IPC
-
-// Generate param traits read methods.
-#include <ipc/param_traits_read_macros.h>
-namespace IPC
-{
-#include "FSecCrypto_TrustZoneServiceMessage.h"
-}  // namespace IPC
diff --git a/src/security/inc/FSecCrypto_TrustZoneService.h b/src/security/inc/FSecCrypto_TrustZoneService.h
deleted file mode 100755 (executable)
index a47cfda..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// 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       FSecCrypto_TrustZoneService.h
- * @brief      This is the header file for the _TrustZoneService class.
- *
- * This file contains the declarations of _TrustZoneService.
- */
-
-#ifndef _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
-#define _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
-
-#include <FBaseResult.h>
-#include <FBaseObject.h>
-#include <FBaseString.h>
-
-namespace Tizen { namespace Io
-{
-class _IpcClient;
-} }
-
-namespace Tizen { namespace Base { namespace Runtime
-{
-class Mutex;
-} } }
-
-namespace Tizen { namespace Security { namespace Crypto
-{
-
-/**
- * @class      _TrustZoneService
- * @brief      This class is provide IPC API for TrustZone Management.
- * @since 2.1
- * /////
- * The %_TrustZoneService class is used for to provide TrustZone Management's IPC API.
- * /////
- * For more information on the class features, see <a href="../com.osp.cppappprogramming.help/html/dev_guide/security/certificate_namespace.htm">Certificates</a>.
- *
- */
-class _OSP_EXPORT_ _TrustZoneService
-{
-
-public:
-       /**
-        * Creates and intialize the instance of _TrustZoneService class.
-        *
-        * @since 2.1
-        * @return                      An error code.
-        * @exception           E_SUCCESS                                       The method is successful.
-        * @exception           E_OUT_OF_MEMORY                         The memory is insufficient.
-        * @exception           E_SYSTEM                                        A system error has occurred.
-        *                                                                                              - IPC operation failed.
-        */
-       static _TrustZoneService* GetInstance(void);
-
-       Tizen::Base::ByteBuffer* EncryptN(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& plainBuffer);
-       Tizen::Base::ByteBuffer* DecryptN(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& EncryptedBuffer);
-
-       static void Release(void);
-
-private:
-       // This default constructor is intentionally declared as private to
-       // implement the Singleton semantic.
-       _TrustZoneService(void);
-
-       // This destructor is intentionally declared as private to
-       // implement the Singleton semantic.
-       ~_TrustZoneService(void);
-
-       _TrustZoneService(const _TrustZoneService& rhs);
-
-       _TrustZoneService& operator =(const _TrustZoneService& rhs);
-
-       //This construct function initialises the _TrustZoneService instance
-       static void Construct(void);
-       static void Initialize(void);
-
-private:
-       static Tizen::Io::_IpcClient* __pIpcClient;
-       static _TrustZoneService* __pTrustZoneService;
-       static unsigned int __refCount;
-}; // _TrustZoneService
-
-
-}}} // Tizen::Security::TrustZoneService
-#endif //_FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
diff --git a/src/security/inc/FSecCrypto_TrustZoneServiceMessage.h b/src/security/inc/FSecCrypto_TrustZoneServiceMessage.h
deleted file mode 100755 (executable)
index 935fbf5..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// 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 <ipc/ipc_message_macros.h>
-#include <FIo_IpcCommonParamTraits.h>
-#include <FIo_IpcMessageStart.h>
-
-#define IPC_MESSAGE_START TrustZoneServiceStart
-
-IPC_SYNC_MESSAGE_CONTROL2_2(TrustZoneService_Encrypt, Tizen::Base::ByteBuffer, Tizen::Base::ByteBuffer, Tizen::Io::_IpcBuffer, result);
-IPC_SYNC_MESSAGE_CONTROL2_2(TrustZoneService_Decrypt, Tizen::Base::ByteBuffer, Tizen::Base::ByteBuffer, Tizen::Io::_IpcBuffer, result);
-