Bug 969728 - Make users using temporary profile possible to update using the maintenance service. r=bbondy a=lsblakk
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Wed, 12 Feb 2014 06:01:29 +0900
changeset 176306 b61023119a2139127d2a17bb7c4b8996ea64dbf1
parent 176305 fdf71716eef04e4161e29d9201ebb597fb68b0b3
child 176307 f6781d5f2816ac5131f2e87ed66e760f38d2b853
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy, lsblakk
bugs969728
milestone28.0
Bug 969728 - Make users using temporary profile possible to update using the maintenance service. r=bbondy a=lsblakk
toolkit/mozapps/update/common/pathhash.cpp
--- a/toolkit/mozapps/update/common/pathhash.cpp
+++ b/toolkit/mozapps/update/common/pathhash.cpp
@@ -37,24 +37,25 @@ BinaryDataToHexString(const BYTE *hash, 
 */
 static BOOL
 CalculateMD5(const char *data, DWORD dataSize, 
              BYTE **hash, DWORD &hashSize)
 {
   HCRYPTPROV hProv = 0;
   HCRYPTHASH hHash = 0;
 
-  if (!CryptAcquireContext(&hProv, nullptr, nullptr, PROV_RSA_FULL, 0)) {
+  if (!CryptAcquireContext(&hProv, nullptr, nullptr, PROV_RSA_FULL,
+                           CRYPT_VERIFYCONTEXT)) {
     if (NTE_BAD_KEYSET != GetLastError()) {
       return FALSE;
     }
  
     // Maybe it doesn't exist, try to create it.
     if (!CryptAcquireContext(&hProv, nullptr, nullptr, PROV_RSA_FULL, 
-                            CRYPT_NEWKEYSET)) {
+                             CRYPT_VERIFYCONTEXT | CRYPT_NEWKEYSET)) {
       return FALSE;
     }
   }
 
   if (!CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash)) {
     return FALSE;
   }