pack() => operator <<, unpack() => operator >>, get_pk_size() => pksizeof()

This commit is contained in:
2016-07-21 09:20:09 +02:00
parent 51428d290f
commit 627b20aabc
14 changed files with 779 additions and 792 deletions

View File

@@ -141,7 +141,7 @@ namespace eap
///
/// \param[inout] cursor Memory cursor
///
virtual void pack(_Inout_ eapserial::cursor_out &cursor) const;
virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
@@ -155,7 +155,7 @@ namespace eap
///
/// \param[inout] cursor Memory cursor
///
virtual void unpack(_Inout_ eapserial::cursor_in &cursor);
virtual void operator>>(_Inout_ cursor_in &cursor);
/// @}

View File

@@ -137,7 +137,7 @@ namespace eap
///
/// \param[inout] cursor Memory cursor
///
virtual void pack(_Inout_ eapserial::cursor_out &cursor) const;
virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
@@ -151,7 +151,7 @@ namespace eap
///
/// \param[inout] cursor Memory cursor
///
virtual void unpack(_Inout_ eapserial::cursor_in &cursor);
virtual void operator>>(_Inout_ cursor_in &cursor);
/// @}

View File

@@ -87,7 +87,7 @@ eap::config_method_tls::config_method_tls(_Inout_ config_method_tls &&other) :
}
eap::config_method_tls& eap::config_method_tls::operator=(_In_ const eap::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;
@@ -99,7 +99,7 @@ eap::config_method_tls& eap::config_method_tls::operator=(_In_ const eap::config
}
eap::config_method_tls& eap::config_method_tls::operator=(_Inout_ eap::config_method_tls &&other)
eap::config_method_tls& eap::config_method_tls::operator=(_Inout_ config_method_tls &&other)
{
if (this != &other) {
(config_method&&)*this = std::move(other);
@@ -226,7 +226,7 @@ bool eap::config_method_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR
// Log loaded CA certificates.
list<tstring> cert_names;
for (std::list<winstd::cert_context>::const_iterator cert = m_trusted_root_ca.cbegin(), cert_end = m_trusted_root_ca.cend(); cert != cert_end; ++cert)
cert_names.push_back(std::move(eap::get_cert_title(*cert)));
cert_names.push_back(std::move(get_cert_title(*cert)));
m_module.log_config((xpathServerSideCredential + L"/CA").c_str(), cert_names);
}
@@ -256,28 +256,28 @@ bool eap::config_method_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR
}
void eap::config_method_tls::pack(_Inout_ eapserial::cursor_out &cursor) const
void eap::config_method_tls::operator<<(_Inout_ cursor_out &cursor) const
{
eap::config_method::pack(cursor);
eapserial::pack(cursor, m_trusted_root_ca);
eapserial::pack(cursor, m_server_names );
config_method::operator<<(cursor);
cursor << m_trusted_root_ca;
cursor << m_server_names ;
}
size_t eap::config_method_tls::get_pk_size() const
{
return
eap::config_method::get_pk_size() +
eapserial::get_pk_size(m_trusted_root_ca) +
eapserial::get_pk_size(m_server_names );
config_method::get_pk_size() +
pksizeof(m_trusted_root_ca) +
pksizeof(m_server_names );
}
void eap::config_method_tls::unpack(_Inout_ eapserial::cursor_in &cursor)
void eap::config_method_tls::operator>>(_Inout_ cursor_in &cursor)
{
eap::config_method::unpack(cursor);
eapserial::unpack(cursor, m_trusted_root_ca);
eapserial::unpack(cursor, m_server_names );
config_method::operator>>(cursor);
cursor >> m_trusted_root_ca;
cursor >> m_server_names ;
}
@@ -289,7 +289,7 @@ eap::credentials* eap::config_method_tls::make_credentials() const
eap::type_t eap::config_method_tls::get_method_id() const
{
return eap::type_tls;
return type_tls;
}

View File

@@ -167,25 +167,25 @@ bool eap::credentials_tls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR *
}
void eap::credentials_tls::pack(_Inout_ eapserial::cursor_out &cursor) const
void eap::credentials_tls::operator<<(_Inout_ cursor_out &cursor) const
{
eap::credentials::pack(cursor);
eapserial::pack(cursor, m_cert);
credentials::operator<<(cursor);
cursor << m_cert;
}
size_t eap::credentials_tls::get_pk_size() const
{
return
eap::credentials::get_pk_size() +
eapserial::get_pk_size(m_cert);
credentials::get_pk_size() +
pksizeof(m_cert);
}
void eap::credentials_tls::unpack(_Inout_ eapserial::cursor_in &cursor)
void eap::credentials_tls::operator>>(_Inout_ cursor_in &cursor)
{
eap::credentials::unpack(cursor);
eapserial::unpack(cursor, m_cert);
credentials::operator>>(cursor);
cursor >> m_cert;
}
@@ -279,7 +279,7 @@ std::wstring eap::credentials_tls::get_identity() const
tstring eap::credentials_tls::get_name() const
{
return m_cert ? std::move(eap::get_cert_title(m_cert)) : L"<blank>";
return m_cert ? std::move(get_cert_title(m_cert)) : L"<blank>";
}