Visibility level check bug fixed.
authorsunggun.jung <sunggun.jung@samsung.com>
Tue, 9 Apr 2013 13:54:19 +0000 (22:54 +0900)
committersunggun.jung <sunggun.jung@samsung.com>
Tue, 9 Apr 2013 13:54:19 +0000 (22:54 +0900)
Signed-off-by: sunggun.jung <sunggun.jung@samsung.com>
Change-Id: I2318fa8f02fbee7bdf1207ef1f0c59b92db2a310

vcore/src/vcore/CertificateConfigReader.cpp
vcore/src/vcore/SignatureData.h
vcore/src/vcore/SignatureValidator.cpp

index 872aa7d..b44eee9 100644 (file)
@@ -44,6 +44,7 @@ const std::string TOKEN_VALUE_VISIBILITY_PUBLIC = "tizen-public";
 const std::string TOKEN_VALUE_VISIBILITY_PARTNER = "tizen-partner";
 const std::string TOKEN_VALUE_VISIBILITY_PARTNER_OPERATOR = "tizen-partner-operator";
 const std::string TOKEN_VALUE_VISIBILITY_PARTNER_MANUFACTURER = "tizen-partner-manufacturer";
+const std::string TOKEN_VALUE_VISIBILITY_PLATFORM = "tizen-platform";
 
 int hexCharToInt(char c)
 {
@@ -125,8 +126,10 @@ void CertificateConfigReader::tokenCertificateDomain(CertificateIdentifier &)
         m_certificateDomain = CertStoreId::VIS_PARTNER_OPERATOR;
     } else if (name == TOKEN_VALUE_VISIBILITY_PARTNER_MANUFACTURER) {
         m_certificateDomain = CertStoreId::VIS_PARTNER_MANUFACTURER;
+    } else if (name == TOKEN_VALUE_VISIBILITY_PLATFORM) {
+        m_certificateDomain = CertStoreId::VIS_PLATFORM;
        } else {
-        LogWarning("This domain will be ignored: " << name);
+        LogWarning("This domain will be ignored : " << name);
         m_certificateDomain = 0;
     }
 }
index eb744b4..5afba19 100644 (file)
@@ -130,14 +130,16 @@ class SignatureData
 
        const CertStoreId::Type getVisibilityLevel(void) const
        {
-               if (m_storeIdSet.contains(CertStoreId::VIS_PUBLIC) == true)
-                       return CertStoreId::VIS_PUBLIC;
+               if (m_storeIdSet.contains(CertStoreId::VIS_PLATFORM) == true)
+                       return CertStoreId::VIS_PLATFORM;
+               else if (m_storeIdSet.contains(CertStoreId::VIS_PARTNER_MANUFACTURER) == true)
+                       return CertStoreId::VIS_PLATFORM;
+               else if (m_storeIdSet.contains(CertStoreId::VIS_PARTNER_OPERATOR) == true)
+                       return CertStoreId::VIS_PLATFORM;
                else if (m_storeIdSet.contains(CertStoreId::VIS_PARTNER) == true)
                        return CertStoreId::VIS_PARTNER;
-               else if (m_storeIdSet.contains(CertStoreId::VIS_PARTNER_OPERATOR) == true)
-                       return CertStoreId::VIS_PARTNER_OPERATOR;
-               else if (m_storeIdSet.contains(CertStoreId::VIS_PARTNER_MANUFACTURER) == true)
-                       return CertStoreId::VIS_PARTNER_MANUFACTURER;
+               else if (m_storeIdSet.contains(CertStoreId::VIS_PUBLIC) == true)
+                       return CertStoreId::VIS_PUBLIC;
                else {
                        LogWarning("Visibility level was broken.");
                        return 0;
index bc819d5..b8da0b0 100644 (file)
@@ -177,8 +177,12 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
         << storeIdSet.contains(CertStoreId::WAC_MEMBER));
     LogDebug("Is root certificate from TIZEN_MEMBER domain:  "
         << storeIdSet.contains(CertStoreId::TIZEN_MEMBER));
-    LogDebug("Is root certificate from TIZEN_ORANGE domain:  "
-        << storeIdSet.contains(CertStoreId::ORANGE_LEGACY));
+    LogDebug("Is root certificate from TIZEN_PUBLIC domain:  "
+        << storeIdSet.contains(CertStoreId::VIS_PUBLIC));
+    LogDebug("Is root certificate from TIZEN_PARTNER domain:  "
+        << storeIdSet.contains(CertStoreId::VIS_PARTNER));
+    LogDebug("Is root certificate from TIZEN_PLATFORM domain:  "
+        << storeIdSet.contains(CertStoreId::VIS_PLATFORM));
 
     LogDebug(" visibility level is public :  "
         << storeIdSet.contains(CertStoreId::VIS_PUBLIC));
@@ -363,8 +367,12 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
         << storeIdSet.contains(CertStoreId::WAC_MEMBER));
     LogDebug("Is root certificate from TIZEN_MEMBER domain:  "
         << storeIdSet.contains(CertStoreId::TIZEN_MEMBER));
-    LogDebug("Is root certificate from ORANGE_LEGACY domain:  "
-        << storeIdSet.contains(CertStoreId::ORANGE_LEGACY));
+    LogDebug("Is root certificate from TIZEN_PUBLIC domain:  "
+        << storeIdSet.contains(CertStoreId::VIS_PUBLIC));
+    LogDebug("Is root certificate from TIZEN_PARTNER domain:  "
+        << storeIdSet.contains(CertStoreId::VIS_PARTNER));
+    LogDebug("Is root certificate from TIZEN_PLATFORM domain:  "
+        << storeIdSet.contains(CertStoreId::VIS_PLATFORM));
 
     LogDebug(" visibility level is public :  "
         << storeIdSet.contains(CertStoreId::VIS_PUBLIC));