[Mono-list] Re: Mono.Security

Sunil Kumar Sunilk@novell.com
Fri, 12 Dec 2003 04:29:07 -0700


This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartBBE55093.0__=
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Sebastin,
  I wasn't able to file bug report since we have some problem with HTTP =
services here right now. I am attaching all the details with this mail =
only.

>>a.	Windows, MS.NET runtime/class library
I got following Result after runnign the test program:-

CERTIFICATE:
        Format:  X509
        Name:  OU=3DOrganizational CA, O=3DSUNILK-TREE
        Issuing CA:  OU=3DOrganizational CA, O=3DSUNILK-TREE
        Key Algorithm:  1.2.840.113549.1.1.1
        Serial Number:  27120202EBE69CCC8556EA84716043D2F8CC2981B8B2A54D750=
94975
EAD0EC111C02
        Key Alogrithm Parameters:  0500
        Public Key:  3082010A0282010100A320C0566649D81D91EED21CD2569F9A71DA=
94A69
F7FCB256AB27A94A8864E2DAC5DADD4D74D8206909F19AB48A5F6E5845BECB6EE9546C29B8C=
A6745
AA0147F6DF56560E997B6DD2B280868AB5090D154F945829F22203615430CC9EC84D8F80E1F=
41702
0F2BCC3C9A4FDA94A04E7146EA1532611CB35B831F329E7FAAD4E66406FC8BFBF5F49CB5D11=
232B6
F3B4823F2A1E61F906D862D5FBBDCB3E95B2C8E39F04EC7EF4C42A2BC90731415188FAF8160=
148BC
6195762023AA25E325D9F90BB1801056D7B0D6C0029520F9E0C4233CB8E785962CF01A512DC=
25F38
868529E904EE3CD7440606C9866EBF0C13239333DD0533902542C61330D5EFAEDB996DF0203=
01000
1

>>b.	Windows, Mono runtime/class library
Since I haven't configured Mono on a windows box, I wasn't able to =
complete this scenario.

>>c.	Linux, Mono runtime/class library
I got following Result after runnign the test program:-

Unhandled Exception: System.Security.Cryptography.CryptographicException: =
Input data cannot be coded as a valid certificate.
#0: 0x00349 throw      in Mono.Security.X509.X509Certificate::Parse =
([O:0x81b3aa0] )
#1: 0x0000e callvirt   in Mono.Security.X509.X509Certificate::.ctor =
([O:0x81b3aa0] )
#2: 0x0000e newobj     in System.Security.Cryptography.X509Certificates.X50=
9Certificate::.ctor ([O:0x81b3aa0] [1] )
#3: 0x00003 call       in System.Security.Cryptography.X509Certificates.X50=
9Certificate::.ctor ([O:0x81b3aa0] )
#4: 0x00030 newobj     in System.Security.Cryptography.X509Certificates.X50=
9Certificate::CreateFromCertFile ([O:0x81abe70] )
#5: 0x00003 call       in .X509CertTester::Main ([O:0x8146f78] )



I have attached the Test program and certificate with this mail.


Regards,
Sunil




>>> S=E9bastien Pouliot <spouliot@videotron.ca> 12/11/2003 7:20:33 PM >>>
Sunil,

