コード例 #1
0
 // Token: 0x060007B5 RID: 1973 RVA: 0x0003A75C File Offset: 0x0003895C
 public static bool ValidateCanary(string canaryString, string logonUniqueKey)
 {
     byte[] userContextIdBinary;
     byte[] array;
     byte[] array2;
     if (!Canary.ParseCanary(canaryString, out userContextIdBinary, out array, out array2))
     {
         ExTraceGlobals.UserContextTracer.TraceDebug <string, string, string>(10L, "{0}.{1}: Parse failed, canaryString={2}", "Owa.Core.Canary", "ValidateCanary", canaryString);
         return(false);
     }
     if (Canary.IsExpired(array))
     {
         ExTraceGlobals.UserContextTracer.TraceDebug <string, string, string>(10L, "{0}.{1}: IsExpired=true, timeStampBinary={2}", "Owa.Core.Canary", "ValidateCanary", Canary.GetHexString(array));
         return(false);
     }
     byte[] array3 = Canary.ComputeHash(userContextIdBinary, array, logonUniqueKey);
     if (Canary.AreEqual(array2, array3))
     {
         return(true);
     }
     ExTraceGlobals.UserContextTracer.TraceDebug(10L, "{0}.{1}: hashBinary is invalid, testHashBinary={2}!=hashBinary={3}", new object[]
     {
         "Owa.Core.Canary",
         "ValidateCanary",
         Canary.GetHexString(array3),
         Canary.GetHexString(array2)
     });
     return(false);
 }
コード例 #2
0
 // Token: 0x060007AC RID: 1964 RVA: 0x0003A644 File Offset: 0x00038844
 private Canary(byte[] userContextIdBinary, byte[] timeStampBinary, string logonUniqueKey)
 {
     byte[] array  = Canary.ComputeHash(userContextIdBinary, timeStampBinary, logonUniqueKey);
     byte[] array2 = new byte[userContextIdBinary.Length + timeStampBinary.Length + array.Length];
     userContextIdBinary.CopyTo(array2, 0);
     timeStampBinary.CopyTo(array2, userContextIdBinary.Length);
     array.CopyTo(array2, userContextIdBinary.Length + timeStampBinary.Length);
     this.UserContextIdGuid = new Guid(userContextIdBinary);
     this.LogonUniqueKey    = logonUniqueKey;
     this.canaryString      = Canary.Encode(array2);
 }