Index: /trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp	(revision 57615)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp	(revision 57616)
@@ -107,4 +107,5 @@
     static unsigned countCertsFound(bool const *pafFoundCerts);
     static bool areAllCertsFound(bool const *pafFoundCerts, bool fOnlyMandatory);
+    static int  adjustCertsFound(int rc, bool *pafFoundCerts);
     static void refreshCertificates(RTHTTP hHttp, RTCRSTORE hOldStore, bool *pafFoundCerts, const char *pszCaCertFile);
     static void downloadMissingCertificates(RTCRSTORE hNewStore, bool *pafNewFoundCerts, RTHTTP hHttp,
@@ -342,4 +343,5 @@
              */
             rc = RTCrStoreCertCheckWanted(hCurStore, s_aCerts, RT_ELEMENTS(s_aCerts), afCertsFound);
+            rc = adjustCertsFound(rc, afCertsFound);
             AssertRC(rc);
             RTTIMESPEC RefreshAge;
@@ -485,4 +487,39 @@
     /* Apply HTTP headers: */
     return RTHttpSetHeaders(hHttp, formattedHeaderPointers.size(), ppFormattedHeaders);
+}
+
+/**
+ * Adjusts the set of found certificates by marking all alternatives found if
+ * one is.
+ *
+ * @returns Adjusted rc (VINF_SUCCESS instead of VWRN_NOT_FOUND if all found).
+ * @param   rc                  The status code.
+ * @param   pafFoundCerts       Array parallel to s_aCerts with the status of
+ *                              each wanted certificate.
+ */
+/*static*/ int
+UINetworkReplyPrivateThread::adjustCertsFound(int rc, bool *pafFoundCerts)
+{
+    for (uint32_t i = 0; i < RT_ELEMENTS(s_aCerts); i++)
+        if (pafFoundCerts[i])
+        {
+            uint8_t iAlt = i;
+            for (;;)
+            {
+                const CERTINFO *pCertInfo = (const CERTINFO *)s_aCerts[iAlt].pvUser;
+                iAlt = pCertInfo->iAlternativeTo;
+                if (iAlt >= RT_ELEMENTS(s_aCerts) || iAlt == i)
+                {
+                    Assert(iAlt == UINT8_MAX || iAlt < RT_ELEMENTS(s_aCerts));
+                    break;
+                }
+                if (!pafFoundCerts[iAlt])
+                    pafFoundCerts[iAlt] = true;
+            }
+        }
+
+    if (rc == VINF_SUCCESS || rc == VWRN_NOT_FOUND)
+        rc = countCertsFound(pafFoundCerts) == RT_ELEMENTS(s_aCerts) ? VINF_SUCCESS : VWRN_NOT_FOUND;
+    return rc;
 }
 
@@ -559,4 +596,5 @@
 
             rc = RTCrStoreCertCheckWanted(hNewStore, s_aCerts, RT_ELEMENTS(s_aCerts), afNewFoundCerts);
+            rc = adjustCertsFound(rc, afNewFoundCerts);
             AssertLogRelRC(rc);
             Assert(rc != VINF_SUCCESS || areAllCertsFound(afNewFoundCerts, false /*fOnlyMandatory*/));
@@ -566,4 +604,5 @@
                                                      RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR,
                                                      hOldStore, s_aCerts, RT_ELEMENTS(s_aCerts), afNewFoundCerts);
+                rc = adjustCertsFound(rc, afNewFoundCerts);
                 AssertLogRelRC(rc);
                 Assert(rc != VINF_SUCCESS || areAllCertsFound(afNewFoundCerts, false /*fOnlyMandatory*/));
@@ -581,4 +620,5 @@
                                                                  s_aCerts, RT_ELEMENTS(s_aCerts), afNewFoundCerts,
                                                                  RTErrInfoInitStatic(&StaticErrInfo));
+                rc = adjustCertsFound(rc, afNewFoundCerts);
                 if (RTErrInfoIsSet(&StaticErrInfo.Core))
                     LogRel(("refreshCertificates/#2: %s\n", StaticErrInfo.Core.pszMsg));
@@ -652,5 +692,5 @@
                                  */
                                 pafNewFoundCerts[i] = true;