Ok it's getting stranger. I seems in sync with CVS and can't duplicate the
problem with the 2 "candidate" certificates I got (the one from
https://www.nldap.com and the one that Carlos sent me).

Can you try, with your certificate, the following code ...

using System;
using System.Security.Cryptography.X509Certificates;

class X509Tester {
	[STAThread]
	static void Main (string[] args)
	{
		X509Certificate x =3D X509Certificate.CreateFromCertFile =
(args[0]);
		Console.WriteLine (x.ToString (true));
	}
}

... on
a.	Windows, MS.NET runtime/class library
b.	Windows, Mono runtime/class library
c.	Linux, Mono runtime/class library

and fill a bug report with the results and the certificate used. I'll look
into this ASAP.
Thanks

Sebastien Pouliot
Security Architect, Motus Technologies, http://www.motus.com=20
work: spouliot@motus.com=20
home: spouliot@videotron.ca=20
blog: http://pages.infinit.net/ctech/poupou.html=20


-----Original Message-----
From: mono-list-admin@lists.ximian.com=20
[mailto:mono-list-admin@lists.ximian.com]On Behalf Of Sunil Kumar
Sent: 11 d=E9cembre 2003 00:22
To: Matt Ryan; carlosga@telefonica.net=20
Cc: mono-list@lists.ximian.com; Parameswaran S
Subject: Re: [Mono-list] Re: Mono.Security


Looks like there is some problem with the Mono's
System.Security.Cryptography.X509Certificates.X509Certificate class.
I tried to create a certicate object using CreateFromCertFile method and a
ASN1 DER encoded certicate file  ,but its throwing exception. I did the =
same
thing on windows using MS .NET with the same certificate file and its
working. Below is the code snippet:-

try{
X509Certificate cert =3D X509Certificate.CreateFromCertFile(certfile);
}Catch(Exception e)
{
        Console.WriteLine("Error:" + e.Message);
        return;
}

On linux it throws following exception:-
Error: Input data cannot be coded as a valid certificate.

Regards
Sunil.

>>> Carlos Guzm=E1n =C1lvarez <carlosga@telefonica.net> 12/9/2003 9:56:53 =
PM >>>
Hello:

> There is also an internet-accessible eDirectory server that (I'm told)
 > anyone can use for testing purposes, at http://www.ndlap.com.

Thanks very much.

I have made a little test trying to negotiate the Handshake protocol
against the www.nldap.com using .NET 1.0 and the SSL/TLS libraries
sources from my local tree, with success, i will try to make the same
test using mono, and update the mono cvs sources as soon as possible.






--
Best regards

Carlos Guzm=E1n =C1lvarez
Vigo-Spain

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com=20
http://lists.ximian.com/mailman/listinfo/mono-list=20

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com=20
http://lists.ximian.com/mailman/listinfo/mono-list=20

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com=20
http://lists.ximian.com/mailman/listinfo/mono-list

--=__PartBBE55093.0__=
Content-Type: application/x-x509-ca-cert; name="Certi1.der"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Certi1.der"

MIIFMTCCBBmgAwIBAgIiAhwR7NDqdUkJdU2lsriBKcz40kNgcYTqVoXMnObrAgISJzANBgkqhkiG
9w0BAQUFADAyMRowGAYDVQQLExFPcmdhbml6YXRpb25hbCBDQTEUMBIGA1UEChMLU1VOSUxLLVRS
RUUwHhcNMDMwNzAxMTIyNTI5WhcNMTMwNjMwMTIyNTI5WjAyMRowGAYDVQQLExFPcmdhbml6YXRp
b25hbCBDQTEUMBIGA1UEChMLU1VOSUxLLVRSRUUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQCjIMBWZknYHZHu0hzSVp+acdqUpp9/yyVqsnqUqIZOLaxdrdTXTYIGkJ8Zq0il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eczCAkLTrPOSR1qAhDj8zwP8TGKFBjQXfYK8lxzCmJr0zQ
NjEtomsik9wgVPM8X8deCUUfoSZIb/bSbmkmx2bQTTFT0qwIMvPt0j1x8rVWRpcLsM/+QlUCBsDj
xg2TgSqYi3I/iP2H3HnzpTB4Wi63j9TjujR0K4gbyL1WLw7C7Mgxenkzj7kFv6J6qbnOwX/4sWm6
sU0U4ueNIbqnqZl2RzTSjeDajG0e4nKH/9PeSY02nJm/mRYwy3LRuUs9CUcbBZBywF2cHBrcJnsF
MQaqH8egvKRE/UxHcbg6n9WDxbm5qQ==

--=__PartBBE55093.0__=
Content-Type: text/plain; name="Test1.cs"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="Test1.cs"

using System;
using System.Security.Cryptography.X509Certificates;

class X509CertTester{
   	static void Main(string[] args){
		X509Certificate x = X509Certificate.CreateFromCertFile (args[0]);
		Console.WriteLine (x.ToString (true));
		Console.WriteLine("Test me");
	}
}



--=__PartBBE55093.0__=--