Bug 11715 - System.Security.Cryptography / PasswordDervicedByptes / DerivedBytes should implement IDisposable
Summary: System.Security.Cryptography / PasswordDervicedByptes / DerivedBytes should i...
Status: RESOLVED FEATURE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-04-10 15:10 UTC by Neal
Modified: 2013-04-11 08:37 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FEATURE

Description Neal 2013-04-10 15:10:35 UTC
Hello,

I'm copying some encryption code in from our desktop solution and we use a "using" block on PasswordDerivedBytes, in MonoTouch I'm getting an error that I can't do this because of the lack of IDisposable.  I looked into the classes in VS 2012 and it looks like your missing IDisposable support on this item:

using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
	[ComVisible (true)]
	public abstract class DeriveBytes
	{
		//
		// Methods
		//
		public abstract byte[] GetBytes (int cb);

		public abstract void Reset ();
	}
}
Comment 1 Sebastien Pouliot 2013-04-10 22:40:59 UTC
Could you be 6.2.x (stable) instead of 6.3.x (alpha) like mentioned above ?

That behavior is totally normal on 6.2 because we follow the Silverlight-like profile, which was based on NET_2_0 [1]. 

DeriveBytes was not IDisposable until .NET 4.0, e.g. Mono source code here:

if NET_4_0
	public abstract class DeriveBytes : IDisposable {
#else
	public abstract class DeriveBytes {
#endif

When you update to 6.3 (or the stable 6.4) based on .NET 4.5 then the type will implement IDisposable, like [2].

[1] http://msdn.microsoft.com/en-us/library/system.security.cryptography.derivebytes(v=vs.80).aspx
[2] http://msdn.microsoft.com/en-us/library/system.security.cryptography.derivebytes.aspx
Comment 2 Neal 2013-04-11 08:37:25 UTC
Yes, I'm on latest stable, sorry.