From d20aafb3ff03d42fcefd884bf8e0a19eee06003e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 28 Aug 2016 16:38:13 +0200 Subject: [PATCH] Identity selection revised to support cases where TLS certificate is present but contains no usable username --- lib/TTLS/src/Credentials.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/TTLS/src/Credentials.cpp b/lib/TTLS/src/Credentials.cpp index 400e07d..e5f9aff 100644 --- a/lib/TTLS/src/Credentials.cpp +++ b/lib/TTLS/src/Credentials.cpp @@ -216,11 +216,12 @@ LPCTSTR eap::credentials_ttls::target_suffix() const } -std::wstring eap::credentials_ttls::get_identity() const +wstring eap::credentials_ttls::get_identity() const { // Outer identity has the right-of-way. - if (!credentials_tls::empty()) - return credentials_tls::get_identity(); + wstring identity(credentials_tls::get_identity()); + if (!identity.empty()) + return identity; // Inner identity. if (m_inner)