config_method split into config_method and config_method_with_cred<>

This commit is contained in:
2016-07-21 22:01:08 +02:00
parent ac88d55fe4
commit 6ae8029a47
20 changed files with 567 additions and 332 deletions

View File

@@ -66,7 +66,7 @@ tstring eap::get_cert_title(PCCERT_CONTEXT cert)
// eap::config_method_tls
//////////////////////////////////////////////////////////////////////
eap::config_method_tls::config_method_tls(_In_ module &mod) : config_method(mod)
eap::config_method_tls::config_method_tls(_In_ module &mod) : config_method_with_cred<credentials_tls>(mod)
{
}
@@ -74,7 +74,7 @@ eap::config_method_tls::config_method_tls(_In_ module &mod) : config_method(mod)
eap::config_method_tls::config_method_tls(_In_ const config_method_tls &other) :
m_trusted_root_ca(other.m_trusted_root_ca),
m_server_names(other.m_server_names),
config_method(other)
config_method_with_cred<credentials_tls>(other)
{
}
@@ -82,7 +82,7 @@ eap::config_method_tls::config_method_tls(_In_ const config_method_tls &other) :
eap::config_method_tls::config_method_tls(_Inout_ config_method_tls &&other) :
m_trusted_root_ca(std::move(other.m_trusted_root_ca)),
m_server_names(std::move(other.m_server_names)),
config_method(std::move(other))
config_method_with_cred<credentials_tls>(std::move(other))
{
}
@@ -90,7 +90,7 @@ eap::config_method_tls::config_method_tls(_Inout_ config_method_tls &&other) :
eap::config_method_tls& eap::config_method_tls::operator=(_In_ const config_method_tls &other)
{
if (this != &other) {
(config_method&)*this = other;
(config_method_with_cred<credentials_tls>&)*this = other;
m_trusted_root_ca = other.m_trusted_root_ca;
m_server_names = other.m_server_names;
}
@@ -102,7 +102,7 @@ eap::config_method_tls& eap::config_method_tls::operator=(_In_ const config_meth
eap::config_method_tls& eap::config_method_tls::operator=(_Inout_ config_method_tls &&other)
{
if (this != &other) {
(config_method&&)*this = std::move(other);
(config_method_with_cred<credentials_tls>&&)*this = std::move(other);
m_trusted_root_ca = std::move(other.m_trusted_root_ca);
m_server_names = std::move(other.m_server_names);
}
@@ -123,7 +123,7 @@ bool eap::config_method_tls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *
assert(pConfigRoot);
assert(ppEapError);
if (!config_method::save(pDoc, pConfigRoot, ppEapError))
if (!config_method_with_cred<credentials_tls>::save(pDoc, pConfigRoot, ppEapError))
return false;
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
@@ -182,7 +182,7 @@ bool eap::config_method_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR
{
assert(pConfigRoot);
if (!config_method::load(pConfigRoot, ppEapError))
if (!config_method_with_cred<credentials_tls>::load(pConfigRoot, ppEapError))
return false;
std::wstring xpath(eapxml::get_xpath(pConfigRoot));
@@ -258,7 +258,7 @@ bool eap::config_method_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR
void eap::config_method_tls::operator<<(_Inout_ cursor_out &cursor) const
{
config_method::operator<<(cursor);
config_method_with_cred<credentials_tls>::operator<<(cursor);
cursor << m_trusted_root_ca;
cursor << m_server_names ;
}
@@ -267,7 +267,7 @@ void eap::config_method_tls::operator<<(_Inout_ cursor_out &cursor) const
size_t eap::config_method_tls::get_pk_size() const
{
return
config_method::get_pk_size() +
config_method_with_cred<credentials_tls>::get_pk_size() +
pksizeof(m_trusted_root_ca) +
pksizeof(m_server_names );
}
@@ -275,18 +275,12 @@ size_t eap::config_method_tls::get_pk_size() const
void eap::config_method_tls::operator>>(_Inout_ cursor_in &cursor)
{
config_method::operator>>(cursor);
config_method_with_cred<credentials_tls>::operator>>(cursor);
cursor >> m_trusted_root_ca;
cursor >> m_server_names ;
}
eap::credentials* eap::config_method_tls::make_credentials() const
{
return new credentials_tls(m_module);
}
eap::type_t eap::config_method_tls::get_method_id() const
{
return type_tls;