projects
/
framework
/
web
/
wrt-installer.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Release] wrt-installer_0.1.38
[framework/web/wrt-installer.git]
/
src
/
jobs
/
widget_install
/
task_encrypt_resource.cpp
diff --git
a/src/jobs/widget_install/task_encrypt_resource.cpp
b/src/jobs/widget_install/task_encrypt_resource.cpp
index
ee55ea5
..
647817e
100644
(file)
--- a/
src/jobs/widget_install/task_encrypt_resource.cpp
+++ b/
src/jobs/widget_install/task_encrypt_resource.cpp
@@
-193,11
+193,13
@@
Tizen::Base::ByteBuffer* EncryptChunkByTrustZone(
ByteBuffer pBuf;
pBuf.Construct(pBufSize);
const byte *pByte = reinterpret_cast<const byte*>(plainBuffer);
ByteBuffer pBuf;
pBuf.Construct(pBufSize);
const byte *pByte = reinterpret_cast<const byte*>(plainBuffer);
- pBuf.SetArray(pByte, 0, pBufSize);
+ if (pBuf.SetArray(pByte, 0, pBufSize) != E_SUCCESS) {
+ LogDebug("Couldnot set pBuf");
+ return NULL;
+ }
pBuf.Flip();
pBuf.Flip();
- ByteBuffer* getBuffer = pInstance->_TrustZoneService::EncryptN(*appInfo, pBuf);
- return getBuffer;
+ return pInstance->_TrustZoneService::EncryptN(*appInfo, pBuf);
}
Tizen::Base::ByteBuffer* TEST_dec(
}
Tizen::Base::ByteBuffer* TEST_dec(
@@
-213,12
+215,13
@@
Tizen::Base::ByteBuffer* TEST_dec(
ByteBuffer pBuf;
pBuf.Construct(pBufSize);
const byte *pByte = reinterpret_cast<const byte*>(plainBuffer);
ByteBuffer pBuf;
pBuf.Construct(pBufSize);
const byte *pByte = reinterpret_cast<const byte*>(plainBuffer);
- pBuf.SetArray(pByte, 0, pBufSize);
+ if (pBuf.SetArray(pByte, 0, pBufSize) != E_SUCCESS) {
+ LogDebug("Couldnot set pBuf");
+ return NULL;
+ }
pBuf.Flip();
pBuf.Flip();
- ByteBuffer* getBufferTEST =
- pInstance->_TrustZoneService::DecryptN(*appInfo, pBuf);
- return getBufferTEST;
+ return pInstance->_TrustZoneService::DecryptN(*appInfo, pBuf);
}
}
}
}
@@
-329,7
+332,12
@@
void TaskEncryptResource::EncryptFile(const std::string &fileName)
pkgid.c_str());
ByteBuffer appInfo;
appInfo.Construct(pkgid.length());
pkgid.c_str());
ByteBuffer appInfo;
appInfo.Construct(pkgid.length());
- appInfo.SetArray(b_pkgid, 0, pkgid.length());
+
+ if (appInfo.SetArray(b_pkgid, 0, pkgid.length()) != E_SUCCESS) {
+ LogDebug("Couldnot set appInfo");
+ return;
+ }
+
appInfo.Flip();
do
appInfo.Flip();
do
@@
-339,6
+347,10
@@
void TaskEncryptResource::EncryptFile(const std::string &fileName)
ByteBuffer *getBuffer = EncryptChunkByTrustZone(
&appInfo,
inChunk.get(), bytesRead);
ByteBuffer *getBuffer = EncryptChunkByTrustZone(
&appInfo,
inChunk.get(), bytesRead);
+ if (getBuffer == NULL) {
+ ThrowMsg(Exceptions::EncryptionFailed,
+ "Encryption Failed using TrustZone");
+ }
int decBufSize = getBuffer->GetRemaining();
outChunk.reset(new unsigned char[decBufSize]);
int decBufSize = getBuffer->GetRemaining();
outChunk.reset(new unsigned char[decBufSize]);