#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130822.1]"
+#define OSP_INSTALLER_VERSION "version=[20130826.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
-using namespace Tizen::Security::Cert;
SignatureManager::SignatureManager(void)
:__pContext(null)
}
bool
-SignatureManager::GetCertValue(ICertificate* pCert, String& value) const
-{
- result r = E_SUCCESS;
-
- std::unique_ptr<ByteBuffer> pEncodedData(pCert->GetEncodedDataN());
- TryReturn(pEncodedData, false, "pEncodedData is null.");
-
- r = StringUtil::EncodeToBase64String(*pEncodedData.get(), value);
- TryReturn(!IsFailed(r), false, "StringUtil::EncodeToBase64String() is failed.");
-
- return true;
-}
-
-bool
SignatureManager::CompareReferences(HashMap* pDistributorRefMap, HashMap* pAuthorRefMap)
{
TryReturn(__pContext, false, "__pContext is null.");
return true;
}
-
-bool
-SignatureManager::Validate(X509CertificatePath* pCertPath)
-{
- TryReturn(pCertPath, false, "pCertPath is null.");
-
- AppLog("------------------------------------------");
- AppLog("# signature.xml");
- ValidationResult valResult = VALIDATION_SUCCESS;
- valResult = pCertPath->Validate();
-
- if (valResult != VALIDATION_SUCCESS)
- {
- AppLog("Validate() fail! - ValidationResult = [%d]", valResult);
- AppLog("------------------------------------------");
- return false;
- }
- else
- {
- int depth = pCertPath->GetLength();
- if (depth == 0)
- {
- AppLog("depth = 0");
- return false;
- }
-
- AppLog("Validate() success!");
- AppLog("------------------------------------------");
- }
-
- return true;
-}
bool SetAuthorCertValue(void* pHandle, Tizen::Base::Collection::IListT<Tizen::Base::String *>* pCertList) const;
bool SetDistributorCertValue(void* pHandle, Tizen::Base::Collection::IListT<Tizen::Base::String *>* pCertList, int sigFileNumber) const;
- bool GetCertValue(Tizen::Security::Cert::ICertificate* pCert, Tizen::Base::String& value) const;
-
bool CompareReferences(Tizen::Base::Collection::HashMap* pDistributorRefMap, Tizen::Base::Collection::HashMap* pAuthorRefMap);
bool PrintCertValue(const Tizen::Base::String& certValue) const;
- bool Validate(Tizen::Security::Cert::X509CertificatePath* pCertPath);
bool ValidateUpdate();
private:
res = __pSignatureManager->ValidateSignatures();
AppLog(" ## __pSignatureManager->ValidateSignatures() result = [%s]", res?"true":"false");
- fprintf(stderr, " ## __pSignatureManager->ValidateSignatures() result = [%s]\n", res?"true":"false");
- if (res == true)
+ if (res == false)
{
-// res = __pSignatureManager->ValidatePartialReferences();
-// AppLog(" ## __pSignatureManager->ValidatePartialReferences() result = [%s]", res?"true":"false");
-// fprintf(stderr, " ## __pSignatureManager->ValidatePartialReferences() result = [%s]\n", res?"true":"false");
- }
- else
- {
- if (__pContext->__isPreloaded == false)
+ fprintf(stderr, " ## __pSignatureManager->ValidateSignatures() result = [%s]\n", res?"true":"false");
+
+ if (InstallerUtil::IsSignatureVerificationEnabled() == true)
{
- if (InstallerUtil::IsSignatureVerificationEnabled() == true)
- {
- AppLog("_pSignatureManager->ValidateSignatures() is failed.");
- error = INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED;
+ AppLog("_pSignatureManager->ValidateSignatures() is failed.");
+ error = INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED;
- __pContext->__rootCertType = ROOT_CERTIFICATE_NONE;
- __pContext->__pAuthorCertList->RemoveAll();
- __pContext->__pDistributorCertList->RemoveAll();
- __pContext->__pDistributorCertList2->RemoveAll();
- }
- else
- {
- AppLog("ValidateSignatures() failed, but it's ok. [SignatureVerification is off.]");
- }
+ __pContext->__rootCertType = ROOT_CERTIFICATE_NONE;
+ __pContext->__pAuthorCertList->RemoveAll();
+ __pContext->__pDistributorCertList->RemoveAll();
+ __pContext->__pDistributorCertList2->RemoveAll();
+ }
+ else
+ {
+ AppLog("ValidateSignatures() failed, but it's ok. [SignatureVerification is off.]");
}
}