diff --git a/lib/TTLS/include/Credentials.h b/lib/TTLS/include/Credentials.h index 31a13f0..732564f 100644 --- a/lib/TTLS/include/Credentials.h +++ b/lib/TTLS/include/Credentials.h @@ -176,6 +176,11 @@ namespace eap /// virtual bool retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR **ppEapError); + /// + /// Returns credential identity. + /// + virtual std::wstring get_identity() const; + /// @} public: diff --git a/lib/TTLS/src/Credentials.cpp b/lib/TTLS/src/Credentials.cpp index 671c408..5428d60 100644 --- a/lib/TTLS/src/Credentials.cpp +++ b/lib/TTLS/src/Credentials.cpp @@ -230,3 +230,17 @@ bool eap::credentials_ttls::retrieve(_In_ LPCTSTR pszTargetName, _Out_ EAP_ERROR return true; } + + +std::wstring eap::credentials_ttls::get_identity() const +{ + // Outer identity has the right-of-way. + if (!credentials_tls::empty()) + return credentials_tls::get_identity(); + + // Inner identity. + if (m_inner) + return m_inner->get_identity(); + + return L""; +}