eap::type_t >> winstd::eap_type_t
This commit is contained in:
parent
22a87bf90d
commit
a102b43a19
@ -23,7 +23,7 @@
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
eap::peer_base<eap::config_method_pap, eap::credentials_pap, void, void> g_module(eap::type_undefined);
|
||||
eap::peer_base<eap::config_method_pap, eap::credentials_pap, void, void> g_module(eap_type_undefined);
|
||||
|
||||
|
||||
static int CredWrite()
|
||||
|
@ -251,9 +251,9 @@ namespace eap
|
||||
///
|
||||
/// Returns EAP method type of this configuration
|
||||
///
|
||||
/// \returns One of `eap::type_t` constants.
|
||||
/// \returns One of `winstd::eap_type_t` constants.
|
||||
///
|
||||
virtual type_t get_method_id() const = 0;
|
||||
virtual winstd::eap_type_t get_method_id() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#if !defined(RC_INVOKED) && !defined(MIDL_PASS)
|
||||
|
||||
#include <WinStd/Crypt.h>
|
||||
#include <WinStd/EAP.h>
|
||||
|
||||
#include <sal.h>
|
||||
|
||||
@ -38,13 +39,6 @@
|
||||
|
||||
namespace eap
|
||||
{
|
||||
///
|
||||
/// EAP method numbers
|
||||
///
|
||||
/// \sa [Extensible Authentication Protocol (EAP) Registry (Chapter: Method Types)](https://www.iana.org/assignments/eap-numbers/eap-numbers.xhtml#eap-numbers-4)
|
||||
///
|
||||
enum type_t;
|
||||
|
||||
///
|
||||
/// Output BLOB cursor
|
||||
///
|
||||
@ -316,7 +310,7 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::cert_contex
|
||||
/// \param[inout] cursor Memory cursor
|
||||
/// \param[in] val EAP method type to pack
|
||||
///
|
||||
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::type_t &val);
|
||||
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const winstd::eap_type_t &val);
|
||||
|
||||
///
|
||||
/// Returns packed size of an EAP method type
|
||||
@ -325,7 +319,7 @@ inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::type_t &
|
||||
///
|
||||
/// \returns Size of data when packed (in bytes)
|
||||
///
|
||||
inline size_t pksizeof(const eap::type_t &val);
|
||||
inline size_t pksizeof(const winstd::eap_type_t &val);
|
||||
|
||||
///
|
||||
/// Unpacks an EAP method type
|
||||
@ -333,22 +327,13 @@ inline size_t pksizeof(const eap::type_t &val);
|
||||
/// \param[inout] cursor Memory cursor
|
||||
/// \param[out] val EAP method type to unpack to
|
||||
///
|
||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::type_t &val);
|
||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::eap_type_t &val);
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
namespace eap
|
||||
{
|
||||
enum type_t {
|
||||
type_undefined = 0, ///< Undefined EAP type
|
||||
type_tls = 13, ///< EAP-TLS
|
||||
type_ttls = 21, ///< EAP-TTLS
|
||||
type_peap = 25, ///< EAP-PEAP
|
||||
type_mschapv2 = 26, ///< EAP-MSCHAPv2
|
||||
type_pap = 192, ///< PAP (Not actually an EAP method; Moved to the Unassigned area)
|
||||
};
|
||||
|
||||
struct cursor_out
|
||||
{
|
||||
typedef unsigned char *ptr_type;
|
||||
@ -680,23 +665,23 @@ inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::cert_contex
|
||||
}
|
||||
|
||||
|
||||
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::type_t &val)
|
||||
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const winstd::eap_type_t &val)
|
||||
{
|
||||
cursor << (unsigned char)val;
|
||||
}
|
||||
|
||||
|
||||
inline size_t pksizeof(_In_ const eap::type_t &val)
|
||||
inline size_t pksizeof(_In_ const winstd::eap_type_t &val)
|
||||
{
|
||||
return pksizeof((unsigned char)val);
|
||||
}
|
||||
|
||||
|
||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::type_t &val)
|
||||
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::eap_type_t &val)
|
||||
{
|
||||
unsigned char t;
|
||||
cursor >> t;
|
||||
val = (eap::type_t)t;
|
||||
val = (winstd::eap_type_t)t;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -66,7 +66,7 @@ namespace eap
|
||||
///
|
||||
/// Constructs a module for the given EAP type
|
||||
///
|
||||
module(_In_ type_t eap_method);
|
||||
module(_In_ winstd::eap_type_t eap_method);
|
||||
|
||||
///
|
||||
/// Destructs the module
|
||||
@ -649,7 +649,7 @@ namespace eap
|
||||
|
||||
public:
|
||||
HINSTANCE m_instance; ///< Windows module instance
|
||||
const type_t m_eap_method; ///< EAP method type
|
||||
const winstd::eap_type_t m_eap_method; ///< EAP method type
|
||||
|
||||
protected:
|
||||
winstd::heap m_heap; ///< Heap
|
||||
@ -685,7 +685,7 @@ namespace eap
|
||||
///
|
||||
/// Constructs a EAP peer module for the given EAP type
|
||||
///
|
||||
peer_base(_In_ type_t eap_method) : module(eap_method) {}
|
||||
peer_base(_In_ winstd::eap_type_t eap_method) : module(eap_method) {}
|
||||
|
||||
///
|
||||
/// Makes a new method config for the given method type
|
||||
@ -704,7 +704,7 @@ namespace eap
|
||||
///
|
||||
/// Constructs a EAP peer module for the given EAP type
|
||||
///
|
||||
peer(_In_ type_t eap_method) : peer_base<_Tmeth, _Tcred, _Tint, _Tintres>(eap_method) {}
|
||||
peer(_In_ winstd::eap_type_t eap_method) : peer_base<_Tmeth, _Tcred, _Tint, _Tintres>(eap_method) {}
|
||||
|
||||
///
|
||||
/// Initializes an EAP peer method for EAPHost.
|
||||
|
@ -429,7 +429,7 @@ bool eap::config_provider::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR *
|
||||
// Check EAP method type (<EAPMethod>).
|
||||
DWORD dwMethodID;
|
||||
if (eapxml::get_element_value(pXmlElMethod, bstr(L"eap-metadata:EAPMethod"), &dwMethodID) == ERROR_SUCCESS) {
|
||||
if ((type_t)dwMethodID != cfg->get_method_id()) {
|
||||
if ((eap_type_t)dwMethodID != cfg->get_method_id()) {
|
||||
// Wrong type.
|
||||
continue;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ using namespace winstd;
|
||||
// eap::module
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::module::module(type_t eap_method) :
|
||||
eap::module::module(eap_type_t eap_method) :
|
||||
m_eap_method(eap_method),
|
||||
m_instance(NULL)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ namespace eap
|
||||
///
|
||||
/// Constructs a EAP UI peer module for the given EAP type
|
||||
///
|
||||
peer_ui(_In_ type_t eap_method) : peer_base<_Tmeth, _Tcred, _Tint, _Tintres>(eap_method) {}
|
||||
peer_ui(_In_ winstd::eap_type_t eap_method) : peer_base<_Tmeth, _Tcred, _Tint, _Tintres>(eap_method) {}
|
||||
|
||||
///
|
||||
/// Raises the EAP method's specific connection configuration user interface dialog on the client.
|
||||
|
@ -94,6 +94,6 @@ namespace eap
|
||||
///
|
||||
/// \returns `eap::type_pap`
|
||||
///
|
||||
virtual eap::type_t get_method_id() const;
|
||||
virtual winstd::eap_type_t get_method_id() const;
|
||||
};
|
||||
}
|
||||
|
@ -20,6 +20,9 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace winstd;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::config_method_pap
|
||||
@ -66,7 +69,7 @@ eap::config* eap::config_method_pap::clone() const
|
||||
}
|
||||
|
||||
|
||||
eap::type_t eap::config_method_pap::get_method_id() const
|
||||
eap_type_t eap::config_method_pap::get_method_id() const
|
||||
{
|
||||
return eap::type_pap;
|
||||
return eap_type_pap;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ namespace eap
|
||||
///
|
||||
/// \returns `eap::type_tls`
|
||||
///
|
||||
virtual eap::type_t get_method_id() const;
|
||||
virtual winstd::eap_type_t get_method_id() const;
|
||||
|
||||
///
|
||||
/// Adds CA to the list of trusted root CA's
|
||||
|
@ -281,9 +281,9 @@ void eap::config_method_tls::operator>>(_Inout_ cursor_in &cursor)
|
||||
}
|
||||
|
||||
|
||||
eap::type_t eap::config_method_tls::get_method_id() const
|
||||
eap_type_t eap::config_method_tls::get_method_id() const
|
||||
{
|
||||
return type_tls;
|
||||
return eap_type_tls;
|
||||
}
|
||||
|
||||
|
||||
|
@ -148,7 +148,7 @@ namespace eap {
|
||||
///
|
||||
/// \returns `eap::type_ttls`
|
||||
///
|
||||
virtual eap::type_t get_method_id() const;
|
||||
virtual winstd::eap_type_t get_method_id() const;
|
||||
|
||||
///
|
||||
/// Generates public identity using current configuration and given credentials
|
||||
|
@ -206,14 +206,14 @@ void eap::config_method_ttls::operator<<(_Inout_ cursor_out &cursor) const
|
||||
|
||||
if (m_inner) {
|
||||
if (dynamic_cast<config_method_pap*>(m_inner.get())) {
|
||||
cursor << type_pap;
|
||||
cursor << eap_type_pap;
|
||||
cursor << *m_inner;
|
||||
} else {
|
||||
assert(0); // Unsupported inner authentication method type.
|
||||
cursor << type_undefined;
|
||||
cursor << eap_type_undefined;
|
||||
}
|
||||
} else
|
||||
cursor << type_undefined;
|
||||
cursor << eap_type_undefined;
|
||||
|
||||
cursor << m_anonymous_identity;
|
||||
}
|
||||
@ -225,14 +225,14 @@ size_t eap::config_method_ttls::get_pk_size() const
|
||||
if (m_inner) {
|
||||
if (dynamic_cast<config_method_pap*>(m_inner.get())) {
|
||||
size_inner =
|
||||
pksizeof(type_pap) +
|
||||
pksizeof(eap_type_pap) +
|
||||
pksizeof(*m_inner);
|
||||
} else {
|
||||
assert(0); // Unsupported inner authentication method type.
|
||||
size_inner = pksizeof(type_undefined);
|
||||
size_inner = pksizeof(eap_type_undefined);
|
||||
}
|
||||
} else
|
||||
size_inner = pksizeof(type_undefined);
|
||||
size_inner = pksizeof(eap_type_undefined);
|
||||
|
||||
return
|
||||
config_method::get_pk_size() +
|
||||
@ -247,10 +247,10 @@ void eap::config_method_ttls::operator>>(_Inout_ cursor_in &cursor)
|
||||
config_method::operator>>(cursor);
|
||||
cursor >> m_outer;
|
||||
|
||||
type_t eap_type;
|
||||
eap_type_t eap_type;
|
||||
cursor >> eap_type;
|
||||
switch (eap_type) {
|
||||
case type_pap:
|
||||
case eap_type_pap:
|
||||
m_inner.reset(new config_method_pap(m_module));
|
||||
cursor >> *m_inner;
|
||||
break;
|
||||
@ -263,9 +263,9 @@ void eap::config_method_ttls::operator>>(_Inout_ cursor_in &cursor)
|
||||
}
|
||||
|
||||
|
||||
eap::type_t eap::config_method_ttls::get_method_id() const
|
||||
eap_type_t eap::config_method_ttls::get_method_id() const
|
||||
{
|
||||
return type_ttls;
|
||||
return eap_type_ttls;
|
||||
}
|
||||
|
||||
|
||||
|
@ -167,14 +167,14 @@ void eap::credentials_ttls::operator<<(_Inout_ cursor_out &cursor) const
|
||||
cursor << m_outer;
|
||||
if (m_inner) {
|
||||
if (dynamic_cast<credentials_pap*>(m_inner.get())) {
|
||||
cursor << type_pap;
|
||||
cursor << eap_type_pap;
|
||||
cursor << *m_inner;
|
||||
} else {
|
||||
assert(0); // Unsupported inner authentication method type.
|
||||
cursor << type_undefined;
|
||||
cursor << eap_type_undefined;
|
||||
}
|
||||
} else
|
||||
cursor << type_undefined;
|
||||
cursor << eap_type_undefined;
|
||||
}
|
||||
|
||||
|
||||
@ -184,14 +184,14 @@ size_t eap::credentials_ttls::get_pk_size() const
|
||||
if (m_inner) {
|
||||
if (dynamic_cast<credentials_pap*>(m_inner.get())) {
|
||||
size_inner =
|
||||
pksizeof(type_pap) +
|
||||
pksizeof(eap_type_pap) +
|
||||
pksizeof(*m_inner);
|
||||
} else {
|
||||
assert(0); // Unsupported inner authentication method type.
|
||||
size_inner = pksizeof(type_undefined);
|
||||
size_inner = pksizeof(eap_type_undefined);
|
||||
}
|
||||
} else
|
||||
size_inner = pksizeof(type_undefined);
|
||||
size_inner = pksizeof(eap_type_undefined);
|
||||
|
||||
return
|
||||
credentials::get_pk_size() +
|
||||
@ -205,10 +205,10 @@ void eap::credentials_ttls::operator>>(_Inout_ cursor_in &cursor)
|
||||
credentials::operator>>(cursor);
|
||||
cursor >> m_outer;
|
||||
|
||||
type_t eap_type;
|
||||
eap_type_t eap_type;
|
||||
cursor >> eap_type;
|
||||
switch (eap_type) {
|
||||
case type_pap:
|
||||
case eap_type_pap:
|
||||
m_inner.reset(new credentials_pap(m_module));
|
||||
cursor >> *m_inner;
|
||||
break;
|
||||
|
@ -28,7 +28,7 @@ using namespace winstd;
|
||||
// eap::peer_ttls
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::peer_ttls::peer_ttls() : peer<config_method_ttls, credentials_ttls, bool, bool>(type_ttls)
|
||||
eap::peer_ttls::peer_ttls() : peer<config_method_ttls, credentials_ttls, bool, bool>(eap_type_ttls)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
// eap::peer_ttls_ui
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::peer_ttls_ui::peer_ttls_ui() : peer_ui<eap::config_method_ttls, eap::credentials_ttls, bool, bool>(type_ttls)
|
||||
eap::peer_ttls_ui::peer_ttls_ui() : peer_ui<eap::config_method_ttls, eap::credentials_ttls, bool, bool>(winstd::eap_type_ttls)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 431c7d99603d0457d586d7d722e3cad27ff42dd4
|
||||
Subproject commit 4b63d60b01c7f579f4da2d5d61bb766813884a9f
|
Loading…
x
Reference in New Issue
Block a user