#include <vcore/SignatureReader.h>
#include <vcore/SignatureFinder.h>
#include <vcore/WrtSignatureValidator.h>
-#include <vcore/DeveloperModeValidator.h>
#include <dpl/utils/wrt_global_settings.h>
#include <dpl/wrt-dao-ro/global_dao_read_only.h>
// no point in check domain WAC_ROOT and WAC_RECOGNIZED
m_contextData.wacSecurity.setDistributorSigned(true);
- if (data.getStorageType().contains(CertStoreId::WAC_ROOT)) {
- m_contextData.wacSecurity.setWacSigned(true);
- }
-
CertificateCollection collection;
collection.load(data.getCertList());
Assert(collection.sort() &&
SignatureFileInfoSet::reverse_iterator iter = signatureFiles.rbegin();
LogInfo("Number of signatures: " << signatureFiles.size());
- bool testCertificate = false;
-
bool complianceMode = GlobalDAOReadOnly::getComplianceMode();
for (; iter != signatureFiles.rend(); ++iter) {
processDistributorSignature(data);
}
- bool developerMode = GlobalDAOReadOnly::GetDeveloperMode();
-
- std::string realMEID;
- /*
- TapiHandle *tapiHandle = tel_init(NULL);
- char *meid = tel_get_misc_me_sn_sync(tapiHandle);
- if (meid) {
- realMEID = meid;
- free(meid);
- }
- tel_deinit(tapiHandle);
- */
-
- DeveloperModeValidator developerModeValidator(
- complianceMode,
- developerMode,
- GlobalDAOReadOnly::getComplianceFakeImei(),
- GlobalDAOReadOnly::getComplianceFakeMeid(),
- realMEID);
-
- developerModeValidator.check(data);
-
- testCertificate |=
- data.getStorageType().contains(CertStoreId::DEVELOPER);
-
- if (testCertificate && !developerMode) {
- LogError("Widget signed by test certificate, "
- "but developer mode is off.");
- ThrowMsg(Exceptions::InvalidPackage,
- "Widget signed by test certificate, "
- "but developer mode is off.");
- }
- m_contextData.widgetConfig.isTestWidget = testCertificate;
} Catch(ParserSchemaException::Base) {
LogError("Error occured in ParserSchema.");
ReThrowMsg(Exceptions::InvalidPackage,
"Error occured in ParserSchema.");
}
- Catch(DeveloperModeValidator::Exception::Base) {
- LogError("Cannot validate developer certificate.");
- ReThrowMsg(Exceptions::InvalidPackage,
- "Cannot validate developer certificate.");
- }
}
if (signatureFiles.empty()) {
public:
WacSecurity() :
mRecognized(false),
- mDistributorSigned(false),
- mWacSigned(false)
+ mDistributorSigned(false)
{}
// from IWacSecurity
return mDistributorSigned;
}
+ // TODO : remove after wrt-commons released
virtual bool isWacSigned() const
{
- return mWacSigned;
+ return false;
}
virtual void getCertificateChainList(
{
mDistributorSigned = distributorSigned;
}
- void setWacSigned(bool wacSigned)
- {
- mWacSigned = wacSigned;
- }
void setAuthorCertificatePtr(ValidationCore::CertificatePtr certPtr)
{
mAuthorCertificate = certPtr;
bool mRecognized;
// known distribuor
bool mDistributorSigned;
- // distributor is wac
- bool mWacSigned;
// Author end entity certificate.
// Information from this certificate are shown to user
// during installation process.