ui_context: Merge with ui_context_tls_tunnel

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
2020-02-04 11:18:06 +01:00
parent bef455e5a6
commit c40f71462f
10 changed files with 13 additions and 201 deletions

View File

@@ -106,7 +106,6 @@
<ClInclude Include="..\include\Method.h" />
<ClInclude Include="..\include\Module.h" />
<ClInclude Include="..\include\TTLS.h" />
<ClInclude Include="..\include\UIContext.h" />
<ClInclude Include="..\src\StdAfx.h" />
</ItemGroup>
<ItemGroup>
@@ -117,7 +116,6 @@
<ClCompile Include="..\src\StdAfx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\src\UIContext.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Events\build\Events.vcxproj">

View File

@@ -26,9 +26,6 @@
<ClInclude Include="..\include\Module.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\UIContext.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\TTLS.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -49,8 +46,5 @@
<ClCompile Include="..\src\Module.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\UIContext.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,96 +0,0 @@
/*
Copyright 2015-2020 Amebis
Copyright 2016-2017 GÉANT
This file is part of GÉANTLink.
GÉANTLink is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GÉANTLink is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
*/
namespace eap
{
class ui_context_tls_tunnel;
}
#pragma once
#include "TTLS.h"
#include "../../EAPBase/include/UIContext.h"
namespace eap
{
/// \addtogroup EAPBaseUICtx
/// @{
///
/// TLS tunnel UI context
///
class ui_context_tls_tunnel : public ui_context
{
public:
///
/// Constructs context
///
/// \param[in] cfg Connection configuration
/// \param[in] cred Connection credentials
///
ui_context_tls_tunnel(_In_ config_connection &cfg, _In_ credentials_connection &cred);
///
/// Copies context
///
/// \param[in] other Credentials to copy from
///
ui_context_tls_tunnel(_In_ const ui_context_tls_tunnel &other);
///
/// Moves context
///
/// \param[in] other Credentials to move from
///
ui_context_tls_tunnel(_Inout_ ui_context_tls_tunnel &&other) noexcept;
///
/// Copies context
///
/// \param[in] other Credentials to copy from
///
/// \returns Reference to this object
///
ui_context_tls_tunnel& operator=(_In_ const ui_context_tls_tunnel &other);
///
/// Moves context
///
/// \param[in] other Configuration to move from
///
/// \returns Reference to this object
///
ui_context_tls_tunnel& operator=(_Inout_ ui_context_tls_tunnel &&other) noexcept;
/// \name BLOB management
/// @{
virtual void operator<<(_Inout_ cursor_out &cursor) const;
virtual size_t get_pk_size() const;
virtual void operator>>(_Inout_ cursor_in &cursor);
/// @}
public:
sanitizing_blob m_data; ///< Context data
};
/// @}
}

View File

@@ -334,7 +334,7 @@ void eap::peer_tls_tunnel::get_ui_context(
auto s = static_cast<session*>(hSession);
// Get context data from method.
ui_context_tls_tunnel ctx(s->m_cfg, s->m_cred);
ui_context ctx(s->m_cfg, s->m_cred);
s->m_method->get_ui_context(ctx.m_data);
// Pack context data.

View File

@@ -26,7 +26,6 @@
#include "../include/Credentials.h"
#include "../include/Method.h"
#include "../include/Module.h"
#include "../include/UIContext.h"
#include "../../PAP/include/Config.h"
#include "../../PAP/include/Method.h"
@@ -42,6 +41,7 @@
#include "../../EapHost/include/Method.h"
#include "../../EAPBase/include/EAPXML.h"
#include "../../EAPBase/include/UIContext.h"
#include <WinStd/EAP.h>

View File

@@ -1,92 +0,0 @@
/*
Copyright 2015-2020 Amebis
Copyright 2016 GÉANT
This file is part of GÉANTLink.
GÉANTLink is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GÉANTLink is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
*/
#include "StdAfx.h"
using namespace std;
using namespace winstd;
//////////////////////////////////////////////////////////////////////
// eap::ui_context_tls_tunnel
//////////////////////////////////////////////////////////////////////
eap::ui_context_tls_tunnel::ui_context_tls_tunnel(_In_ config_connection &cfg, _In_ credentials_connection &cred) :
ui_context(cfg, cred)
{
}
eap::ui_context_tls_tunnel::ui_context_tls_tunnel(_In_ const ui_context_tls_tunnel &other) :
m_data (other.m_data),
ui_context(other )
{
}
eap::ui_context_tls_tunnel::ui_context_tls_tunnel(_Inout_ ui_context_tls_tunnel &&other) noexcept :
m_data (std::move(other.m_data)),
ui_context(std::move(other ))
{
}
eap::ui_context_tls_tunnel& eap::ui_context_tls_tunnel::operator=(_In_ const ui_context_tls_tunnel &other)
{
if (this != &other) {
(ui_context&)*this = other;
m_data = other.m_data;
}
return *this;
}
eap::ui_context_tls_tunnel& eap::ui_context_tls_tunnel::operator=(_Inout_ ui_context_tls_tunnel &&other) noexcept
{
if (this != &other) {
(ui_context&)*this = std::move(other );
m_data = std::move(other.m_data);
}
return *this;
}
void eap::ui_context_tls_tunnel::operator<<(_Inout_ cursor_out &cursor) const
{
ui_context::operator<<(cursor);
cursor << m_data;
}
size_t eap::ui_context_tls_tunnel::get_pk_size() const
{
return
ui_context::get_pk_size() +
pksizeof(m_data);
}
void eap::ui_context_tls_tunnel::operator>>(_Inout_ cursor_in &cursor)
{
ui_context::operator>>(cursor);
cursor >> m_data;
}