-                                if (areAllCertsFound(pafNewFoundCerts, false /* fOnlyMandatory */))
+                                if (adjustCertsFound(VWRN_NOT_FOUND, pafNewFoundCerts) == VINF_SUCCESS)
                                 {
                                     RTHttpFreeResponse(pvRootsZip);
@@ -685,4 +725,5 @@
                         {
                             pafNewFoundCerts[i] = true;
+                            adjustCertsFound(VWRN_NOT_FOUND, pafNewFoundCerts);
                             break;
                         }
Index: /trunk/src/VBox/Runtime/common/crypto/RTCrStoreCertAddWantedFromFishingExpedition.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/crypto/RTCrStoreCertAddWantedFromFishingExpedition.cpp	(revision 57615)
+++ /trunk/src/VBox/Runtime/common/crypto/RTCrStoreCertAddWantedFromFishingExpedition.cpp	(revision 57616)
@@ -146,9 +146,9 @@
 #endif
 #ifdef RT_OS_WINDOWS
-            "${BothProgramFiles}/Git/bin/curl-ca-bundle.crt",
-            "${BothProgramFiles}/Mercurial/hgrc.d/cacert.pem",
-            "${BothProgramFiles}/Java/jre*/lib/security/cacerts",
-            "${BothProgramFiles}/Java/jdk*/jre/lib/security/cacerts",
-            "${BothProgramFiles}/HexChat/cert.pem",
+            "${AllProgramFiles}/Git/bin/curl-ca-bundle.crt",
+            "${AllProgramFiles}/Mercurial/hgrc.d/cacert.pem",
+            "${AllProgramFiles}/Java/jre*/lib/security/cacerts",
+            "${AllProgramFiles}/Java/jdk*/jre/lib/security/cacerts",
+            "${AllProgramFiles}/HexChat/cert.pem",
             "${SystemDrive}/BitNami/*/git/bin/curl-ca-bundle.crt",
             "${SystemDrive}/BitNami/*/heroku/data/cacert.pem",
@@ -187,8 +187,8 @@
 #endif
 #ifdef RT_OS_WINDOWS
-            "${BothProgramFiles}/Git/ssl/certs/",
-            "${BothProgramFiles}/Git/ssl/certs/expired/",
-            "${BothProgramFiles}/Common Files/Apple/Internet Services/security.resources/roots/",
-            "${BothProgramFiles}/Raptr/ca-certs/",
+            "${AllProgramFiles}/Git/ssl/certs/",
+            "${AllProgramFiles}/Git/ssl/certs/expired/",
+            "${AllProgramFiles}/Common Files/Apple/Internet Services/security.resources/roots/",
+            "${AllProgramFiles}/Raptr/ca-certs/",
             "${SystemDrive}/Bitname/*/git/ssl/certs/",
             "${SystemDrive}/Bitnami/*/git/ssl/certs/expired/",
@@ -220,5 +220,5 @@
     {
         size_t cFound = rtCrStoreCountFound(pafFound, cWanted);
-        Assert(cFound == cWanted || fAllFound);
+        Assert(cFound == cWanted || !fAllFound);
         if (cFound == cWanted)
             rc = VINF_SUCCESS;
Index: /trunk/src/VBox/Runtime/common/crypto/store-cert-add-basic.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/crypto/store-cert-add-basic.cpp	(revision 57615)
+++ /trunk/src/VBox/Runtime/common/crypto/store-cert-add-basic.cpp	(revision 57616)
@@ -281,5 +281,5 @@
                 RTSha1(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha1);
                 uint8_t abSha512[RTSHA512_HASH_SIZE];
-                RTSha1(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha512);
+                RTSha512(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha512);
                 if (rtCrStoreIsCertWanted(paWanted, cWanted, pafFound, pCertCtx->cbEncoded, abSha1, abSha512, pCertCtx->pCert))
                 {
@@ -373,5 +373,5 @@
                 RTSha1(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha1);
                 uint8_t abSha512[RTSHA512_HASH_SIZE];
-                RTSha1(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha512);
+                RTSha512(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha512);
                 if (rtCrStoreMarkCertFound(pafFound, paWanted, cWanted, pCertCtx->cbEncoded, abSha1, abSha512, pCertCtx->pCert))
                 {
@@ -528,5 +528,5 @@
                     RTSha1(pCurSec->pbData, pCurSec->cbData, abSha1);
                     uint8_t abSha512[RTSHA512_HASH_SIZE];
-                    RTSha1(pCurSec->pbData, pCurSec->cbData, abSha512);
+                    RTSha512(pCurSec->pbData, pCurSec->cbData, abSha512);
                     if (!rtCrStoreIsCertWanted(paWanted, cWanted, pafFound, pCurSec->cbData, abSha1, abSha512, NULL))
                         continue;
Index: /trunk/src/VBox/Runtime/common/misc/http.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/misc/http.cpp	(revision 57615)
+++ /trunk/src/VBox/Runtime/common/misc/http.cpp	(revision 57616)
@@ -559,4 +559,9 @@
                 rc = VERR_HTTP_PROXY_NOT_FOUND;
                 break;
+            case CURLE_WRITE_ERROR:
+                rc = RT_FAILURE_NP(pThis->rcOutput) ? pThis->rcOutput : VERR_WRITE_ERROR;
+                break;
+            //case CURLE_READ_ERROR
+
             default:
                 break;
@@ -672,5 +677,5 @@
             pThis->Output.Mem.cb = cbNewSize;
             pThis->Output.Mem.pb[cbNewSize] = '\0';
-            return VINF_SUCCESS;
+            return cbToAppend;
         }
 
@@ -693,5 +698,5 @@
             pThis->Output.Mem.pb = pbNew;
             pThis->Output.Mem.cb = cbNewSize;
-            return VINF_SUCCESS;
+            return cbToAppend;
         }
 
@@ -699,5 +704,5 @@
     }
     else
-        pThis->rcOutput      = VERR_TOO_MUCH_DATA;
+        pThis->rcOutput = VERR_TOO_MUCH_DATA;
 
     /*
@@ -743,5 +748,5 @@
      */
     bool fBusy = ASMAtomicXchgBool(&pThis->fBusy, true);
-    AssertReturn(fBusy, VERR_WRONG_ORDER);
+    AssertReturn(!fBusy, VERR_WRONG_ORDER);
 
     /*
@@ -846,5 +851,5 @@
      */
     bool fBusy = ASMAtomicXchgBool(&pThis->fBusy, true);
-    AssertReturn(fBusy, VERR_WRONG_ORDER);
+    AssertReturn(!fBusy, VERR_WRONG_ORDER);
 
     /*
Index: /trunk/src/VBox/Runtime/common/path/RTPathGlob.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/path/RTPathGlob.cpp	(revision 57615)
+++ /trunk/src/VBox/Runtime/common/path/RTPathGlob.cpp	(revision 57616)
@@ -49,4 +49,5 @@
 # define INCL_BASE
 # include <os2.h>
+# undef RT_MAX /* collision */
 
 #endif
@@ -510,4 +511,5 @@
                 pszBuf[1] = ':';
                 pszBuf[2] = '\0';
+                *pcchValue = 2;
                 return VINF_EOF;
             }
