#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130628.1]"
+#define OSP_INSTALLER_VERSION "version=[20130629.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
if (res == true)
{
- res = __pSignatureManager->ValidatePartialReferences();
- AppLog(" ## __pSignatureManager->ValidatePartialReferences() result = [%s]", res?"true":"false");
- fprintf(stderr, " ## __pSignatureManager->ValidatePartialReferences() result = [%s]\n", res?"true":"false");
+// res = __pSignatureManager->ValidatePartialReferences();
+// AppLog(" ## __pSignatureManager->ValidatePartialReferences() result = [%s]", res?"true":"false");
+// fprintf(stderr, " ## __pSignatureManager->ValidatePartialReferences() result = [%s]\n", res?"true":"false");
}
else
{
}
else
{
- AppLog("_pSignatureManager->ValidateSignatures() does not be passed, using another validator.");
- GoNextState();
+ if (InstallerUtil::IsSignatureVerificationEnabled() == true)
+ {
+ AppLog("_pSignatureManager->ValidateSignatures() is failed.");
+ error = INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED;
+ }
+ else
+ {
+ AppLog("_pSignatureManager->ValidateSignatures() does not be passed, using another validator.");
+ GoNextState();
+ }
}
return error;
}
else if (entryName == L"data")
{
- AppLog("skip - directory[%ls]", srcEntryDir.GetPointer());
+ AppLog("skip, directory=[%ls]", srcEntryDir.GetPointer());
continue;
}
else if (entryName == L"shared")
}
else if (entryName == L"data" || entryName == L"trusted")
{
- AppLog("skip - directory[%ls]", srcEntryDir.GetPointer());
+ AppLog("skip, directory=[%ls]", srcEntryDir.GetPointer());
continue;
}
#include <FBaseErrorDefine.h>
#include <FIoFile.h>
#include <FIoDirectory.h>
+#include <FIoRegistry.h>
#include <FAppPkgPackageAppInfo.h>
#include <FAppPkgPackageInfo.h>
#include <FBase_StringConverter.h>
err = lstat(pFilePath.get(), &fileinfo);
if (err < 0)
{
- AppLog("Remove(): [%s] - %s[errno(%d)]: skip", pFilePath.get(), strerror(errno), errno);
+ AppLog("Remove(): skip, path=[%s][%s](%d)", pFilePath.get(), strerror(errno), errno);
return true;
}
res = File::IsFileExist(oldPath);
if (res == false)
{
- AppLog("CreateSymlink(): oldPath=[%ls] not found", oldPath.GetPointer());
+ AppLog("CreateSymlink(): oldPath=[%ls] not found.", oldPath.GetPointer());
+ return true;
+ }
+
+ res = File::IsFileExist(newPath);
+ if (res == true)
+ {
+ AppLog("CreateSymlink(): newPath=[%ls] is alreay exist.", oldPath.GetPointer());
return true;
}
return false;
}
+
+bool
+InstallerUtil::IsSignatureVerificationEnabled()
+{
+ result r;
+ Registry reg;
+ String section(L"feature");
+ String entry(L"signature");
+ String value;
+
+ r = reg.Construct(CONFIG_PATH, "r");
+ TryReturn(!IsFailed(r), false, "CONFIG file is not found.");
+
+ r = reg.GetValue(section, entry, value);
+ TryReturn(!IsFailed(r), false, "GetValue is failed. entry = [%ls]", entry.GetPointer());
+
+ AppLog("[%ls is %ls.]", entry.GetPointer(), value.GetPointer());
+
+ if (value == L"on")
+ {
+ return true;
+ }
+
+ return false;
+}
static bool IsCscPackage(const Tizen::App::PackageId& packageId, Tizen::Base::String& cscInfo);
static bool IsDefaultExternalStorage();
+ static bool IsSignatureVerificationEnabled();
private:
static char LogChangeHexToStr(int hex);