Ejemplo n.º 1
0
        // Token: 0x06000465 RID: 1125 RVA: 0x00010770 File Offset: 0x0000E970
        private static int PK11SDR_Decrypt(ref Firefox.TSECItem data, ref Firefox.TSECItem result, int cx)
        {
            IntPtr procAddress = GClass26.GetProcAddress(Firefox.nssModule, "PK11SDR_Decrypt");

            Firefox.PK11SDR_DecryptPtr pk11SDR_DecryptPtr = (Firefox.PK11SDR_DecryptPtr)Marshal.GetDelegateForFunctionPointer(procAddress, typeof(Firefox.PK11SDR_DecryptPtr));
            return(pk11SDR_DecryptPtr(ref data, ref result, cx));
        }
Ejemplo n.º 2
0
        // Token: 0x06000466 RID: 1126 RVA: 0x000107AC File Offset: 0x0000E9AC
        private static string Decrypt(string cypherText)
        {
            StringBuilder stringBuilder = new StringBuilder(cypherText);
            int           value         = Firefox.NSSBase64_DecodeBuffer(IntPtr.Zero, IntPtr.Zero, stringBuilder, stringBuilder.Length);

            Firefox.TSECItem tsecitem  = default(Firefox.TSECItem);
            Firefox.TSECItem tsecitem2 = (Firefox.TSECItem)Marshal.PtrToStructure(new IntPtr(value), typeof(Firefox.TSECItem));
            if (Firefox.PK11SDR_Decrypt(ref tsecitem2, ref tsecitem, 0) == 0 && tsecitem.SECItemLen != 0)
            {
                byte[] array = new byte[tsecitem.SECItemLen];
                Marshal.Copy(new IntPtr(tsecitem.SECItemData), array, 0, tsecitem.SECItemLen);
                return(Encoding.UTF8.GetString(array));
            }
            return(null);
        }