credentials_ttls is descendant of credentials_tls again
This commit is contained in:
@@ -29,24 +29,21 @@ using namespace winstd;
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::credentials_ttls::credentials_ttls(_In_ module &mod) :
|
||||
m_outer(mod),
|
||||
credentials(mod)
|
||||
credentials_tls(mod)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_ttls::credentials_ttls(_In_ const credentials_ttls &other) :
|
||||
m_outer(other.m_outer),
|
||||
m_inner(other.m_inner ? (credentials*)other.m_inner->clone() : nullptr),
|
||||
credentials(other)
|
||||
credentials_tls(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::credentials_ttls::credentials_ttls(_Inout_ credentials_ttls &&other) :
|
||||
m_outer(std::move(other.m_outer)),
|
||||
m_inner(std::move(other.m_inner)),
|
||||
credentials(std::move(other))
|
||||
credentials_tls(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -54,8 +51,7 @@ eap::credentials_ttls::credentials_ttls(_Inout_ credentials_ttls &&other) :
|
||||
eap::credentials_ttls& eap::credentials_ttls::operator=(_In_ const credentials_ttls &other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(credentials&)*this = other;
|
||||
m_outer = other.m_outer;
|
||||
(credentials_tls&)*this = other;
|
||||
m_inner.reset(other.m_inner ? (credentials*)other.m_inner->clone() : nullptr);
|
||||
}
|
||||
|
||||
@@ -66,9 +62,8 @@ eap::credentials_ttls& eap::credentials_ttls::operator=(_In_ const credentials_t
|
||||
eap::credentials_ttls& eap::credentials_ttls::operator=(_Inout_ credentials_ttls &&other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(credentials&)*this = std::move(other);
|
||||
m_outer = std::move(other.m_outer);
|
||||
m_inner = std::move(other.m_inner);
|
||||
(credentials_tls&)*this = std::move(other);
|
||||
m_inner = std::move(other.m_inner);
|
||||
}
|
||||
|
||||
return *this;
|
||||
@@ -83,8 +78,7 @@ eap::config* eap::credentials_ttls::clone() const
|
||||
|
||||
void eap::credentials_ttls::clear()
|
||||
{
|
||||
credentials::clear();
|
||||
m_outer.clear();
|
||||
credentials_tls::clear();
|
||||
if (m_inner)
|
||||
m_inner->clear();
|
||||
}
|
||||
@@ -92,7 +86,7 @@ void eap::credentials_ttls::clear()
|
||||
|
||||
bool eap::credentials_ttls::empty() const
|
||||
{
|
||||
return credentials::empty() && m_outer.empty() && (!m_inner || m_inner->empty());
|
||||
return credentials_tls::empty() && (!m_inner || m_inner->empty());
|
||||
}
|
||||
|
||||
|
||||
@@ -101,9 +95,7 @@ void eap::credentials_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *p
|
||||
assert(pDoc);
|
||||
assert(pConfigRoot);
|
||||
|
||||
credentials::save(pDoc, pConfigRoot);
|
||||
|
||||
m_outer.save(pDoc, pConfigRoot);
|
||||
credentials_tls::save(pDoc, pConfigRoot);
|
||||
|
||||
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||
HRESULT hr;
|
||||
@@ -127,9 +119,7 @@ void eap::credentials_ttls::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
assert(pConfigRoot);
|
||||
HRESULT hr;
|
||||
|
||||
credentials::load(pConfigRoot);
|
||||
|
||||
m_outer.load(pConfigRoot);
|
||||
credentials_tls::load(pConfigRoot);
|
||||
|
||||
// TODO: For the time being, there is no detection what type is inner method. Introduce one!
|
||||
if (m_inner) {
|
||||
@@ -144,8 +134,7 @@ void eap::credentials_ttls::load(_In_ IXMLDOMNode *pConfigRoot)
|
||||
|
||||
void eap::credentials_ttls::operator<<(_Inout_ cursor_out &cursor) const
|
||||
{
|
||||
credentials::operator<<(cursor);
|
||||
cursor << m_outer;
|
||||
credentials_tls::operator<<(cursor);
|
||||
if (m_inner) {
|
||||
if (dynamic_cast<credentials_pap*>(m_inner.get())) {
|
||||
cursor << eap_type_pap;
|
||||
@@ -175,16 +164,14 @@ size_t eap::credentials_ttls::get_pk_size() const
|
||||
size_inner = pksizeof(eap_type_undefined);
|
||||
|
||||
return
|
||||
credentials::get_pk_size() +
|
||||
pksizeof(m_outer) +
|
||||
credentials_tls::get_pk_size() +
|
||||
size_inner;
|
||||
}
|
||||
|
||||
|
||||
void eap::credentials_ttls::operator>>(_Inout_ cursor_in &cursor)
|
||||
{
|
||||
credentials::operator>>(cursor);
|
||||
cursor >> m_outer;
|
||||
credentials_tls::operator>>(cursor);
|
||||
|
||||
eap_type_t eap_type;
|
||||
cursor >> eap_type;
|
||||
@@ -202,7 +189,7 @@ void eap::credentials_ttls::operator>>(_Inout_ cursor_in &cursor)
|
||||
|
||||
void eap::credentials_ttls::store(_In_ LPCTSTR pszTargetName) const
|
||||
{
|
||||
m_outer.store(pszTargetName);
|
||||
credentials_tls::store(pszTargetName);
|
||||
|
||||
if (m_inner)
|
||||
m_inner->store(pszTargetName);
|
||||
@@ -211,7 +198,7 @@ void eap::credentials_ttls::store(_In_ LPCTSTR pszTargetName) const
|
||||
|
||||
void eap::credentials_ttls::retrieve(_In_ LPCTSTR pszTargetName)
|
||||
{
|
||||
m_outer.retrieve(pszTargetName);
|
||||
credentials_tls::retrieve(pszTargetName);
|
||||
|
||||
if (m_inner)
|
||||
m_inner->retrieve(pszTargetName);
|
||||
@@ -228,8 +215,8 @@ LPCTSTR eap::credentials_ttls::target_suffix() const
|
||||
std::wstring eap::credentials_ttls::get_identity() const
|
||||
{
|
||||
// Outer identity has the right-of-way.
|
||||
if (!m_outer.empty())
|
||||
return m_outer.get_identity();
|
||||
if (!credentials_tls::empty())
|
||||
return credentials_tls::get_identity();
|
||||
|
||||
// Inner identity.
|
||||
if (m_inner)
|
||||
|
Reference in New Issue
Block a user