2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file SignatureManager.cpp
19 * @brief This is the implementation file for %SignatureManager class.
22 #include <pkgmgr_parser.h>
23 #include <pkgmgr_installer.h>
24 #include <package-manager.h>
25 #include <pkgmgr-info.h>
27 #include <FBase_StringConverter.h>
28 #include <FBaseInternalTypes.h>
30 #include "SignatureManager.h"
32 #include <vcore/SignatureFinder.h>
33 #include <vcore/SignatureData.h>
34 #include <vcore/SignatureReader.h>
35 #include <vcore/SignatureValidator.h>
36 #include <vcore/WrtSignatureValidator.h>
37 #include <vcore/VCore.h>
39 using namespace Tizen::Base;
40 using namespace Tizen::Base::Collection;
41 using namespace Tizen::Base::Utility;
43 SignatureManager::SignatureManager(void)
48 SignatureManager::~SignatureManager(void)
53 SignatureManager::Construct(InstallationContext* pContext)
55 __pContext = pContext;
61 SignatureManager::ValidateSignatures()
63 TryReturn(__pContext, false, "__pContext is null.");
65 AppLog("ValidateSignatures start >>");
68 res = ValidationCore::VCoreInit(
69 std::string("/usr/share/wrt-engine/fingerprint_list.xml"),
70 std::string("/usr/share/wrt-engine/fingerprint_list.xsd"),
71 std::string("/opt/dbspace/.cert_svc_vcore.db"));
72 TryReturn(res, false, "ValidationCore::VCoreInit() is failed.");
73 TryReturn(__pContext->__rootPath.IsEmpty() == false, false, "__pContext->__rootPath is empty.");
74 AppLog("ValidationCore::VCoreInit() is done");
76 std::unique_ptr<char[]> pRootPath(_StringConverter::CopyToCharArrayN(__pContext->__rootPath));
77 TryReturn(pRootPath, false, "__pRootPath is null.");
79 std::string rootPath = pRootPath.get();
81 AppLog("rootPath=[%s]", rootPath.c_str());
83 ValidationCore::SignatureFinder::Result findRes = ValidationCore::SignatureFinder::NO_ERROR;
84 ValidationCore::SignatureFinder signatureFinder(rootPath);
85 ValidationCore::SignatureFileInfoSet signatureFiles;
87 findRes = signatureFinder.find(signatureFiles);
88 TryReturn(findRes == ValidationCore::SignatureFinder::NO_ERROR , false, "signatureFinder.find() is failed, findRes=[%d]", (int)findRes);
89 AppLog("signatureFinder.find() is done");
91 ValidationCore::SignatureFileInfoSet::reverse_iterator iter = signatureFiles.rbegin();
92 for (; iter != signatureFiles.rend(); ++iter)
94 int sigFileNumber = iter->getFileNumber();
95 AppLog("SignatureFiles: file=[%s]", iter->getFileName().c_str());
96 AppLog("SignatureFiles: number=[%d]", sigFileNumber);
98 if (sigFileNumber > SIGNATURE_FILE_NUMBER_DISTRIBUTOR2)
100 AppLog("SignatureFiles: skip!");
104 ValidationCore::SignatureData data(rootPath + iter->getFileName(), iter->getFileNumber());
107 ValidationCore::SignatureReader xml;
108 xml.initialize(data, "/usr/share/wrt-engine/schema.xsd");
110 AppLog("ValidationCore::SignatureReader() is done");
112 ValidationCore::CertificateList certList = data.getCertList();
113 ValidationCore::CertificateList::iterator it = certList.begin();
114 ValidationCore::CertificateList::iterator it_end = certList.end();
115 for (; it != it_end; it++)
117 std::string value = (*it)->getBase64();
119 if (data.isAuthorSignature() == true)
121 __pContext->__pAuthorCertList->Add(new String(value.c_str()));
122 AppLog("Author cert value=[%s]", value.c_str());
126 if (sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR)
128 __pContext->__pDistributorCertList->Add(new String(value.c_str()));
129 AppLog("Default distributor cert value=[%s]", value.c_str());
131 else if (sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR2)
133 AppLog("Default distributor2 cert value=[%s]", value.c_str());
138 ValidationCore::SignatureValidator::Result valRes = ValidationCore::SignatureValidator::SIGNATURE_VALID;
139 ValidationCore::SignatureValidator::AppType appType = ValidationCore::SignatureValidator::TIZEN;
140 ValidationCore::SignatureValidator validator(appType, false, false, false);
142 AppLog("validator.check() start >>");
143 valRes = validator.check(data, rootPath);
144 if (sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR2)
146 if (valRes == ValidationCore::SignatureValidator::SIGNATURE_VERIFIED)
148 AppLog("Signature validator.check success, file=[%s], number=[%d]", iter->getFileName().c_str(), iter->getFileNumber());
152 AppLog("Signature validator.check failed, but it's ok, file=[%s], number=[%d]", iter->getFileName().c_str(), iter->getFileNumber());
153 __pContext->__pDistributorCertList2->RemoveAll();
158 TryReturn(valRes == ValidationCore::SignatureValidator::SIGNATURE_VERIFIED, false, "validator.check() is failed, valRes=[%d]", (int)valRes);
159 AppLog("Signature validator.check success, file=[%s], number=[%d]", iter->getFileName().c_str(), iter->getFileNumber());
162 ValidationCore::CertificatePtr pRootCert = data.getRootCaCertificatePtr();
163 TryReturn(pRootCert, false, "__pRootPath is null.");
164 std::string value = pRootCert.Get()->getBase64();
165 if (data.isAuthorSignature() == true)
167 __pContext->__pAuthorCertList->Add(new String(value.c_str()));
168 AppLog("Author root cert value=[%s]", value.c_str());
172 if (sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR)
174 __pContext->__pDistributorCertList->Add(new String(value.c_str()));
175 AppLog("Default root distributor cert value=[%s]", value.c_str());
177 ValidationCore::CertStoreId::Type certStoreIdType = data.getVisibilityLevel();
178 AppLog("CertStoreIdType = [%d]", (int)certStoreIdType);
179 __pContext->__rootCertType = (RootCertificateType)certStoreIdType;
181 else if ((sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR2) && (valRes == ValidationCore::SignatureValidator::SIGNATURE_VERIFIED))
183 __pContext->__pDistributorCertList2->Add(new String(value.c_str()));
184 AppLog("Default root distributor2 cert value=[%s]", value.c_str());
188 catch (ValidationCore::ParserSchemaException::Base)
190 if (sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR2)
192 AppLog("ValidationCore::ParserSchemaException::Base occurred, but it's ok for DISTRIBUTOR2.");
195 TryReturn(0, false, "ParserSchemaException::Base exception occurred.");
197 catch (DPL::Exception)
199 if (sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR2)
201 AppLog("DPL::Exception occurred, but it's ok for DISTRIBUTOR2.");
204 TryReturn(0, false, "DPL::Exception exception occurred.");
208 AppLog("ValidateSignatures done successfully <<");
210 if (__pContext->__isUpdated == true)
212 res = ValidateUpdate();
213 TryReturn(res, false, "ValidateUpdate() is failed.");
220 SignatureManager::ValidateUpdate()
222 TryReturn(__pContext, false, "__pContext is null.");
224 if (InstallerUtil::IsAuthorSignatureVerificationEnabled() == false)
226 AppLog("ValidateUpdate() skip.");
230 std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(__pContext->__packageId));
231 TryReturn(pPackageId, false, "pPackageId is null.");
233 result r = E_SUCCESS;
234 String oldCertificate;
235 String* pNewCertificate = null;
236 const char* pValue = null;
237 pkgmgr_certinfo_h handle = null;
239 int res = pkgmgr_pkginfo_create_certinfo(&handle);
240 if (res == PMINFO_R_OK)
242 res = pkgmgr_pkginfo_load_certinfo(pPackageId.get(), handle);
243 if (res == PMINFO_R_OK)
245 pkgmgr_pkginfo_get_cert_value(handle, PM_AUTHOR_SIGNER_CERT, &pValue);
246 oldCertificate = pValue;
249 pkgmgr_pkginfo_destroy_certinfo(handle);
252 if (oldCertificate.IsEmpty() == true)
254 AppLog("oldCert is empty.");
259 r = __pContext->__pAuthorCertList->GetAt(0, pNewCertificate);
260 TryReturn(r == E_SUCCESS, false, "GetAt() failed.");
262 AppLog("------------------------------------------");
263 AppLog("oldCert = [%ls]", oldCertificate.GetPointer());
264 AppLog("newCert = [%ls]", pNewCertificate->GetPointer());
265 AppLog("------------------------------------------");
267 if (oldCertificate.Equals(*pNewCertificate, true) == false)
269 AppLog("oldCert, newCert is different.");
274 AppLog("oldCert, newCert is the same.");
279 SignatureManager::ValidatePartialReferences(const String& path, IList* pAddedList, IList* pModifiedList)
281 TryReturn(__pContext, false, "__pContext is null.");
282 TryReturn(path.IsEmpty() == false, false, "rootPath is empty.");
284 AppLog("ValidatePartialReferences start >>");
286 std::unique_ptr<char[]> pPath(_StringConverter::CopyToCharArrayN(path));
287 TryReturn(pPath, false, "pPath is null.");
289 std::string rootPath = pPath.get();
291 AppLog("rootPath = [%s]", rootPath.c_str());
293 bool res = ValidationCore::VCoreInit(
294 std::string("/usr/share/wrt-engine/fingerprint_list.xml"),
295 std::string("/usr/share/wrt-engine/fingerprint_list.xsd"),
296 std::string("/opt/dbspace/.cert_svc_vcore.db"));
297 TryReturn(res, false, "ValidationCore::VCoreInit() failed.");
299 ValidationCore::SignatureFinder::Result findRes = ValidationCore::SignatureFinder::NO_ERROR;
300 ValidationCore::SignatureFinder signatureFinder(rootPath);
301 ValidationCore::SignatureFileInfoSet signatureFiles;
303 findRes = signatureFinder.find(signatureFiles);
304 TryReturn(findRes == ValidationCore::SignatureFinder::NO_ERROR , false, "signatureFinder.find() failed, findRes = [%d]", (int)findRes);
306 ValidationCore::SignatureFileInfoSet::reverse_iterator iter = signatureFiles.rbegin();
307 for (; iter != signatureFiles.rend(); ++iter)
309 int sigFileNumber = iter->getFileNumber();
310 AppLog("SignatureFiles: file = [%s]", iter->getFileName().c_str());
311 AppLog("SignatureFiles: number = [%d]", sigFileNumber);
313 if (sigFileNumber > SIGNATURE_FILE_NUMBER_DISTRIBUTOR2)
315 AppLog("SignatureFiles: skip!");
319 ValidationCore::SignatureData data(rootPath + iter->getFileName(), iter->getFileNumber());
323 ValidationCore::SignatureReader xml;
324 xml.initialize(data, "/usr/share/wrt-engine/schema.xsd");
327 ValidationCore::CertificateList certList = data.getCertList();
328 ValidationCore::CertificateList::iterator it = certList.begin();
329 ValidationCore::CertificateList::iterator it_end = certList.end();
330 for (; it != it_end; it++)
332 std::string value = (*it)->getBase64();
334 if (data.isAuthorSignature() == true)
336 __pContext->__pAuthorCertList->Add(new String(value.c_str()));
337 AppLog("Author cert value = [%s]", value.c_str());
341 if (sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR)
343 __pContext->__pDistributorCertList->Add(new String(value.c_str()));
344 AppLog("Default distributor cert value = [%s]", value.c_str());
349 ValidationCore::SignatureValidator::Result valRes = ValidationCore::SignatureValidator::SIGNATURE_VALID;
350 ValidationCore::SignatureValidator::AppType appType = ValidationCore::SignatureValidator::TIZEN;
351 ValidationCore::SignatureValidator validator(appType, false, false, false);
353 std::list<std::string> uriList;
356 for (int idx = 0; idx < pAddedList->GetCount(); idx++)
358 String* pFilePath = static_cast< String* >(pAddedList->GetAt(idx));
359 TryReturn(pFilePath, false, "pFilePath is null.");
361 std::unique_ptr<char[]> pPath(_StringConverter::CopyToCharArrayN(*pFilePath));
362 TryReturn(pPath, false, "pPath is null.");
364 uriList.push_back(pPath.get());
365 AppLog("added = [%s]", pPath.get());
370 for (int idx = 0; idx < pModifiedList->GetCount(); idx++)
372 String* pFilePath = static_cast< String* >(pModifiedList->GetAt(idx));
373 TryReturn(pFilePath, false, "pFilePath is null.");
375 std::unique_ptr<char[]> pPath(_StringConverter::CopyToCharArrayN(*pFilePath));
376 TryReturn(pPath, false, "pPath is null.");
378 if ((strcasecmp(pPath.get(), "author-signature.xml") != 0) &&
379 (strcasecmp(pPath.get(), "signature1.xml") != 0))
381 uriList.push_back(pPath.get());
382 AppLog("modified = [%s]", pPath.get());
386 TryReturn(uriList.size() != 0, false, "uriList.size is 0.");
387 AppLog("uriList.size = [%d]", uriList.size());
389 valRes = validator.checkList(data, rootPath, uriList);
390 TryReturn(valRes == ValidationCore::SignatureValidator::SIGNATURE_VERIFIED, false, "validator.checkList() is failed, valRes=[%d]", (int)valRes);
391 AppLog("Signature validator.checkList() success, file = [%s], number = [%d]", iter->getFileName().c_str(), iter->getFileNumber());
393 catch (ValidationCore::ParserSchemaException::Base)
395 if (sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR2)
397 AppLog("ValidationCore::ParserSchemaException::Base occurred, but it's ok for DISTRIBUTOR2.");
400 TryReturn(0, false, "ParserSchemaException::Base exception occurred.");
402 catch (DPL::Exception)
404 if (sigFileNumber == SIGNATURE_FILE_NUMBER_DISTRIBUTOR2)
406 AppLog("DPL::Exception occurred, but it's ok for DISTRIBUTOR2.");
409 TryReturn(0, false, "DPL::Exception exception occurred.");
413 AppLog("ValidateSignatures done successfully <<");
415 res = ValidateUpdate();
416 TryReturn(res, false, "ValidateUpdate() is failed.");
422 SignatureManager::RegisterCertInfo() const
424 TryReturn(__pContext, false, "__pContext is null");
426 if (__pContext->__isHybridService == true)
428 AppLog("Skip - HybridService");
436 pkgmgr_instcertinfo_h handle = null;
438 std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(__pContext->__packageId));
439 TryReturn(pPackageId, false, "pPackageId is null");
441 error = pkgmgr_installer_create_certinfo_set_handle(&handle);
442 TryReturn(error == 0, false, "pkgmgr_installer_create_certinfo_set_handle() failed, error = [%d].", error);
444 if (__pContext->__pAuthorCertList)
446 AppLog("[AuthorCert]");
447 res = SetAuthorCertValue(handle, __pContext->__pAuthorCertList);
448 TryCatch(res == true, , "SetAuthorCertHashValue() is failed.");
451 if (__pContext->__pDistributorCertList)
453 AppLog("[DistributorCert]");
454 res = SetDistributorCertValue(handle, __pContext->__pDistributorCertList, 1);
455 TryCatch(res == true, , "SetDistributorCertValue() is failed.");
458 if (__pContext->__pDistributorCertList2)
460 AppLog("[DistributorCert2]");
461 res = SetDistributorCertValue(handle, __pContext->__pDistributorCertList2, 2);
462 TryCatch(res == true, , "SetDistributorCertValue() is failed.");
465 error = pkgmgr_installer_save_certinfo(pPackageId.get(), handle);
466 TryCatch(error == 0, res = false, "pkgmgr_installer_save_certinfo(%s) failed, error = [%d]", pPackageId.get(), error);
468 AppLog("RegisterCertInfo - END");
469 AppLog("------------------------------------------");
476 pkgmgr_installer_destroy_certinfo_set_handle(handle);
483 SignatureManager::UnregisterCertInfo() const
485 TryReturn(__pContext, false, "__pContext is null");
487 if (__pContext->__isHybridService == true)
489 AppLog("Skip - HybridService");
495 std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(__pContext->__packageId));
496 TryReturn(pPackageId, false, "pPackageId is null");
498 error = pkgmgr_installer_delete_certinfo(pPackageId.get());
499 TryReturn(error == 0, false, "pkgmgr_installer_delete_certinfo(%s) failed, error = [%d]", pPackageId.get(), error);
501 AppLog("UnregisterCertInfo - END");
502 AppLog("------------------------------------------");
508 SignatureManager::GetApiVisibility(RootCertificateType certType)
510 int apiVisibility = _API_VISIBILITY_NONE;
512 if (certType == ROOT_CERTIFICATE_PUBLIC)
514 apiVisibility = _API_VISIBILITY_PUBLIC;
516 else if (certType == ROOT_CERTIFICATE_PARTNER)
518 apiVisibility = _API_VISIBILITY_PARTNER;
520 else if (certType == ROOT_CERTIFICATE_PARTNER_OPERATOR)
522 apiVisibility = _API_VISIBILITY_PARTNER_OPERATOR;
524 else if (certType == ROOT_CERTIFICATE_PARTNER_MANUFACTURER)
526 apiVisibility = _API_VISIBILITY_PARTNER_MANUFACTURER;
528 else if (certType == ROOT_CERTIFICATE_CERT_SVC_PUBLIC)
530 apiVisibility = _API_VISIBILITY_PUBLIC;
532 else if (certType == ROOT_CERTIFICATE_CERT_SVC_PARTNER)
534 apiVisibility = _API_VISIBILITY_PARTNER;
536 else if (certType == ROOT_CERTIFICATE_CERT_SVC_PARTNER_OPERATOR)
538 apiVisibility = _API_VISIBILITY_PARTNER_OPERATOR;
540 else if (certType == ROOT_CERTIFICATE_CERT_SVC_PARTNER_MANUFACTURER)
542 apiVisibility = _API_VISIBILITY_PARTNER_MANUFACTURER;
544 else if (certType == ROOT_CERTIFICATE_CERT_SVC_PLATFORM)
546 apiVisibility = _API_VISIBILITY_PARTNER_MANUFACTURER;
549 return apiVisibility;
553 SignatureManager::GetPrivilegeLevel(int apiVisibility)
555 if (apiVisibility == _API_VISIBILITY_PARTNER_MANUFACTURER || apiVisibility == _API_VISIBILITY_PARTNER_OPERATOR)
557 return PRIVILEGE_LEVEL_PLATFORM;
559 else if (apiVisibility == _API_VISIBILITY_PARTNER)
561 return PRIVILEGE_LEVEL_PARTNER;
564 return PRIVILEGE_LEVEL_PUBLIC;
568 SignatureManager::SetAuthorCertValue(void* pHandle, IListT<String *>* pCertList) const
570 TryReturn(pHandle, false, "pHandle is null.");
571 TryReturn(pCertList, false, "pCertPath is null.");
574 result r = E_SUCCESS;
577 for (int i = 0; i < pCertList->GetCount(); i++)
579 String* pCert = null;
580 r = pCertList->GetAt(i, pCert);
581 TryReturn(!IsFailed(r), false, "pCertList->GetAt() is failed, [%d]", i);
582 TryReturn(pCert, false, "pCertList->GetAt() is failed, [%d]", i);
584 std::unique_ptr<char[]> pCertValue(_StringConverter::CopyToCharArrayN(*pCert));
588 certType = PM_SET_AUTHOR_SIGNER_CERT;
592 certType = PM_SET_AUTHOR_INTERMEDIATE_CERT;
596 certType = PM_SET_AUTHOR_ROOT_CERT;
600 AppLog("Invalid certificate type[%d]", i);
604 AppLog("------------------------------------------");
605 AppLog("Certificate type=[%d]", certType);
606 AppLog("[%s]", pCertValue.get());
608 res = pkgmgr_installer_set_cert_value(pHandle, (pkgmgr_instcert_type)certType, pCertValue.get());
609 TryReturn(res == 0, false, "pkgmgr_installer_set_cert_value(%d) failed.[%d]", i, res);
616 SignatureManager::SetDistributorCertValue(void* pHandle, IListT<String *>* pCertList, int sigFileNumber) const
618 TryReturn(pHandle, false, "pHandle is null.");
619 TryReturn(pCertList, false, "pCertPath is null.");
620 TryReturn((sigFileNumber == 1) || (sigFileNumber == 2), false, "sigFileNumber[%d] is invalid.", sigFileNumber);
623 result r = E_SUCCESS;
626 for (int i = 0; i < pCertList->GetCount(); i++)
628 String* pCert = null;
629 r = pCertList->GetAt(i, pCert);
630 TryReturn(!IsFailed(r), false, "pCertList->GetAt() is failed, [%d]", i);
631 TryReturn(pCert, false, "pCertList->GetAt() is failed, [%d]", i);
633 std::unique_ptr<char[]> pCertValue(_StringConverter::CopyToCharArrayN(*pCert));
635 if (sigFileNumber == 1)
639 certType = PM_SET_DISTRIBUTOR_SIGNER_CERT;
643 certType = PM_SET_DISTRIBUTOR_INTERMEDIATE_CERT;
647 certType = PM_SET_DISTRIBUTOR_ROOT_CERT;
651 AppLog("Invalid certificate type[%d]", i);
655 else if (sigFileNumber == 2)
657 if (pCertList->GetCount() == 1)
659 certType = PM_SET_DISTRIBUTOR2_ROOT_CERT;
665 certType = PM_SET_DISTRIBUTOR2_SIGNER_CERT;
669 certType = PM_SET_DISTRIBUTOR2_INTERMEDIATE_CERT;
673 certType = PM_SET_DISTRIBUTOR2_ROOT_CERT;
677 AppLog("Invalid certificate type[%d]", i);
683 AppLog("------------------------------------------");
684 AppLog("Certificate type=[%d]", certType);
685 AppLog("[%s]", pCertValue.get());
687 res = pkgmgr_installer_set_cert_value(pHandle, (pkgmgr_instcert_type)certType, pCertValue.get());
688 TryReturn(res == 0, false, "pkgmgr_installer_set_cert_value(%d) failed.[%d]", i, res);
695 SignatureManager::CompareReferences(HashMap* pDistributorRefMap, HashMap* pAuthorRefMap)
697 TryReturn(__pContext, false, "__pContext is null.");
700 std::unique_ptr< IMapEnumerator > pEnum(pAuthorRefMap->GetMapEnumeratorN());
701 TryReturn(pEnum, false, "pEnum is null.");
703 while (pEnum->MoveNext() == E_SUCCESS)
705 String* pAuthorKey = static_cast< String* > (pEnum->GetKey());
706 TryReturn(pAuthorKey, false, "pAuthorKey is null.");
708 String* pAuthorValue = static_cast< String* > (pEnum->GetValue());
709 TryReturn(pAuthorValue, false, "pAuthorValue is failed.");
711 String* pDistValue = static_cast< String* >(pDistributorRefMap->GetValue(*pAuthorKey));
712 TryReturn(pDistValue, false, "pDistValue is null, failed to compare.");
714 AppLog("pAuthorValue=[%ls]", pAuthorValue->GetPointer());
715 AppLog("pDistValue=[%ls]", pDistValue->GetPointer());
716 if (*pAuthorValue != *pDistValue)
718 TryReturn(0, false, "Digest value does not be matched.");
721 String filePath = __pContext->__rootPath + L"/" + *pAuthorKey;
724 AppLog("filePath=[%ls]", filePath.GetPointer());
725 res = InstallerUtil::GetFileDigest(filePath, fileDigest);
726 TryReturn(res == true, false, "GetFileDigest() is failed.");
728 AppLog("fileDigest=[%ls]", fileDigest.GetPointer());
729 if (*pAuthorValue != fileDigest)
731 TryReturn(0, false, "Digest value does not be matched.");
739 SignatureManager::PrintCertValue(const String& certValue) const
741 const int certLength = 30;
745 certValue.SubString(0, certLength, startString);
746 certValue.SubString(certValue.GetLength() - certLength, certLength, endString);
747 AppLog("cert value, start with [%ls]", startString.GetPointer());
748 AppLog("cert value, end with [%ls]", endString.GetPointer());