eap::ui_context_ttls introduced
This commit is contained in:
parent
dd3da2f41a
commit
27ae8baf3a
@ -83,6 +83,7 @@
|
||||
<ClInclude Include="..\include\Credentials.h" />
|
||||
<ClInclude Include="..\include\Method.h" />
|
||||
<ClInclude Include="..\include\Module.h" />
|
||||
<ClInclude Include="..\include\UIContext.h" />
|
||||
<ClInclude Include="..\src\StdAfx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -96,6 +97,7 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\UIContext.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Events\build\Events.vcxproj">
|
||||
|
@ -26,6 +26,9 @@
|
||||
<ClInclude Include="..\include\Module.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\UIContext.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\StdAfx.cpp">
|
||||
@ -43,5 +46,8 @@
|
||||
<ClCompile Include="..\src\Module.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\UIContext.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
102
lib/TTLS/include/UIContext.h
Normal file
102
lib/TTLS/include/UIContext.h
Normal file
@ -0,0 +1,102 @@
|
||||
/*
|
||||
Copyright 2015-2017 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_ttls;
|
||||
}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../EAPBase/include/UIContext.h"
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
/// \addtogroup EAPBaseUICtx
|
||||
/// @{
|
||||
|
||||
///
|
||||
/// EAP-TTLS UI context
|
||||
///
|
||||
class ui_context_ttls : public ui_context
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs context
|
||||
///
|
||||
/// \param[in] mod EAP module to use for global services
|
||||
/// \param[in] cfg Connection configuration
|
||||
/// \param[in] cred Connection credentials
|
||||
///
|
||||
ui_context_ttls(_In_ module &mod, _In_ config_connection &cfg, _In_ credentials_connection &cred);
|
||||
|
||||
///
|
||||
/// Copies context
|
||||
///
|
||||
/// \param[in] other Credentials to copy from
|
||||
///
|
||||
ui_context_ttls(_In_ const ui_context_ttls &other);
|
||||
|
||||
///
|
||||
/// Moves context
|
||||
///
|
||||
/// \param[in] other Credentials to move from
|
||||
///
|
||||
ui_context_ttls(_Inout_ ui_context_ttls &&other);
|
||||
|
||||
///
|
||||
/// Copies context
|
||||
///
|
||||
/// \param[in] other Credentials to copy from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
ui_context_ttls& operator=(_In_ const ui_context_ttls &other);
|
||||
|
||||
///
|
||||
/// Moves context
|
||||
///
|
||||
/// \param[in] other Configuration to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
ui_context_ttls& operator=(_Inout_ ui_context_ttls &&other);
|
||||
|
||||
///
|
||||
/// Clones this object
|
||||
///
|
||||
/// \returns Pointer to cloned object with identical data
|
||||
///
|
||||
virtual config* clone() const;
|
||||
|
||||
/// \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
|
||||
};
|
||||
|
||||
/// @}
|
||||
}
|
@ -24,6 +24,7 @@
|
||||
#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"
|
||||
|
97
lib/TTLS/src/UIContext.cpp
Normal file
97
lib/TTLS/src/UIContext.cpp
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
Copyright 2015-2016 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_ttls
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::ui_context_ttls::ui_context_ttls(_In_ module &mod, _In_ config_connection &cfg, _In_ credentials_connection &cred) :
|
||||
ui_context(mod, cfg, cred)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::ui_context_ttls::ui_context_ttls(_In_ const ui_context_ttls &other) :
|
||||
ui_context(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::ui_context_ttls::ui_context_ttls(_Inout_ ui_context_ttls &&other) :
|
||||
m_data (std::move(other.m_data)),
|
||||
ui_context(std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::ui_context_ttls& eap::ui_context_ttls::operator=(_In_ const ui_context_ttls &other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(ui_context&)*this = other;
|
||||
m_data = other.m_data;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::ui_context_ttls& eap::ui_context_ttls::operator=(_Inout_ ui_context_ttls &&other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(ui_context&)*this = std::move(other );
|
||||
m_data = std::move(other.m_data);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
eap::config* eap::ui_context_ttls::clone() const
|
||||
{
|
||||
return new ui_context_ttls(*this);
|
||||
}
|
||||
|
||||
|
||||
void eap::ui_context_ttls::operator<<(_Inout_ cursor_out &cursor) const
|
||||
{
|
||||
ui_context::operator<<(cursor);
|
||||
cursor << m_data;
|
||||
}
|
||||
|
||||
|
||||
size_t eap::ui_context_ttls::get_pk_size() const
|
||||
{
|
||||
return
|
||||
ui_context::get_pk_size() +
|
||||
pksizeof(m_data);
|
||||
}
|
||||
|
||||
|
||||
void eap::ui_context_ttls::operator>>(_Inout_ cursor_in &cursor)
|
||||
{
|
||||
ui_context::operator>>(cursor);
|
||||
cursor >> m_data;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user