eap::method_property => winstd::eap_method_prop

This commit is contained in:
Simon Rozman 2016-08-03 15:09:58 +02:00
parent cb24fbd6a3
commit 3e82b7df49
4 changed files with 23 additions and 75 deletions

View File

@ -40,11 +40,6 @@ namespace eap
/// A group of methods all EAP peers must or should implement. /// A group of methods all EAP peers must or should implement.
/// ///
template <class _Tmeth, class _Tcred, class _Tint, class _Tintres> class peer; template <class _Tmeth, class _Tcred, class _Tint, class _Tintres> class peer;
///
/// EAP_METHOD_PROPERTY helper
///
class method_property;
} }
#pragma once #pragma once
@ -894,53 +889,4 @@ namespace eap
return false; return false;
} }
}; };
class method_property : public EAP_METHOD_PROPERTY
{
public:
///
/// Constructs a BOOL method property
///
/// \param[in] type EAP method property type
/// \param[in] value Property value
///
inline method_property(_In_ EAP_METHOD_PROPERTY_TYPE type, _In_ BOOL value)
{
eapMethodPropertyType = type;
eapMethodPropertyValueType = empvtBool;
eapMethodPropertyValue.empvBool.length = sizeof(BOOL);
eapMethodPropertyValue.empvBool.value = value;
}
///
/// Constructs a DWORD method property
///
/// \param[in] type EAP method property type
/// \param[in] value Property value
///
inline method_property(_In_ EAP_METHOD_PROPERTY_TYPE type, _In_ DWORD value)
{
eapMethodPropertyType = type;
eapMethodPropertyValueType = empvtDword;
eapMethodPropertyValue.empvDword.length = sizeof(DWORD);
eapMethodPropertyValue.empvDword.value = value;
}
///
/// Constructs a Unicode string method property
///
/// \param[in] type EAP method property type
/// \param[in] value Property value
///
inline method_property(_In_ EAP_METHOD_PROPERTY_TYPE type, _In_z_ LPCWSTR value)
{
eapMethodPropertyType = type;
eapMethodPropertyValueType = empvtString;
eapMethodPropertyValue.empvString.length = (DWORD)(sizeof(WCHAR)*(wcslen(value) + 1));
eapMethodPropertyValue.empvString.value = (BYTE*)value;
}
};
} }

View File

@ -222,26 +222,26 @@ bool eap::peer_ttls::get_method_properties(
vector<EAP_METHOD_PROPERTY> properties; vector<EAP_METHOD_PROPERTY> properties;
properties.reserve(20); properties.reserve(20);
properties.push_back(eap::method_property(emptPropCipherSuiteNegotiation, TRUE)); properties.push_back(eap_method_prop(emptPropCipherSuiteNegotiation, TRUE));
properties.push_back(eap::method_property(emptPropMutualAuth, TRUE)); properties.push_back(eap_method_prop(emptPropMutualAuth, TRUE));
properties.push_back(eap::method_property(emptPropIntegrity, TRUE)); properties.push_back(eap_method_prop(emptPropIntegrity, TRUE));
properties.push_back(eap::method_property(emptPropReplayProtection, TRUE)); properties.push_back(eap_method_prop(emptPropReplayProtection, TRUE));
properties.push_back(eap::method_property(emptPropConfidentiality, TRUE)); properties.push_back(eap_method_prop(emptPropConfidentiality, TRUE));
properties.push_back(eap::method_property(emptPropKeyDerivation, TRUE)); properties.push_back(eap_method_prop(emptPropKeyDerivation, TRUE));
properties.push_back(eap::method_property(emptPropKeyStrength128, TRUE)); properties.push_back(eap_method_prop(emptPropKeyStrength128, TRUE));
properties.push_back(eap::method_property(emptPropDictionaryAttackResistance, TRUE)); properties.push_back(eap_method_prop(emptPropDictionaryAttackResistance, TRUE));
properties.push_back(eap::method_property(emptPropFastReconnect, TRUE)); properties.push_back(eap_method_prop(emptPropFastReconnect, TRUE));
properties.push_back(eap::method_property(emptPropCryptoBinding, TRUE)); properties.push_back(eap_method_prop(emptPropCryptoBinding, TRUE));
properties.push_back(eap::method_property(emptPropSessionIndependence, TRUE)); properties.push_back(eap_method_prop(emptPropSessionIndependence, TRUE));
properties.push_back(eap::method_property(emptPropFragmentation, TRUE)); properties.push_back(eap_method_prop(emptPropFragmentation, TRUE));
properties.push_back(eap::method_property(emptPropStandalone, TRUE)); properties.push_back(eap_method_prop(emptPropStandalone, TRUE));
properties.push_back(eap::method_property(emptPropMppeEncryption, TRUE)); properties.push_back(eap_method_prop(emptPropMppeEncryption, TRUE));
properties.push_back(eap::method_property(emptPropTunnelMethod, TRUE)); properties.push_back(eap_method_prop(emptPropTunnelMethod, TRUE));
properties.push_back(eap::method_property(emptPropSupportsConfig, TRUE)); properties.push_back(eap_method_prop(emptPropSupportsConfig, TRUE));
properties.push_back(eap::method_property(emptPropMachineAuth, TRUE)); properties.push_back(eap_method_prop(emptPropMachineAuth, TRUE));
properties.push_back(eap::method_property(emptPropUserAuth, TRUE)); properties.push_back(eap_method_prop(emptPropUserAuth, TRUE));
properties.push_back(eap::method_property(emptPropIdentityPrivacy, TRUE)); properties.push_back(eap_method_prop(emptPropIdentityPrivacy, TRUE));
properties.push_back(eap::method_property(emptPropSharedStateEquivalence, TRUE)); properties.push_back(eap_method_prop(emptPropSharedStateEquivalence, TRUE));
// Allocate property array. // Allocate property array.
DWORD dwCount = (DWORD)properties.size(); DWORD dwCount = (DWORD)properties.size();

View File

@ -26,3 +26,5 @@
#include "../include/Session.h" #include "../include/Session.h"
#include "../../EAPBase/include/EAPXML.h" #include "../../EAPBase/include/EAPXML.h"
#include <WinStd/EAP.h>

@ -1 +1 @@
Subproject commit da18e4cead9d965f6b4cb523039fc8c0e943cfa1 Subproject commit b1f5846d8c364eb6982b119786ee2c1f3a0c8740