Remove dead code related to downloadable TA
[platform/core/security/tef-simulator.git] / simulatordaemon / src / TABinaryManager / TABinaryManager.cpp
index f0cae26..4561b2e 100644 (file)
@@ -25,6 +25,7 @@
  *  Include files
  *-----------------------------------------------------------------------------*/
 #include "TABinaryManager.h"
+#include "Config.h"
 #include <iostream>
 #include <fstream>
 #include <stdio.h>
@@ -155,10 +156,10 @@ TABinaryManager* TABinaryManager::getInstance() {
 }
 
 /**
- * This function add TA at given path to BinaryManager if it exists.
+ * This function add TA to BinaryManager if it exists.
  * @return On successful completion of above operations returns true else false.
  */
-bool TABinaryManager::initTAatPath(const string &path, const string &uuid) {
+bool TABinaryManager::initTA(const string &uuid) {
        LOGD(SIM_DAEMON, "Entry");
 
        pthread_rwlock_wrlock(&binaryMapLock);
@@ -166,10 +167,10 @@ bool TABinaryManager::initTAatPath(const string &path, const string &uuid) {
        bool res = false;
        StructBinaryInfo info;
 
-       if (boost::filesystem::exists(path + uuid)) {
+       if (boost::filesystem::exists(TA_STORE_PATH + uuid)) {
                pthread_mutex_lock(&taLock);
                try {
-                       if (unpackBinary(uuid, path, info)) {
+                       if (unpackBinary(uuid, info)) {
                                binaryMap[uuid] = info;
                                res = true;
                        }
@@ -244,15 +245,14 @@ void TABinaryManager::decryptImage(StructBinaryInfo& info) {
  * It is very important to check for return value from this function.
  */
 
-bool TABinaryManager::unpackBinary(const string &uuid, const string &path, StructBinaryInfo& info) {
+bool TABinaryManager::unpackBinary(const string &uuid, StructBinaryInfo& info) {
        TAUnpack* unpacker = TAUnpack::getInstance();
        bool ret = false;
-       LOGD(SIM_DAEMON, "Unpacking TA %s in %s", uuid.c_str(), path.c_str());
-       if (0 == unpacker->unpackTA(path, uuid)) {
+       if (0 == unpacker->unpackTA(string(TA_STORE_PATH), uuid)) {
                LOGD(SIM_DAEMON, "Unpacked, filling info");
                // 1. Set binary info
-               info.path = path + uuid;
-               info.extractpath = path + uuid + "-ext/";
+               info.path = string(TA_STORE_PATH)+ uuid;
+               info.extractpath = string(TA_STORE_PATH) + uuid + "-ext/";
                info.imagePath = info.extractpath + uuid + ".image";
                info.manifestPath = info.extractpath + uuid + ".manifest";
                // 2. Parse manifest and store results