"[" << DPL::GetErrnoString(error) << "]");
}
const std::size_t fileSize = info.st_size;
+ if (0 == fileSize) {
+ LogDebug(fileName << " size is 0, so encryption is skiped");
+ return;
+ }
DPL::ScopedFClose inFile(openFile(fileName, "r"));
DPL::ScopedFClose outFile(openFile(encFile, "w"));
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]);