165 lines
6.4 KiB
C++
165 lines
6.4 KiB
C++
/*
|
|
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/>.
|
|
*/
|
|
|
|
namespace eap
|
|
{
|
|
///
|
|
/// EAP session
|
|
///
|
|
class session;
|
|
}
|
|
|
|
#pragma once
|
|
|
|
#include <Windows.h>
|
|
#include <eaptypes.h> // Must include after <Windows.h>
|
|
extern "C" {
|
|
#include <eapmethodpeerapis.h>
|
|
}
|
|
#include <sal.h>
|
|
|
|
|
|
namespace eap
|
|
{
|
|
class session
|
|
{
|
|
public:
|
|
///
|
|
/// Constructs a session
|
|
///
|
|
session();
|
|
|
|
///
|
|
/// Destructs the session
|
|
///
|
|
virtual ~session();
|
|
|
|
/// \name Session start/end
|
|
/// @{
|
|
|
|
///
|
|
/// Starts an EAP authentication session on the peer EAPHost using the EAP method.
|
|
///
|
|
/// \sa [EapPeerBeginSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363600.aspx)
|
|
///
|
|
virtual DWORD begin(
|
|
_In_ DWORD dwFlags,
|
|
_In_ const EapAttributes *pAttributeArray,
|
|
_In_ HANDLE hTokenImpersonateUser,
|
|
_In_ DWORD dwConnectionDataSize,
|
|
_In_count_(dwConnectionDataSize) const BYTE *pConnectionData,
|
|
_In_ DWORD dwUserDataSize,
|
|
_In_count_(dwUserDataSize) const BYTE *pUserData,
|
|
_In_ DWORD dwMaxSendPacketSize,
|
|
_Out_ EAP_ERROR **ppEapError);
|
|
|
|
///
|
|
/// Ends an EAP authentication session for the EAP method.
|
|
///
|
|
/// \sa [EapPeerEndSession function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363604.aspx)
|
|
///
|
|
virtual DWORD end(_Out_ EAP_ERROR **ppEapError);
|
|
|
|
/// @}
|
|
|
|
/// \name Packet processing
|
|
/// @{
|
|
|
|
///
|
|
/// Processes a packet received by EAPHost from a supplicant.
|
|
///
|
|
/// \sa [EapPeerProcessRequestPacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363621.aspx)
|
|
///
|
|
virtual DWORD process_request_packet(
|
|
_In_ DWORD dwReceivedPacketSize,
|
|
_In_bytecount_(dwReceivedPacketSize) const EapPacket *pReceivedPacket,
|
|
_Out_ EapPeerMethodOutput *pEapOutput,
|
|
_Out_ EAP_ERROR **ppEapError);
|
|
|
|
///
|
|
/// Obtains a response packet from the EAP method.
|
|
///
|
|
/// \sa [EapPeerGetResponsePacket function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363610.aspx)
|
|
///
|
|
virtual DWORD get_response_packet(
|
|
_Inout_ DWORD *pdwSendPacketSize,
|
|
_Inout_bytecap_(*dwSendPacketSize) EapPacket *pSendPacket,
|
|
_Out_ EAP_ERROR **ppEapError);
|
|
|
|
///
|
|
/// Obtains the result of an authentication session from the EAP method.
|
|
///
|
|
/// \sa [EapPeerGetResult function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363611.aspx)
|
|
///
|
|
virtual DWORD get_result(_In_ EapPeerMethodResultReason reason, _Out_ EapPeerMethodResult *ppResult, _Out_ EAP_ERROR **ppEapError);
|
|
|
|
/// @}
|
|
|
|
/// \name UI interaction
|
|
/// @{
|
|
|
|
///
|
|
/// Obtains the user interface context from the EAP method.
|
|
///
|
|
/// \note This function is always followed by the `EapPeerInvokeInteractiveUI()` function, which is followed by the `EapPeerSetUIContext()` function.
|
|
///
|
|
/// \sa [EapPeerGetUIContext function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363612.aspx)
|
|
///
|
|
virtual DWORD get_ui_context(
|
|
_Out_ DWORD *pdwUIContextDataSize,
|
|
_Out_ BYTE **ppUIContextData,
|
|
_Out_ EAP_ERROR **ppEapError);
|
|
|
|
///
|
|
/// Provides a user interface context to the EAP method.
|
|
///
|
|
/// \note This function is called after the UI has been raised through the `EapPeerGetUIContext()` function.
|
|
///
|
|
/// \sa [EapPeerSetUIContext function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363626.aspx)
|
|
///
|
|
virtual DWORD set_ui_context(
|
|
_In_ DWORD dwUIContextDataSize,
|
|
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
|
|
_In_ const EapPeerMethodOutput *pEapOutput,
|
|
_Out_ EAP_ERROR **ppEapError);
|
|
|
|
/// @}
|
|
|
|
/// \name Response attributes
|
|
/// @{
|
|
|
|
///
|
|
/// Obtains an array of EAP response attributes from the EAP method.
|
|
///
|
|
/// \sa [EapPeerGetResponseAttributes function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363609.aspx)
|
|
///
|
|
virtual DWORD get_response_attributes(_Out_ EapAttributes *pAttribs, _Out_ EAP_ERROR **ppEapError);
|
|
|
|
///
|
|
/// Provides an updated array of EAP response attributes to the EAP method.
|
|
///
|
|
/// \sa [EapPeerSetResponseAttributes function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363625.aspx)
|
|
///
|
|
virtual DWORD set_response_attributes(const _In_ EapAttributes *pAttribs, _Out_ EapPeerMethodOutput *pEapOutput, _Out_ EAP_ERROR **ppEapError);
|
|
|
|
/// @}
|
|
};
|
|
}
|