Example #1
0
        // Token: 0x0600026E RID: 622 RVA: 0x00008A74 File Offset: 0x00006C74
        private SecureString ReadOpaqueSecureString()
        {
            GCHandle     gchandle = default(GCHandle);
            SecureString result;

            try
            {
                int num = this.ReadMultiByteInteger();
                if (num > WBXmlReader.maxSecureStringLength)
                {
                    throw new EasWBXmlTransientException("Opaque secure string is too long");
                }
                byte[] array = new byte[num];
                gchandle = GCHandle.Alloc(array, GCHandleType.Pinned);
                this.ReadBytes(array);
                result = WBXmlReader.ConvertToSecureString(array);
            }
            finally
            {
                if (gchandle.IsAllocated)
                {
                    gchandle.Free();
                }
            }
            return(result);
        }
Example #2
0
        // Token: 0x0600026B RID: 619 RVA: 0x00008950 File Offset: 0x00006B50
        private SecureString ReadInlineSecureString()
        {
            long position = this.stream.Position;
            long num      = position;

            while (this.ReadByte() != 0)
            {
                num += 1L;
            }
            this.stream.Position = position;
            GCHandle     gchandle = default(GCHandle);
            SecureString result;

            try
            {
                int num2 = (int)(num - position) + 1;
                if (num2 > WBXmlReader.maxSecureStringLength)
                {
                    throw new EasWBXmlTransientException("Inline secure string is too long");
                }
                byte[] array = new byte[num2];
                gchandle = GCHandle.Alloc(array, GCHandleType.Pinned);
                this.ReadBytes(array);
                result = WBXmlReader.ConvertToSecureString(array);
            }
            finally
            {
                if (gchandle.IsAllocated)
                {
                    gchandle.Free();
                }
            }
            return(result);
        }