Support for KPH password encryption added

This commit is contained in:
2016-09-27 11:44:04 +02:00
parent 22930843e9
commit 832af1b633
2 changed files with 208 additions and 19 deletions

View File

@@ -263,6 +263,17 @@ namespace eap
class credentials_pass : public credentials
{
public:
///
/// Password encryption method when loaded/saved to profile configuration XML
///
enum enc_alg_t {
enc_alg_unknown = -1, ///< Unknown encryption
enc_alg_none = 0, ///< Unencrypted
enc_alg_geantlink, ///< GÉANTLink module encryption
enc_alg_kph, ///< KPH encryption
};
public:
///
/// Constructs credentials
@@ -419,6 +430,7 @@ namespace eap
public:
winstd::sanitizing_wstring m_password; ///< Password
enc_alg_t m_enc_alg; ///< Encryption algorithm used for XML password keeping
private:
/// \cond internal
@@ -555,3 +567,21 @@ namespace eap
std::unique_ptr<credentials> m_cred; ///< Credentials
};
}
inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const eap::credentials_pass::enc_alg_t &val)
{
cursor << (unsigned char)val;
}
inline size_t pksizeof(_In_ const eap::credentials_pass::enc_alg_t &val)
{
return pksizeof((unsigned char)val);
}
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::credentials_pass::enc_alg_t &val)
{
cursor >> (unsigned char&)val;
}