summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2017-07-06 08:37:31 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2017-07-06 08:37:31 +0000
commiteec1c782e50cc0c6acdd3a32d80abcbd15cd920c (patch)
tree61160f9801a4531de274996fb48a63da00d5bd97
parentb93c7f3a493db3b347d925b2713bed532bdbf3d9 (diff)
downloadVirtualBox-svn-eec1c782e50cc0c6acdd3a32d80abcbd15cd920c.tar.gz
Additions/VBoxCredProv: Also try to return the current values in VBoxCredProvProvider::GetFieldDescriptorAt() (except passwords), as Windows 10 also uses those values for the new logon UI.
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@67814 cfe28804-0f27-0410-a406-dd0f0b0b656f
-rw-r--r--src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.cpp19
-rw-r--r--src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.h1
-rw-r--r--src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp26
3 files changed, 38 insertions, 8 deletions
diff --git a/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.cpp b/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.cpp
index 4998e23736d..78526f50bc4 100644
--- a/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.cpp
+++ b/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.cpp
@@ -388,6 +388,25 @@ HRESULT VBoxCredProvCredential::kerberosLogonSerialize(const KERB_INTERACTIVE_LO
/**
+ * Returns the current value of a specific credential provider field.
+ *
+ * @return Pointer (const) to the credential provider field requested, or NULL if not found / invalid.
+ * @param dwFieldID Field ID of the credential provider field to get.
+ */
+PCRTUTF16 VBoxCredProvCredential::getField(DWORD dwFieldID)
+{
+ if (dwFieldID >= VBOXCREDPROV_NUM_FIELDS)
+ return NULL;
+
+ /* Paranoia: Don't ever reveal passwords. */
+ if (dwFieldID == VBOXCREDPROV_FIELDID_PASSWORD)
+ return NULL;
+
+ return m_apwszFields[dwFieldID];
+}
+
+
+/**
* Sets a credential provider field by first zero'ing out its current content in a (hopefully) secure manner,
* then applying either the field's default or a new value.
*
diff --git a/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.h b/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.h
index 86efec8dd8a..88c7f702aea 100644
--- a/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.h
+++ b/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.h
@@ -86,6 +86,7 @@ public:
CREDENTIAL_PROVIDER_STATUS_ICON* pcpsiOptionalStatusIcon);
/** @} */
+ PCRTUTF16 getField(DWORD dwFieldID);
HRESULT setField(DWORD dwFieldID, const PRTUTF16 pcwszString, bool fNotifyUI);
HRESULT Reset(void);
HRESULT Initialize(CREDENTIAL_PROVIDER_USAGE_SCENARIO cpus);
diff --git a/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp b/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp
index d46f9853bba..01933f9b49d 100644
--- a/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp
+++ b/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2012-2016 Oracle Corporation
+ * Copyright (C) 2012-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -416,18 +416,28 @@ VBoxCredProvProvider::GetFieldDescriptorAt(DWORD dwIndex, CREDENTIAL_PROVIDER_FI
pcpFieldDesc->dwFieldID = field.desc.dwFieldID;
pcpFieldDesc->cpft = field.desc.cpft;
- if (field.desc.pszLabel)
+
+ PCRTUTF16 pcwszField = NULL;
+
+ if (dwIndex != VBOXCREDPROV_FIELDID_PASSWORD) /* Don't ever get any password. Never ever, ever. */
{
- hr = SHStrDupW(field.desc.pszLabel, &pcpFieldDesc->pszLabel);
+ if (m_pCred) /* If we have retrieved credentials, get the actual (current) value. */
+ pcwszField = m_pCred->getField(dwIndex);
+ else /* Otherwise get the default value. */
+ pcwszField = field.desc.pszLabel;
+ }
- VBoxCredProvVerbose(0, "VBoxCredProv::GetFieldDescriptorAt: dwIndex=%ld, pszLabel=%ls\n",
- dwIndex,
+ hr = SHStrDupW(pcwszField ? pcwszField : L"", &pcpFieldDesc->pszLabel);
+
+ VBoxCredProvVerbose(0, "VBoxCredProv::GetFieldDescriptorAt: dwIndex=%ld, pszLabel=%ls, hr=0x%08x\n",
+ dwIndex,
#ifdef DEBUG /* Don't show any (sensitive data) in release mode. */
- field.desc.pszLabel);
+ pcwszField ? pcwszField : L"",
#else
- L"XXX");
+ L"XXX",
#endif
- }
+ hr);
+
pcpFieldDesc->guidFieldType = field.desc.guidFieldType;
}
else