String* pDistValue = static_cast< String* >(pDistributorRefMap->GetValue(*pAuthorKey));
TryReturn(pDistValue, false, "pDistValue is null, failed to compare.");
- AppLog("\n >> pAuthorValue=[%ls]", pAuthorValue->GetPointer());
- AppLog("\n >> pDistValue=[%ls]", pDistValue->GetPointer());
+ AppLog("pAuthorValue=[%ls]", pAuthorValue->GetPointer());
+ AppLog("pDistValue=[%ls]", pDistValue->GetPointer());
if (*pAuthorValue != *pDistValue)
{
TryReturn(0, false, "Digest value does not be matched.");
String filePath = __pContext->__rootPath + L"/" + *pAuthorKey;
String fileDigest;
- AppLog("\n >> filePath=[%ls]", filePath.GetPointer());
+ AppLog("filePath=[%ls]", filePath.GetPointer());
res = InstallerUtil::GetFileDigest(filePath, fileDigest);
TryReturn(res == true, false, "GetFileDigest() is failed.");
- AppLog("\n >> fileDigest=[%ls]", fileDigest.GetPointer());
+ AppLog("fileDigest=[%ls]", fileDigest.GetPointer());
if (*pAuthorValue != fileDigest)
{
TryReturn(0, false, "Digest value does not be matched.");
TryReturn(__pContext, false, "__pContext is null");
- if (__pContext->__isVerificationMode == false)
- {
- AppLog("VerificationMode is off.");
- return true;
- }
+// if (__pContext->__isVerificationMode == false)
+// {
+// AppLog("VerificationMode is off.");
+// return true;
+// }
int res = 0;
String label = packageId;
}
else if (dirPath.Contains(L"shared/trusted") == true)
{
- Sha1Hash hash;
- String base64Value;
- result r = E_SUCCESS;
+ if (__pContext->__isVerificationMode == true)
+ {
+ Sha1Hash hash;
+ String base64Value;
+ result r = E_SUCCESS;
- IListT<String *>* pAuthorCertList = __pContext->__pAuthorCertList;
- TryReturn(pAuthorCertList, false, "pAuthorCertList is null.");
+ IListT<String *>* pAuthorCertList = __pContext->__pAuthorCertList;
+ TryReturn(pAuthorCertList, false, "pAuthorCertList is null.");
- String *pEntity = null;
- r = pAuthorCertList->GetAt(0, pEntity);
- TryReturn(!IsFailed(r), false, "pAuthorCertList->GetAt() is failed.");
- TryReturn(pEntity, false, "pEntity is null.");
+ String *pEntity = null;
+ r = pAuthorCertList->GetAt(0, pEntity);
+ TryReturn(!IsFailed(r), false, "pAuthorCertList->GetAt() is failed.");
+ TryReturn(pEntity, false, "pEntity is null.");
- std::unique_ptr<ByteBuffer> pEncodedData(StringUtil::DecodeBase64StringN(*pEntity));
- TryReturn(pEncodedData, false, "pEncodedData is null.");
+ std::unique_ptr<ByteBuffer> pEncodedData(StringUtil::DecodeBase64StringN(*pEntity));
+ TryReturn(pEncodedData, false, "pEncodedData is null.");
- std::unique_ptr<ByteBuffer> pHashValue(hash.GetHashN(*pEncodedData.get()));
- TryReturn(pHashValue, false, "pHashValue is null.");
+ std::unique_ptr<ByteBuffer> pHashValue(hash.GetHashN(*pEncodedData.get()));
+ TryReturn(pHashValue, false, "pHashValue is null.");
- r = StringUtil::EncodeToBase64String(*pHashValue, base64Value);
- TryReturn(!IsFailed(r), false, "EncodeToBase64String() is failed.");
+ r = StringUtil::EncodeToBase64String(*pHashValue, base64Value);
+ TryReturn(!IsFailed(r), false, "EncodeToBase64String() is failed.");
- // in smack, '/' is not allowed for label.
- r = base64Value.Replace(L"/", L"#");
- TryReturn(!IsFailed(r), false, "base64Value.Replace() is failed.");
+ // in smack, '/' is not allowed for label.
+ r = base64Value.Replace(L"/", L"#");
+ TryReturn(!IsFailed(r), false, "base64Value.Replace() is failed.");
- std::unique_ptr<char[]> pHashEncodedValue(_StringConverter::CopyToCharArrayN(base64Value));
- TryReturn(pHashEncodedValue, false, "pHashEncodedValue is null.");
+ std::unique_ptr<char[]> pHashEncodedValue(_StringConverter::CopyToCharArrayN(base64Value));
+ TryReturn(pHashEncodedValue, false, "pHashEncodedValue is null.");
- label = pHashEncodedValue.get();
- AppLog("pHashEncodedValue = [%s]", pHashEncodedValue.get());
+ label = pHashEncodedValue.get();
+ AppLog("pHashEncodedValue = [%s]", pHashEncodedValue.get());
+ }
+ else
+ {
+ AddLabelDir(pPackageId.get(), pPath.get());
+ return true;
+ }
}
else
{