@@ -523,4 +525,5 @@
             pszBuf[1] = ':';
             pszBuf[2] = '\0';
+            *pcchValue = 2;
             return VINF_EOF;
         }
@@ -547,5 +550,5 @@
         UINT cchSystemRoot = GetSystemWindowsDirectoryW(wszSystemRoot, MAX_PATH);
         if (cchSystemRoot > 0)
-            return RTUtf16ToUtf8Ex(wszSystemRoot, cchSystemRoot, &pszBuf, cbBuf, NULL);
+            return RTUtf16ToUtf8Ex(wszSystemRoot, cchSystemRoot, &pszBuf, cbBuf, pcchValue);
         return RTErrConvertFromWin32(GetLastError());
     }
@@ -1029,5 +1032,5 @@
         if (pAllocator->iNext >= pAllocator->cAllocated)
         {
-            uint32_t cNew = RT_MAX(pAllocator->cAllocated, 1) * 2;
+            uint32_t cNew = pAllocator->cAllocated ? pAllocator->cAllocated * 2 : 2;
             void *pvNew = RTMemRealloc(pAllocator->paInstructions, cNew * sizeof(pAllocator->paInstructions[0]));
             AssertReturn(pvNew, VERR_NO_MEMORY);
@@ -1058,5 +1061,4 @@
              * Zero or more characters wildcard.
              */
-            /** @todo bitmap optimziation (index = ch).   */
             if (ch == '*')
             {
