-wrt-commons (0.2.103ubuntu1) oneiric; urgency=low
++wrt-commons (0.2.104) oneiric; urgency=low
+
+ * Revert "Add encrypt/decrypt API from trust zone"
+
+ -- Soyoung Kim <sy037.kim@samsung.com> Mon, 11 Mar 2013 19:46:44 +0900
+
wrt-commons (0.2.103) unstable; urgency=low
* Update tizen version to 2.1
AES_cbc_encrypt(inBuf, decBuf, inBufSize, &m_decKey, ivec, AES_DECRYPT);
LogDebug("Success decryption");
}
- int ResourceDecryptor::DecryptChunkByTrustZone(
- std::string pkgid, const unsigned char* inBuffer,
- int inBufSize)
- {
- using namespace Tizen::Base;
-
- const byte *b_pkgid = reinterpret_cast<const byte*>(pkgid.c_str());
- ByteBuffer appInfo;
- appInfo.Construct(pkgid.length());
- appInfo.SetArray(b_pkgid, 0, pkgid.length());
- appInfo.Flip();
-
- Tizen::Security::Crypto::_TrustZoneService* pInstance;
- pInstance = Tizen::Security::Crypto::_TrustZoneService::GetInstance();
-
- ByteBuffer pBuf;
- pBuf.Construct(inBufSize);
- const byte *pByte = reinterpret_cast<const byte*>(inBuffer);
- pBuf.SetArray(pByte, 0, inBufSize);
- pBuf.Flip();
-
- ByteBuffer *getBuffer = pInstance->_TrustZoneService::DecryptN(appInfo, pBuf);
-
- m_getBuffer = reinterpret_cast<void*>(getBuffer);
- return getBuffer->GetRemaining();
- }
-
- void ResourceDecryptor::getDecryptStringByTrustZone(unsigned char *decBuffer)
- {
- using namespace Tizen::Base;
- LogDebug("Get decrypted string");
- ByteBuffer *buffer = reinterpret_cast<ByteBuffer*>(m_getBuffer);
- memcpy(decBuffer, buffer->GetPointer(), buffer->GetRemaining());
- buffer->Reset();
- }
-
+
} //namespace WRTDecryptor
#define KEY_SIZE 16
}
namespace WRTEncryptor {
- ResourceEncryptor::ResourceEncryptor() :
- m_getBuffer(NULL)
-ResourceEncryptor::ResourceEncryptor()
++ResourceEncryptor::ResourceEncryptor()
{
LogDebug("Started Encrytion");
}
AES_cbc_encrypt(inputBuf, encBuf, chunkSize, &m_encKey, ivec, AES_ENCRYPT);
}
- int ResourceEncryptor::EncryptChunkByTrustZone(
- std::string pkgid,
- const unsigned char *plainBuffer,
- int pBufSize)
- {
- using namespace Tizen::Base;
-
- const byte *b_pkgid = reinterpret_cast<const byte*>(pkgid.c_str());
- ByteBuffer appInfo;
- appInfo.Construct(pkgid.length());
- appInfo.SetArray(b_pkgid, 0, pkgid.length());
- appInfo.Flip();
-
- Tizen::Security::Crypto::_TrustZoneService* pInstance;
- pInstance = Tizen::Security::Crypto::_TrustZoneService::GetInstance();
-
- ByteBuffer pBuf;
- pBuf.Construct(pBufSize);
- const byte *pByte = reinterpret_cast<const byte*>(plainBuffer);
- pBuf.SetArray(pByte, 0, pBufSize);
- pBuf.Flip();
-
- ByteBuffer *getBuffer =
- pInstance->_TrustZoneService::EncryptN(appInfo, pBuf);
- m_getBuffer = reinterpret_cast<void*>(getBuffer);
-
- return getBuffer->GetRemaining();
- }
-
- void ResourceEncryptor::getEncStringByTrustZone(unsigned char *encBuffer)
- {
- using namespace Tizen::Base;
- LogDebug("Get encrypted String");
- ByteBuffer *buffer = reinterpret_cast<ByteBuffer*>(m_getBuffer);
- memcpy(encBuffer, buffer->GetPointer(), buffer->GetRemaining());
- buffer->Reset();
- }
+
} //namespace ResourceEnc