[Mono-bugs] [Bug 50918][Nor] New - P/Invoke? RNGCryptoServiceProvider / Mono.Security.Win32

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 28 Apr 2004 20:04:05 -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 miguel@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=50918

--- shadow/50918	2004-04-28 20:04:05.000000000 -0400
+++ shadow/50918.tmp.14097	2004-04-28 20:04:05.000000000 -0400
@@ -0,0 +1,76 @@
+Bug#: 50918
+Product: Mono: Runtime
+Version: unspecified
+OS: other
+OS Details: 
+Status: RESOLVED   
+Resolution: FIXED
+Severity: Unknown
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: spouliot@videotron.ca               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: P/Invoke? RNGCryptoServiceProvider / Mono.Security.Win32
+OtherBugsDependingOnThis: 49415
+
+Description of Problem:
+There seems to be a problem when PInvoking into windows on Mono 0.28.
+
+Steps to reproduce the problem:
+1. Compile the sample program (either csc or mcs will do) and link it 
+with Mono.Security.Win32
+2. Run the sample
+
+using System;
+using Mono.Security.Cryptography;
+
+class RngTest {
+	[STAThread]
+	static void Main(string[] args) {
+		RNGCryptoServiceProvider rng = new 
+RNGCryptoServiceProvider ();
+		byte[] random = new byte [16];
+		rng.GetBytes (random);
+		Console.WriteLine (BitConverter.ToString (random));
+	}
+}
+
+
+Actual Results:
+Nothing is displayed at the console.
+
+Expected Results:
+16 bytes are displayed on the console (using MS runtime).
+
+How often does this happen? 
+Always
+
+Additional Information:
+This worked in previous release of Mono. I didn't install 0.26 so the 
+last known working version is 0.25.
+
+------- Additional Comments From danielmorgan@verizon.net  2003-12-06 12:53 -------
+add myself to the cc list.  I would like to confirm this still 
+happens in mono.
+
+------- Additional Comments From danielmorgan@verizon.net  2003-12-09 00:49 -------
+Patrik Torstensson <p@rxc.se> committed this today:
+
+    * rand.c (InternalGetBytes): Implemented win32 version with 
+cryptapi
+
+http://lists.ximian.com/archives/public/mono-patches/2003-
+December/027875.html
+
+
+
+------- Additional Comments From Patrik.Torstensson@intel.com  2003-12-09 07:25 -------
+It was a callconv issue, Mono uses a different standard callconv 
+that MS.NET. That caused issue when calling g_free in the marshall 
+code (that was added around release 0.24)
+
+Added CallingConvention=CallingConvention.StdCall on the DllImport 
+and now it works.