Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCredentials.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCredentials.cpp	(revision 30828)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCredentials.cpp	(revision 30829)
@@ -30,6 +30,7 @@
 *******************************************************************************/
 #include <iprt/asm.h>
+#include <iprt/mem.h>
+#include <iprt/rand.h>
 #include <iprt/string.h>
-#include <iprt/rand.h>
 #include <VBox/log.h>
 
@@ -113,36 +114,13 @@
 VBGLR3DECL(void) VbglR3CredentialsDestroy(char *pszUser, char *pszPassword, char *pszDomain, uint32_t cPasses)
 {
-    size_t const    cchUser     = pszUser     ? strlen(pszUser)     : 0;
-    size_t const    cchPassword = pszPassword ? strlen(pszPassword) : 0;
-    size_t const    cchDomain   = pszDomain   ? strlen(pszDomain)   : 0;
+    /* wipe first */
+    if (pszUser)
+        RTMemWipeThoroughly(pszUser,     strlen(pszUser) + 1,     cPasses);
+    if (pszPassword)
+        RTMemWipeThoroughly(pszPassword, strlen(pszPassword) + 1, cPasses);
+    if (pszDomain)
+        RTMemWipeThoroughly(pszDomain,   strlen(pszDomain) + 1,   cPasses);
 
-    do
-    {
-        if (cchUser)
-            memset(pszUser,     0xff, cchUser);
-        if (cchPassword)
-            memset(pszPassword, 0xff, cchPassword);
-        if (cchDomain)
-            memset(pszDomain,   0xff, cchDomain);
-        ASMMemoryFence();
-
-        if (cchUser)
-            memset(pszUser,     0x00, cchUser);
-        if (cchPassword)
-            memset(pszPassword, 0x00, cchPassword);
-        if (cchDomain)
-            memset(pszDomain,   0x00, cchDomain);
-        ASMMemoryFence();
-
-        if (cchUser)
-            RTRandBytes(pszUser,     cchUser);
-        if (cchPassword)
-            RTRandBytes(pszPassword, cchPassword);
-        if (cchDomain)
-            RTRandBytes(pszDomain,   cchDomain);
-        ASMMemoryFence();
-
-    } while (cPasses-- > 0);
-
+    /* then free. */
     RTStrFree(pszUser);
     RTStrFree(pszPassword);
