diff options
author | Duyoung Jang <duyoung.jang@samsung.com> | 2012-11-13 12:00:07 +0900 |
---|---|---|
committer | Duyoung Jang <duyoung.jang@samsung.com> | 2012-11-13 12:00:07 +0900 |
commit | 7362faf542bf6dafc6c59f2883141f8f23afedb9 (patch) | |
tree | 0008872817db118c95cf4b915085650f71d0c38f /src | |
parent | 2080ee240f11a56710b9b68970583c2af013efe7 (diff) | |
download | installer-7362faf542bf6dafc6c59f2883141f8f23afedb9.tar.gz installer-7362faf542bf6dafc6c59f2883141f8f23afedb9.tar.bz2 installer-7362faf542bf6dafc6c59f2883141f8f23afedb9.zip |
Register ApiVisibility in package db
Change-Id: I04c4eda22e7617d3ca1cbb09cbf012e24da9028a
Diffstat (limited to 'src')
-rwxr-xr-x | src/Manager/SignatureManager.cpp | 2 | ||||
-rwxr-xr-x | src/Step/SignatureStep.cpp | 37 | ||||
-rwxr-xr-x | src/Step/SignatureStep.h | 2 |
3 files changed, 37 insertions, 4 deletions
diff --git a/src/Manager/SignatureManager.cpp b/src/Manager/SignatureManager.cpp index f7b6f5c..9a90bb9 100755 --- a/src/Manager/SignatureManager.cpp +++ b/src/Manager/SignatureManager.cpp @@ -268,7 +268,7 @@ SignatureManager::AddRootCertificate(X509CertificatePath* pCertPath, RootCertifi int length = 0; const char* pRootCert = null; - if (certType == ROOT_CERTIFICATE_NORMAL) + if (certType == ROOT_CERTIFICATE_PUBLIC) { pRootCert = "MIICozCCAgwCCQD9XW6kNg4bbjANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMC" "S1IxDjAMBgNVBAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6" diff --git a/src/Step/SignatureStep.cpp b/src/Step/SignatureStep.cpp index ebfcd26..745e653 100755 --- a/src/Step/SignatureStep.cpp +++ b/src/Step/SignatureStep.cpp @@ -144,7 +144,7 @@ SignatureStep::OnStateCertChain(void) { InstallerError error = INSTALLER_ERROR_NONE; bool ret = true; - int rootCert = ROOT_CERTIFICATE_NORMAL; + int rootCert = ROOT_CERTIFICATE_PUBLIC; ret = __pSignatureManager->AddCert(ROOT_CERTIFICATE_DEVELOPER); TryCatch(ret == true, error = INSTALLER_ERROR_INVALID_SIGNATURE, "[osp-installer] AddCert(DEVELOPER_ROOT_CERTIFICATE) failed"); @@ -152,7 +152,7 @@ SignatureStep::OnStateCertChain(void) ret = __pSignatureManager->VerifyChain(ROOT_CERTIFICATE_DEVELOPER); TryCatch(ret == true, error = INSTALLER_ERROR_INVALID_SIGNATURE, "[osp-installer] VerifyChain(DEVELOPER_ROOT_CERTIFICATE) failed"); - for(rootCert = ROOT_CERTIFICATE_NORMAL; rootCert <= ROOT_CERTIFICATE_PRIVATE; rootCert++) + for(rootCert = ROOT_CERTIFICATE_PUBLIC; rootCert <= ROOT_CERTIFICATE_PRIVATE; rootCert++) { ret = __pSignatureManager->AddCert((RootCertificateType)rootCert); TryCatch(ret == true, error = INSTALLER_ERROR_INVALID_SIGNATURE, "[osp-installer] AddCert() failed"); @@ -189,8 +189,9 @@ SignatureStep::OnStateRootCert(void) RootCertificateType certType = __pContext->GetRootCertType(); _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl(); String appId = pPackageInfoImpl->GetAppId(); + int apiVisibility = GetApiVisibility(certType); - AppLogTag(OSP_INSTALLER, "AppId = [%ls], CertType = [%d]", appId.GetPointer(), certType); + AppLogTag(OSP_INSTALLER, "AppId = [%ls], CertType = [%d], ApiVisibility = [%d]", appId.GetPointer(), certType, apiVisibility); r = PrivilegeHandler::GenerateCipherPrivilege(appId, *pPrivilegeList, certType, privileges, hmacPrivileges); if (IsFailed(r)) @@ -200,6 +201,7 @@ SignatureStep::OnStateRootCert(void) TryCatch(!IsFailed(r), error = INSTALLER_ERROR_PRIVILEGE, "[osp-installer] privMgr.GeneratePrivilegeString() failed"); pPackageInfoImpl->SetPrivilegesValue(privileges, hmacPrivileges); + pPackageInfoImpl->SetCertType(apiVisibility); CATCH: GoNextState(); @@ -214,3 +216,32 @@ SignatureStep::OnStateDone(void) GoNextState(); return error; } + +int +SignatureStep::GetApiVisibility(RootCertificateType certType) +{ + int apiVisibility = _API_VISIBILITY_NONE; + + if (certType == ROOT_CERTIFICATE_PUBLIC) + { + apiVisibility = _API_VISIBILITY_PUBLIC; + } + else if (certType == ROOT_CERTIFICATE_PARTNER) + { + apiVisibility = _API_VISIBILITY_PARTNER; + } + else if (certType == ROOT_CERTIFICATE_PARTNER_OPERATOR) + { + apiVisibility = _API_VISIBILITY_PARTNER_OPERATOR; + } + else if (certType == ROOT_CERTIFICATE_PARTNER_MANUFACTURER) + { + apiVisibility = _API_VISIBILITY_PARTNER_MANUFACTURER; + } + else if (certType == ROOT_CERTIFICATE_PRIVATE) + { + apiVisibility = _API_VISIBILITY_PRIVATE; + } + + return apiVisibility; +} diff --git a/src/Step/SignatureStep.h b/src/Step/SignatureStep.h index 6cd743b..610d888 100755 --- a/src/Step/SignatureStep.h +++ b/src/Step/SignatureStep.h @@ -61,6 +61,8 @@ private: InstallerError OnStateRootCert(void); InstallerError OnStateDone(void); + int GetApiVisibility(RootCertificateType certType); + private: int __state; InstallationContext* __pContext; |