Merge pull request #896 from echampet/webresource
authorMarek Safar <marek.safar@gmail.com>
Tue, 29 Mar 2016 07:33:39 +0000 (09:33 +0200)
committerMarek Safar <marek.safar@gmail.com>
Tue, 29 Mar 2016 07:33:39 +0000 (09:33 +0200)
[Fix] ReusableHashAlgorithm doesn't set the Key of the ValidationAlgorit...

1  2 
mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs

index a8cd2f842cb2d887242b5e8292085c3e6410e5e2,db7f6be86829be6527b5655aee6a99be5b717b9d..7f59b52e22b47f90653406803db3f8ef8acc6c08
@@@ -79,7 -79,9 +79,9 @@@ namespace System.Web.Handler
                                        if (!hashAlg.CanReuseTransform) {
                                                canReuseHashAlg = false;
                                                hashAlg = null;
+                                               return null;
                                        }
+                                       hashAlg.Key = MachineKeySectionUtils.GetValidationKey (mks);
                                }
  
                                if (hashAlg != null)
                                debug = resourceName.EndsWith (".debug.js", StringComparison.OrdinalIgnoreCase);
                                string dbgTail = debug ? "d" : String.Empty;
                                lookupKey = resourceNameHash + (notifyScriptLoaded ? "t" : "f") + dbgTail;
 -#if NET_3_5
                                CheckIfResourceIsCompositeScript (resourceName, ref includeTimeStamp);
 -#endif
  #else
                                lookupKey = resourceNameHash;
  #endif
                        extra = QueryParamSeparator + "n=" + (notifyScriptLoaded ? "t" : "f");
  #endif
  
 -#if TARGET_JVM
 -                      atime = QueryParamSeparator + "t=" + assemblyName.GetHashCode ();
 -#else
                        if (includeTimeStamp) {
                                if (!String.IsNullOrEmpty (assemblyPath) && File.Exists (assemblyPath))
                                        atime = QueryParamSeparator + "t=" + File.GetLastWriteTimeUtc (assemblyPath).Ticks;
                                else
                                        atime = QueryParamSeparator + "t=" + DateTime.UtcNow.Ticks;
                        }
 -#endif
                        string d = HttpUtility.UrlEncode (assemblyNameHash + "_" + resourceNameHash +  (debug ? "_t" : "_f"));
                        string href = HandlerFileName + "?d=" + d + atime + extra;
                        HttpContext ctx = HttpContext.Current;