From d400901c527201e7a2b3228961559a866c317a27 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 4 Feb 2020 14:59:16 +0100 Subject: [PATCH] Rename peer_tls to peer_tls_base peer_tls is actually not a complete EAP-TLS implementation. Signed-off-by: Simon Rozman --- lib/TLS/include/Module.h | 6 ++--- lib/TLS/src/Method.cpp | 2 +- lib/TLS/src/Module.cpp | 48 +++++++++++++++++++-------------------- lib/TTLS/include/Module.h | 2 +- lib/TTLS/src/Module.cpp | 6 ++--- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/TLS/include/Module.h b/lib/TLS/include/Module.h index 7ea0fc2..4539f01 100644 --- a/lib/TLS/include/Module.h +++ b/lib/TLS/include/Module.h @@ -20,7 +20,7 @@ namespace eap { - class peer_tls; + class peer_tls_base; } #pragma once @@ -38,7 +38,7 @@ namespace eap /// /// TLS tunnel peer /// - class peer_tls : public peer + class peer_tls_base : public peer { public: /// @@ -46,7 +46,7 @@ namespace eap /// /// \param[in] eap_method EAP method type ID /// - peer_tls(_In_ winstd::eap_type_t eap_method = winstd::eap_type_t::tls); + peer_tls_base(_In_ winstd::eap_type_t eap_method = winstd::eap_type_t::tls); virtual void shutdown(); diff --git a/lib/TLS/src/Method.cpp b/lib/TLS/src/Method.cpp index 6dacaa7..5a6f4a2 100644 --- a/lib/TLS/src/Method.cpp +++ b/lib/TLS/src/Method.cpp @@ -579,7 +579,7 @@ void eap::method_tls::get_result( m_cfg.m_last_status = config_method::status_t::success; // Spawn certificate revocation verify thread. - dynamic_cast(m_module).spawn_crl_check(std::move(m_sc_cert)); + dynamic_cast(m_module).spawn_crl_check(std::move(m_sc_cert)); } // Ask EAP host to save the configuration (connection data). diff --git a/lib/TLS/src/Module.cpp b/lib/TLS/src/Module.cpp index 9828610..70420d2 100644 --- a/lib/TLS/src/Module.cpp +++ b/lib/TLS/src/Module.cpp @@ -25,15 +25,15 @@ using namespace winstd; ////////////////////////////////////////////////////////////////////// -// eap::peer_tls +// eap::peer_tls_base ////////////////////////////////////////////////////////////////////// -eap::peer_tls::peer_tls(_In_ eap_type_t eap_method) : peer(eap_method) +eap::peer_tls_base::peer_tls_base(_In_ eap_type_t eap_method) : peer(eap_method) { } -void eap::peer_tls::shutdown() +void eap::peer_tls_base::shutdown() { // Signal all certificate revocation verify threads to abort and wait for them (10sec max). vector chks; @@ -48,7 +48,7 @@ void eap::peer_tls::shutdown() } -void eap::peer_tls::get_identity( +void eap::peer_tls_base::get_identity( _In_ DWORD dwFlags, _In_count_(dwConnectionDataSize) const BYTE *pConnectionData, _In_ DWORD dwConnectionDataSize, @@ -104,7 +104,7 @@ void eap::peer_tls::get_identity( } -void eap::peer_tls::get_method_properties( +void eap::peer_tls_base::get_method_properties( _In_ DWORD dwVersion, _In_ DWORD dwFlags, _In_ HANDLE hUserImpersonationToken, @@ -157,7 +157,7 @@ void eap::peer_tls::get_method_properties( } -void eap::peer_tls::credentials_xml2blob( +void eap::peer_tls_base::credentials_xml2blob( _In_ DWORD dwFlags, _In_ IXMLDOMNode *pConfigRoot, _In_count_(dwConnectionDataSize) const BYTE *pConnectionData, @@ -179,7 +179,7 @@ void eap::peer_tls::credentials_xml2blob( } -EAP_SESSION_HANDLE eap::peer_tls::begin_session( +EAP_SESSION_HANDLE eap::peer_tls_base::begin_session( _In_ DWORD dwFlags, _In_ const EapAttributes *pAttributeArray, _In_ HANDLE hTokenImpersonateUser, @@ -223,7 +223,7 @@ EAP_SESSION_HANDLE eap::peer_tls::begin_session( } -void eap::peer_tls::end_session(_In_ EAP_SESSION_HANDLE hSession) +void eap::peer_tls_base::end_session(_In_ EAP_SESSION_HANDLE hSession) { assert(hSession); @@ -234,7 +234,7 @@ void eap::peer_tls::end_session(_In_ EAP_SESSION_HANDLE hSession) } -void eap::peer_tls::process_request_packet( +void eap::peer_tls_base::process_request_packet( _In_ EAP_SESSION_HANDLE hSession, _In_bytecount_(dwReceivedPacketSize) const EapPacket *pReceivedPacket, _In_ DWORD dwReceivedPacketSize, @@ -247,7 +247,7 @@ void eap::peer_tls::process_request_packet( } -void eap::peer_tls::get_response_packet( +void eap::peer_tls_base::get_response_packet( _In_ EAP_SESSION_HANDLE hSession, _Out_bytecapcount_(*pdwSendPacketSize) EapPacket *pSendPacket, _Inout_ DWORD *pdwSendPacketSize) @@ -263,7 +263,7 @@ void eap::peer_tls::get_response_packet( } -void eap::peer_tls::get_result( +void eap::peer_tls_base::get_result( _In_ EAP_SESSION_HANDLE hSession, _In_ EapPeerMethodResultReason reason, _Inout_ EapPeerMethodResult *pResult) @@ -296,7 +296,7 @@ void eap::peer_tls::get_result( } -void eap::peer_tls::get_ui_context( +void eap::peer_tls_base::get_ui_context( _In_ EAP_SESSION_HANDLE hSession, _Out_ BYTE **ppUIContextData, _Out_ DWORD *pdwUIContextDataSize) @@ -318,7 +318,7 @@ void eap::peer_tls::get_ui_context( } -void eap::peer_tls::set_ui_context( +void eap::peer_tls_base::set_ui_context( _In_ EAP_SESSION_HANDLE hSession, _In_count_(dwUIContextDataSize) const BYTE *pUIContextData, _In_ DWORD dwUIContextDataSize, @@ -332,7 +332,7 @@ void eap::peer_tls::set_ui_context( } -void eap::peer_tls::get_response_attributes( +void eap::peer_tls_base::get_response_attributes( _In_ EAP_SESSION_HANDLE hSession, _Out_ EapAttributes *pAttribs) { @@ -340,7 +340,7 @@ void eap::peer_tls::get_response_attributes( } -void eap::peer_tls::set_response_attributes( +void eap::peer_tls_base::set_response_attributes( _In_ EAP_SESSION_HANDLE hSession, _In_ const EapAttributes *pAttribs, _Out_ EapPeerMethodOutput *pEapOutput) @@ -351,7 +351,7 @@ void eap::peer_tls::set_response_attributes( } -void eap::peer_tls::spawn_crl_check(_Inout_ winstd::cert_context &&cert) +void eap::peer_tls_base::spawn_crl_check(_Inout_ winstd::cert_context &&cert) { // Create the thread and add it to the list. m_crl_checkers.push_back(std::move(crl_checker(*this, std::move(cert)))); @@ -363,10 +363,10 @@ void eap::peer_tls::spawn_crl_check(_Inout_ winstd::cert_context &&cert) ////////////////////////////////////////////////////////////////////// -// eap::peer_tls_tunnel::session +// eap::peer_tls_base::session ////////////////////////////////////////////////////////////////////// -eap::peer_tls::session::session(_In_ module &mod) : +eap::peer_tls_base::session::session(_In_ module &mod) : m_module(mod), m_cfg(mod), m_cred(mod, m_cfg), @@ -378,7 +378,7 @@ eap::peer_tls::session::session(_In_ module &mod) : {} -eap::peer_tls::session::~session() +eap::peer_tls_base::session::~session() { if (m_blob_cfg) m_module.free_memory(m_blob_cfg); @@ -394,10 +394,10 @@ eap::peer_tls::session::~session() ////////////////////////////////////////////////////////////////////// -// eap::peer_tls::crl_checker +// eap::peer_tls_base::crl_checker ////////////////////////////////////////////////////////////////////// -eap::peer_tls::crl_checker::crl_checker(_In_ module &mod, _Inout_ winstd::cert_context &&cert) : +eap::peer_tls_base::crl_checker::crl_checker(_In_ module &mod, _Inout_ winstd::cert_context &&cert) : m_module(mod), m_cert (std::move(cert)), m_abort (CreateEvent(NULL, TRUE, FALSE, NULL)) @@ -405,7 +405,7 @@ eap::peer_tls::crl_checker::crl_checker(_In_ module &mod, _Inout_ winstd::cert_c } -eap::peer_tls::crl_checker::crl_checker(_Inout_ crl_checker &&other) noexcept : +eap::peer_tls_base::crl_checker::crl_checker(_Inout_ crl_checker &&other) noexcept : m_module( other.m_module ), m_thread(std::move(other.m_thread)), m_abort (std::move(other.m_abort )), @@ -414,7 +414,7 @@ eap::peer_tls::crl_checker::crl_checker(_Inout_ crl_checker &&other) noexcept : } -eap::peer_tls::crl_checker& eap::peer_tls::crl_checker::operator=(_Inout_ crl_checker &&other) noexcept +eap::peer_tls_base::crl_checker& eap::peer_tls_base::crl_checker::operator=(_Inout_ crl_checker &&other) noexcept { if (this != std::addressof(other)) { assert(std::addressof(m_module) == std::addressof(other.m_module)); // Move threads within same module only! @@ -427,7 +427,7 @@ eap::peer_tls::crl_checker& eap::peer_tls::crl_checker::operator=(_Inout_ crl_ch } -DWORD WINAPI eap::peer_tls::crl_checker::verify(_In_ crl_checker *obj) +DWORD WINAPI eap::peer_tls_base::crl_checker::verify(_In_ crl_checker *obj) { // Initialize COM. com_initializer com_init(NULL); diff --git a/lib/TTLS/include/Module.h b/lib/TTLS/include/Module.h index d761e35..be0714c 100644 --- a/lib/TTLS/include/Module.h +++ b/lib/TTLS/include/Module.h @@ -42,7 +42,7 @@ namespace eap /// /// TLS tunnel peer /// - class peer_tls_tunnel : public peer_tls + class peer_tls_tunnel : public peer_tls_base { public: /// diff --git a/lib/TTLS/src/Module.cpp b/lib/TTLS/src/Module.cpp index 0fbc249..1876648 100644 --- a/lib/TTLS/src/Module.cpp +++ b/lib/TTLS/src/Module.cpp @@ -32,14 +32,14 @@ using namespace winstd; // eap::peer_tls_tunnel ////////////////////////////////////////////////////////////////////// -eap::peer_tls_tunnel::peer_tls_tunnel(_In_ eap_type_t eap_method) : peer_tls(eap_method) +eap::peer_tls_tunnel::peer_tls_tunnel(_In_ eap_type_t eap_method) : peer_tls_base(eap_method) { } void eap::peer_tls_tunnel::initialize() { - peer_tls::initialize(); + peer_tls_base::initialize(); #if EAP_INNER_EAPHOST // Initialize EapHost based inner authentication methods. @@ -57,7 +57,7 @@ void eap::peer_tls_tunnel::shutdown() EapHostPeerUninitialize(); #endif - peer_tls::shutdown(); + peer_tls_base::shutdown(); }