[Mono-bugs] [Bug 57941][Wis] Changed - CryptoConvert can't decode nunit.key

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 1 May 2004 12:10:28 -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=57941

--- shadow/57941	2004-05-01 11:53:29.000000000 -0400
+++ shadow/57941.tmp.27940	2004-05-01 12:10:28.000000000 -0400
@@ -63,6 +63,32 @@
 
 P, Q, DP, DQ, InvQ, D are the private key.
 In fact DP, DQ and InvQ are calculated (i.e. not really required) as
 an optimization to do CRT (Chinese Remainder Theorem).
 
 
+
+------- Additional Comments From sebastien@ximian.com  2004-05-01 12:10 -------
+nunit.key is 490 bytes long - so it is missing 106 bytes of data.
+
+We know that we're not missing the start of the file because:
+- the header is correct;
+- the public key (public exponent, modulus) can be decoded correctly;
+
+So the last 106 bytes are the "real" (i.e. not CRT) private key (D).
+
+Note: we cannot recalculate D from the CRT parameters (at least not
+easily).
+
+So what happens...
+
+* Microsoft SN.EXE tool is unmanaged and use CryptoAPI;
+* Microsoft CryptoAPI use CRT so it can sign the assembly even if the
+D parameter is missing;
+* Mono SN.EXE tool is managed and relies on the framework for
+cryptography.
+* Mono RSA implementation use CRT parameters when available (as it is
+much faster);
+* CryptoConvert throw a CryptographicException when a key is
+incomplete (e.g. missing D).
+* Mono SN.EXE refuse to sign the assembly.
+