credentials: Move user impersonation to peer::get_identity()
To retrieve user credentials, EapHost provides us the interactive user's token we can use to impersonate. By doing the impersonation early in peer::get_identity(), we don't need to pass the token down the lower methods. This is rather a simplification than a performance optimization. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
@@ -267,7 +267,6 @@ std::wstring eap::credentials_tls::get_identity() const
|
||||
|
||||
eap::credentials::source_t eap::credentials_tls::combine(
|
||||
_In_ DWORD dwFlags,
|
||||
_In_opt_ HANDLE hTokenImpersonateUser,
|
||||
_In_opt_ const credentials *cred_cached,
|
||||
_In_ const config_method &cfg,
|
||||
_In_opt_z_ LPCTSTR pszTargetName)
|
||||
@@ -290,9 +289,6 @@ eap::credentials::source_t eap::credentials_tls::combine(
|
||||
}
|
||||
|
||||
if (pszTargetName) {
|
||||
// Switch user context.
|
||||
user_impersonator impersonating(hTokenImpersonateUser);
|
||||
|
||||
try {
|
||||
credentials_tls cred_loaded(m_module);
|
||||
cred_loaded.retrieve(pszTargetName, cfg.m_level);
|
||||
|
Reference in New Issue
Block a user