VirtualBox

Changeset 66307 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Mar 28, 2017 3:05:31 PM (8 years ago)
Author:
vboxsync
Message:

Windows Additions/VBoxCredProv: Zero'ed out a bit too much, resulted in not being able to log in under certain circumstances, adjusted logging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.cpp

    r66260 r66307  
    167167    AssertPtrReturn(pwszSource,   E_POINTER);
    168168
    169     size_t cbLen = (RTUtf16Len(pwszSource) + 1 /* Trailing zero */) * sizeof(WCHAR);
     169    size_t cbLen = RTUtf16Len(pwszSource) * sizeof(RTUTF16);
    170170
    171171    pUnicodeDest->Buffer = (LPWSTR)CoTaskMemAlloc(cbLen);
     
    196196
    197197        /* Make sure to wipe contents before free'ing. */
    198         RTMemWipeThoroughly(pUnicode->Buffer, pUnicode->MaximumLength * sizeof(WCHAR), 3 /* Passes */);
     198        RTMemWipeThoroughly(pUnicode->Buffer, pUnicode->MaximumLength /* MaximumLength is bytes! */, 3 /* Passes */);
    199199
    200200        CoTaskMemFree(pUnicode->Buffer);
     
    322322                  + pLogonIn->Password.Length;
    323323
    324     VBoxCredProvVerbose(3, "VBoxCredProvCredential::AllocateLogonPackage: Allocating %ld bytes (%zu bytes credentials)\n",
     324#ifdef DEBUG /* Do not reveal any hints to credential data in release mode. */
     325    VBoxCredProvVerbose(1, "VBoxCredProvCredential::AllocateLogonPackage: Allocating %ld bytes (%zu bytes credentials)\n",
    325326                        cbLogon, cbLogon - sizeof(KERB_INTERACTIVE_UNLOCK_LOGON));
     327#endif
    326328
    327329    KERB_INTERACTIVE_UNLOCK_LOGON *pLogon = (KERB_INTERACTIVE_UNLOCK_LOGON*)CoTaskMemAlloc(cbLogon);
     
    10411043                            /* We're done -- let the logon UI know. */
    10421044                            *pcpGetSerializationResponse = CPGSR_RETURN_CREDENTIAL_FINISHED;
     1045
     1046                            VBoxCredProvVerbose(1, "VBoxCredProvCredential::GetSerialization: Finished for user '%ls' (domain '%s')\n",
     1047                                                m_apwszCredentials[VBOXCREDPROV_FIELDID_USERNAME],
     1048                                                m_apwszCredentials[VBOXCREDPROV_FIELDID_DOMAINNAME]);
    10431049                        }
    10441050                        else
     
    10611067        VBoxCredProvVerbose(1, "VBoxCredProvCredential::GetSerialization: kerberosLogonCreate failed with hr=0x%08x\n", hr);
    10621068
    1063     VBoxCredProvVerbose(0, "VBoxCredProvCredential::GetSerialization returned hr=0x%08x\n", hr);
     1069    VBoxCredProvVerbose(1, "VBoxCredProvCredential::GetSerialization returned hr=0x%08x\n", hr);
    10641070    return hr;
    10651071}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette