[Mono-bugs] [Bug 60573][Nor] Changed - CryptoStream output 1 block short after Flush
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 23 Jun 2004 09:07:27 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by sebastien@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=60573
--- shadow/60573 2004-06-22 16:39:49.000000000 -0400
+++ shadow/60573.tmp.10832 2004-06-23 09:07:27.000000000 -0400
@@ -243,6 +243,25 @@
unless we are sure it's not the last one. Somehow this isn't the case
in your sample code.
Note that Flush doesn't call FlushFinalBlock as this would break any
further use of the stream (nothing can be encrypted/decrypted after
the final block).
+
+------- Additional Comments From sebastien@ximian.com 2004-06-23 09:07 -------
+The current design CryptoStream design is a little different from
+Microsoft. This is generally not a problem unless you want to access
+the data _of the last block_ (from the underlying stream) before
+closing the CryptoStream.
+
+Mono:
+Write: 64 Actual Write: 56
+FlushFinalBlock: - Actual Write: 16
+
+Microsoft:
+Write: 64 Actual Write: 64
+FlushFinalBlock: - Actual Write: 8
+
+
+It also seems that we can get the same behaviour by commenting 2 lines
+in CryptoStream.cs. However this makes other unit tests fails on Mono
+(but strangely not on Windows).