[Mono-bugs] [Bug 644648] New: CryptoStream does not call FlushFinalBlock when in CryptoStreamMode.Read

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 7 12:00:10 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=644648

https://bugzilla.novell.com/show_bug.cgi?id=644648#c0


           Summary: CryptoStream does not call FlushFinalBlock when in
                    CryptoStreamMode.Read
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System.Security
        AssignedTo: spouliot at novell.com
        ReportedBy: bassam at symform.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET4.0E)

CryptoStream does not seem to call FlushFinalBlock when CryptoStreamMode.Read.
This is incompatible with the implementation in .NET.

Reproducible: Always

Steps to Reproduce:
Here is a small test to repro:

        [Test]
        public void CryptoStreamShouldCallFlushFinalBlockOnDispose()
        {
            using (SHA1 sha1 = SHA1.Create())
            {
                using (MemoryStream mem = new MemoryStream(new byte[] { 1, 2, 3
}, false))
                using (CryptoStream cs = new CryptoStream(mem, sha1,
CryptoStreamMode.Read))
                {
                }

                // this throws on mono but not on windows.
                Console.WriteLine("hash = {0}", sha1.Hash[0]);
            }
        }

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list