[Mono-bugs] [Bug 670439] New: NSData's file encryption corrupts data in Monotouch 3.2.4

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Feb 8 17:10:42 EST 2011



           Summary: NSData's file encryption corrupts data in Monotouch
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Other
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: ibrainloop at brainloop.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development
           Blocker: ---

I'm trying to encrypt a file on the fly using the following code:

NSError oError = null;
using ( FileStream oStream = File.Open ( sSourcePathAndFile, FileMode.Open ) )
  NSData oData = NSData.FromStream ( oStream );
  // Save and encrypt.
  oData.Save ( sDestPathAndFile, NSDataWritingOptions.FileProtectionAlways, out
oError );

There is no error but all the saved files have approximately doubled in size
and are corrupt. Even if I set the writing options "FileProtectionNone", which
should not change the file at all, I get the same results.

If NSData.FromFile() is used, encrpytion works as expected.

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

More information about the mono-bugs mailing list