row.Set_app_id(widgetHandle);
// row.Set_share_href (DPL::FromUTF8String(regInfo.shareHref));
row.Set_signature_type(regInfo.signatureType);
- row.Set_test_widget(regInfo.isTestWidget);
row.Set_install_time(regInfo.installedTime);
row.Set_splash_img_src(regInfo.configInfo.splashImgSrc);
row.Set_background_page(regInfo.configInfo.backgroundPage);
row.Set_base_folder(DPL::FromUTF8String(regInfo.baseFolder));
row.Set_webkit_plugins_required(widgetConfigurationInfo.flashNeeded);
row.Set_recognized(wacSecurity.isRecognized());
- row.Set_wac_signed(wacSecurity.isWacSigned());
row.Set_distributor_signed(wacSecurity.isDistributorSigned());
row.Set_tizen_appid(tzAppId);
row.Set_tizen_pkgid(regInfo.tzPkgid);
return static_cast<bool>(*result);
}
-bool WidgetDAOReadOnly::isWacSigned() const
-{
- WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
- DPL::OptionalInt result = row.Get_wac_signed();
- if (result.IsNull()) {
- return false;
- }
- return static_cast<bool>(*result);
-}
-
bool WidgetDAOReadOnly::isDistributorSigned() const
{
WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
return isDistributorSigned();
}
-bool WidgetDAOReadOnly::isTestWidget() const
-{
- Try {
- WRT_DB_SELECT(select, WidgetExtendedInfo, &WrtDatabase::interface())
- select->Where(Equals<WidgetExtendedInfo::app_id>(m_widgetHandle));
-
- WidgetExtendedInfo::Select::RowList rows = select->GetRowList();
- if (rows.empty()) {
- ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist,
- "Cannot find widget. Handle: " << m_widgetHandle);
- }
-
- return static_cast<bool>(rows.front().Get_test_widget());
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
- ReThrowMsg(WidgetDAOReadOnly::Exception::DatabaseError,
- "Failed to check IsTestWidget");
- }
-}
-
DPL::OptionalString WidgetDAOReadOnly::getCspPolicy() const
{
WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
#undef SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
#undef SQL_CONNECTION_EXCEPTION_HANDLER_END
#undef CHECK_WIDGET_EXISTENCE
-} // namespace WrtDB
\ No newline at end of file
+} // namespace WrtDB
WidgetRegisterInfo() :
webAppType(APP_TYPE_UNKNOWN),
signatureType(SIGNATURE_TYPE_UNIDENTIFIED),
- isTestWidget(0),
configInfo(),
packagingType(PKG_TYPE_UNKNOWN)
{}
std::string shareHref;
std::string baseFolder;
WidgetSignatureType signatureType;
- int isTestWidget;
ConfigParserData configInfo;
LocalizationData localizationData;
virtual bool isDistributorSigned() const = 0;
- virtual bool isWacSigned() const = 0;
-
virtual void getCertificateChainList(CertificateChainList& list,
CertificateSource source) const = 0;
};
* WAC 2.0 extension
* @return
*/
- bool isWacSigned() const;
-
- /**
- * WAC 2.0 extension
- * @return
- */
bool isDistributorSigned() const;
/**
bool isTrusted() const;
/**
- * WAC 2.0 extension
- * @return is WAC test widget
- */
- bool isTestWidget() const;
-
- /**
* This method returns window mode of widget.
*
* @return window modes of widget
public:
WacSecurityMock() :
mRecognized(false),
- mDistributorSigned(false),
- mWacSigned(false)
+ mDistributorSigned(false)
{}
virtual const WidgetCertificateDataList& getCertificateList() const
{
return mDistributorSigned;
}
- virtual bool isWacSigned() const
- {
- return mWacSigned;
- }
virtual void getCertificateChainList(CertificateChainList& /*lst*/) const {}
virtual void getCertificateChainList(CertificateChainList& /*lst*/,
CertificateSource /*source*/) const {}
{
mDistributorSigned = distributorSigned;
}
- void setWacSigned(bool wacSigned)
- {
- mWacSigned = wacSigned;
- }
private:
WrtDB::WidgetCertificateDataList mList;
// known distribuor
bool mDistributorSigned;
// distributor is wac
- bool mWacSigned;
};
TizenAppId _registerWidget(const WidgetRegisterInfo& regInfo,
RUNNER_ASSERT(!dao.isDistributorSigned());
RUNNER_ASSERT(!dao.isRecognized());
- RUNNER_ASSERT(!dao.isWacSigned());
}
sec.setDistributorSigned(true);
sec.setRecognized(true);
- sec.setWacSigned(true);
{
// register widget
TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
RUNNER_ASSERT(dao.isDistributorSigned());
RUNNER_ASSERT(dao.isRecognized());
- RUNNER_ASSERT(dao.isWacSigned());
}
}
RUNNER_ASSERT_MSG(dao.getCspPolicy().IsNull(), "Policy is not null");
}
}
-#undef RUNNER_ASSERT_WHAT_EQUALS
\ No newline at end of file
+#undef RUNNER_ASSERT_WHAT_EQUALS