Support for pre-shared credentials introduced
This commit is contained in:
@@ -58,6 +58,7 @@ namespace eapserial
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Credentials.h"
|
||||
#include "../../EAPBase/include/Config.h"
|
||||
|
||||
#include <Windows.h>
|
||||
@@ -67,7 +68,7 @@ namespace eapserial
|
||||
|
||||
namespace eap
|
||||
{
|
||||
class config_pap : public config_pass
|
||||
class config_pap : public config_method<credentials_pap>
|
||||
{
|
||||
public:
|
||||
///
|
||||
@@ -130,18 +131,18 @@ namespace eapserial
|
||||
{
|
||||
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_pap &val)
|
||||
{
|
||||
pack(cursor, (const eap::config_pass&)val);
|
||||
pack(cursor, (const eap::config_method<eap::credentials_pap>&)val);
|
||||
}
|
||||
|
||||
|
||||
inline size_t get_pk_size(const eap::config_pap &val)
|
||||
{
|
||||
return get_pk_size((const eap::config_pass&)val);
|
||||
return get_pk_size((const eap::config_method<eap::credentials_pap>&)val);
|
||||
}
|
||||
|
||||
|
||||
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_pap &val)
|
||||
{
|
||||
unpack(cursor, (eap::config_pass&)val);
|
||||
unpack(cursor, (eap::config_method<eap::credentials_pap>&)val);
|
||||
}
|
||||
}
|
||||
|
@@ -29,6 +29,34 @@ namespace eap
|
||||
class credentials_pap;
|
||||
}
|
||||
|
||||
namespace eapserial
|
||||
{
|
||||
///
|
||||
/// Packs a PAP method credentials
|
||||
///
|
||||
/// \param[inout] cursor Memory cursor
|
||||
/// \param[in] val Credentials to pack
|
||||
///
|
||||
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::credentials_pap &val);
|
||||
|
||||
///
|
||||
/// Returns packed size of a PAP method credentials
|
||||
///
|
||||
/// \param[in] val Credentials to pack
|
||||
///
|
||||
/// \returns Size of data when packed (in bytes)
|
||||
///
|
||||
inline size_t get_pk_size(const eap::credentials_pap &val);
|
||||
|
||||
///
|
||||
/// Unpacks a PAP method credentials
|
||||
///
|
||||
/// \param[inout] cursor Memory cursor
|
||||
/// \param[out] val Credentials to unpack to
|
||||
///
|
||||
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::credentials_pap &val);
|
||||
}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../EAPBase/include/Credentials.h"
|
||||
@@ -100,3 +128,24 @@ namespace eap
|
||||
/// @}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
namespace eapserial
|
||||
{
|
||||
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::credentials_pap &val)
|
||||
{
|
||||
pack(cursor, (const eap::credentials_pass&)val);
|
||||
}
|
||||
|
||||
|
||||
inline size_t get_pk_size(const eap::credentials_pap &val)
|
||||
{
|
||||
return get_pk_size((const eap::credentials_pass&)val);
|
||||
}
|
||||
|
||||
|
||||
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::credentials_pap &val)
|
||||
{
|
||||
unpack(cursor, (eap::credentials_pass&)val);
|
||||
}
|
||||
}
|
||||
|
@@ -25,19 +25,19 @@
|
||||
// eap::config_pap
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::config_pap::config_pap(_In_ module &mod) : config_pass(mod)
|
||||
eap::config_pap::config_pap(_In_ module &mod) : config_method<credentials_pap>(mod)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_pap::config_pap(_In_ const config_pap &other) :
|
||||
config_pass(other)
|
||||
config_method<credentials_pap>(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_pap::config_pap(_Inout_ config_pap &&other) :
|
||||
config_pass(std::move(other))
|
||||
config_method<credentials_pap>(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ eap::config_pap::config_pap(_Inout_ config_pap &&other) :
|
||||
eap::config_pap& eap::config_pap::operator=(_In_ const config_pap &other)
|
||||
{
|
||||
if (this != &other)
|
||||
(config_pass&)*this = other;
|
||||
(config_method<credentials_pap>&)*this = other;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ eap::config_pap& eap::config_pap::operator=(_In_ const config_pap &other)
|
||||
eap::config_pap& eap::config_pap::operator=(_Inout_ config_pap &&other)
|
||||
{
|
||||
if (this != &other)
|
||||
(config_pass&&)*this = std::move(other);
|
||||
(config_method<credentials_pap>&&)*this = std::move(other);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user