pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 35)
Status: Inactive
                
                Brought to you by:
                
                    carlosga_fb
                    
                
            You can subscribe to this list here.
| 2003 | Jan | Feb | Mar | Apr | May | Jun | Jul (120) | Aug (95) | Sep (95) | Oct (213) | Nov (114) | Dec (64) | 
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 | Jan (6) | Feb (134) | Mar (88) | Apr (28) | May (22) | Jun (15) | Jul (23) | Aug (2) | Sep (15) | Oct (2) | Nov (6) | Dec | 
| 2005 | Jan (8) | Feb (6) | Mar | Apr (42) | May (3) | Jun | Jul | Aug | Sep (84) | Oct | Nov | Dec | 
| 2006 | Jan | Feb | Mar (84) | Apr (46) | May (40) | Jun (8) | Jul | Aug | Sep | Oct | Nov | Dec | 
| 
      
      
      From: <car...@us...> - 2003-10-27 18:53:41
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv23104 Modified Files: changelog.txt Log Message: * source/NPgClient/PgOutputPacket.cs: * source/NPgClient/PgResponsePacket.cs: - Added fix for correct handling of box type. - Added some changes to interval datatype handling. * source/PgTypes/PgBox.cs: - Added fix for correct handling of box type. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** changelog.txt 27 Oct 2003 12:25:40 -0000 1.65 --- changelog.txt 27 Oct 2003 18:47:15 -0000 1.66 *************** *** 8,12 **** * source/NPgClient/PgResponsePacket.cs: ! - Added some canges to interval datatype handling. 2003-10-26 Carlos Guzmán Álvarez <car...@te...> --- 8,19 ---- * source/NPgClient/PgResponsePacket.cs: ! - Added fix for correct handling of box type. ! ! - Added some changes to interval datatype handling. ! ! * source/PgTypes/PgBox.cs: ! ! - Added fix for correct handling of box type. ! 2003-10-26 Carlos Guzmán Álvarez <car...@te...> | 
| 
      
      
      From: <car...@us...> - 2003-10-27 12:31:36
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv13504 Modified Files: changelog.txt Log Message: 2003-10-27 Carlos Guzmán Álvarez <car...@te...> * source/NPgClient/PgOutputPacket.cs: * source/NPgClient/PgResponsePacket.cs: - Added some canges to interval datatype handling. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** changelog.txt 26 Oct 2003 14:58:31 -0000 1.64 --- changelog.txt 27 Oct 2003 12:25:40 -0000 1.65 *************** *** 2,5 **** --- 2,13 ---- ------------------------------------------------------- + + 2003-10-27 Carlos Guzmán Álvarez <car...@te...> + + * source/NPgClient/PgOutputPacket.cs: + * source/NPgClient/PgResponsePacket.cs: + + - Added some canges to interval datatype handling. + 2003-10-26 Carlos Guzmán Álvarez <car...@te...> | 
| 
      
      
      From: <car...@us...> - 2003-10-27 12:28:35
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient
In directory sc8-pr-cvs1:/tmp/cvs-serv13454
Modified Files:
	PgOutputPacket.cs PgResponsePacket.cs 
Log Message:
2003-10-27 Carlos Guzmán Álvarez <car...@te...>
	* source/NPgClient/PgOutputPacket.cs:
	* source/NPgClient/PgResponsePacket.cs:
		- Added some canges to interval datatype handling.
Index: PgOutputPacket.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** PgOutputPacket.cs	26 Oct 2003 14:58:04 -0000	1.15
--- PgOutputPacket.cs	27 Oct 2003 12:25:21 -0000	1.16
***************
*** 132,137 ****
  		public void WriteInterval(TimeSpan interval)
  		{
! 			this.WriteDouble(interval.TotalSeconds);
! 			this.WriteInt(0);
  		}
  
--- 132,140 ----
  		public void WriteInterval(TimeSpan interval)
  		{
! 			int months	= (interval.Days / 30);
! 			int days	= (interval.Days % 30);
! 
! 			this.WriteDouble(interval.Subtract(TimeSpan.FromDays(months * 30)).TotalSeconds);
! 			this.WriteInt(months);
  		}
  
Index: PgResponsePacket.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgResponsePacket.cs,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** PgResponsePacket.cs	26 Oct 2003 11:32:34 -0000	1.15
--- PgResponsePacket.cs	27 Oct 2003 12:25:21 -0000	1.16
***************
*** 220,227 ****
  		public TimeSpan ReadInterval()
  		{
! 			double	interval = this.ReadDouble();
! 			int		timezone = (-1)*(this.ReadInt()/3600);
  
! 			return TimeSpan.FromSeconds(interval);
  		}
  
--- 220,229 ----
  		public TimeSpan ReadInterval()
  		{
! 			double	intervalTime	= this.ReadDouble();
! 			int		intervalMonth	= this.ReadInt();
  
! 			TimeSpan interval = TimeSpan.FromSeconds(intervalTime);
! 			
! 			return interval.Add(TimeSpan.FromDays(intervalMonth*30));
  		}
  
***************
*** 237,242 ****
  			DateTime	time		= this.ReadTime();
  			int			timezone	= (-1)*(this.ReadInt()/3600);
  		
! 			return time;
  		}
  
--- 239,264 ----
  			DateTime	time		= this.ReadTime();
  			int			timezone	= (-1)*(this.ReadInt()/3600);
+ 
+ 			string format = "{0:D2}{1}{2:D2}{3}{4:D2}{5}";
+ 			if (timezone > 0)
+ 			{
+ 				format = "{0:D2}{1}{2:D2}{3}{4:D2}+{5}";
+ 			}
+ 
+ 			StringBuilder timeWithTZ = new StringBuilder();
+ 			timeWithTZ.AppendFormat(
+ 				format,
+ 				time.Hour,
+ 				CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator,
+ 				time.Minute, 
+ 				CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator,
+ 				time.Second,
+ 				timezone);
  		
! 			return DateTime.Parse(
! 				timeWithTZ.ToString(), 
! 				CultureInfo.CurrentCulture.DateTimeFormat,
! 				DateTimeStyles.NoCurrentDateDefault | 
! 				DateTimeStyles.AllowWhiteSpaces);
  		}
  
 | 
| 
      
      
      From: <car...@us...> - 2003-10-26 15:01:49
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv10779 Modified Files: changelog.txt Log Message: * source/PgDataReader.cs: - Added changes for handle new supported types and in SqlClient and OracleClient - New types are PgBox, PgCircle, PgPath, PgPoint, PgLSeg, PgPolygon and PgTimeSpan. * source/PgTypes/PgBox.cs: * source/PgTypes/PgCircle.cs: * source/PgTypes/PgLSeg.cs: * source/PgTypes/PgPath.cs: * source/PgTypes/PgPoint.cs: * source/PgTypes/PgPolygon.cs: - Changed to be structs instead of classes. * source/PgTypes/PgTimeSpan.cs: - New struct type for handle PostgreSQL interval types. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** changelog.txt 26 Oct 2003 11:33:31 -0000 1.63 --- changelog.txt 26 Oct 2003 14:58:31 -0000 1.64 *************** *** 14,17 **** --- 14,36 ---- - Started to work on support for timetz, timestamptz and interval types [not finished yet]. + * source/PgDataReader.cs: + + - Added changes for handle new supported types and in SqlClient and OracleClient + + - New types are PgBox, PgCircle, PgPath, PgPoint, PgLSeg, PgPolygon and PgTimeSpan. + + * source/PgTypes/PgBox.cs: + * source/PgTypes/PgCircle.cs: + * source/PgTypes/PgLSeg.cs: + * source/PgTypes/PgPath.cs: + * source/PgTypes/PgPoint.cs: + * source/PgTypes/PgPolygon.cs: + + - Changed to be structs instead of classes. + + * source/PgTypes/PgTimeSpan.cs: + + - New struct type for handle PostgreSQL interval types. + 2003-10-25 Carlos Guzmán Álvarez <car...@te...> | 
| 
      
      
      From: <car...@us...> - 2003-10-26 14:58:40
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1:/tmp/cvs-serv10695 Modified Files: PgOutputPacket.cs Log Message: * source/PgDataReader.cs: - Added changes for handle new supported types and in SqlClient and OracleClient - New types are PgBox, PgCircle, PgPath, PgPoint, PgLSeg, PgPolygon and PgTimeSpan. * source/PgTypes/PgBox.cs: * source/PgTypes/PgCircle.cs: * source/PgTypes/PgLSeg.cs: * source/PgTypes/PgPath.cs: * source/PgTypes/PgPoint.cs: * source/PgTypes/PgPolygon.cs: - Changed to be structs instead of classes. * source/PgTypes/PgTimeSpan.cs: - New struct type for handle PostgreSQL interval types. Index: PgOutputPacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PgOutputPacket.cs 26 Oct 2003 11:32:34 -0000 1.14 --- PgOutputPacket.cs 26 Oct 2003 14:58:04 -0000 1.15 *************** *** 391,430 **** case PgDataType.Point: - PgPoint point = value as PgPoint; - packet.WriteInt(size); ! packet.WritePoint(point); break; case PgDataType.Circle: - PgCircle circle = value as PgCircle; - packet.WriteInt(size); ! packet.WriteCircle(circle); break; case PgDataType.Line: - PgLine line = value as PgLine; - packet.WriteInt(size); ! packet.WriteLine(line); break; case PgDataType.LSeg: - PgLSeg lseg = value as PgLSeg; - packet.WriteInt(size); ! packet.WriteLSeg(lseg); break; case PgDataType.Box: - PgBox box = value as PgBox; - packet.WriteInt(size); ! packet.WriteBox(box); break; case PgDataType.Polygon: ! PgPolygon polygon = value as PgPolygon; packet.WriteInt(size*polygon.Points.Length); --- 391,420 ---- case PgDataType.Point: packet.WriteInt(size); ! packet.WritePoint((PgPoint)value); break; case PgDataType.Circle: packet.WriteInt(size); ! packet.WriteCircle((PgCircle)value); break; case PgDataType.Line: packet.WriteInt(size); ! packet.WriteLine((PgLine)value); break; case PgDataType.LSeg: packet.WriteInt(size); ! packet.WriteLSeg((PgLSeg)value); break; case PgDataType.Box: packet.WriteInt(size); ! packet.WriteBox((PgBox)value); break; case PgDataType.Polygon: ! PgPolygon polygon = (PgPolygon)value; packet.WriteInt(size*polygon.Points.Length); *************** *** 433,437 **** case PgDataType.Path: ! PgPath path = value as PgPath; packet.WriteInt(size*path.Points.Length); --- 423,427 ---- case PgDataType.Path: ! PgPath path = (PgPath)value; packet.WriteInt(size*path.Points.Length); | 
| 
      
      
      From: <car...@us...> - 2003-10-26 14:58:12
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes In directory sc8-pr-cvs1:/tmp/cvs-serv10651 Added Files: PgTimeSpan.cs Log Message: * source/PgDataReader.cs: - Added changes for handle new supported types and in SqlClient and OracleClient - New types are PgBox, PgCircle, PgPath, PgPoint, PgLSeg, PgPolygon and PgTimeSpan. * source/PgTypes/PgBox.cs: * source/PgTypes/PgCircle.cs: * source/PgTypes/PgLSeg.cs: * source/PgTypes/PgPath.cs: * source/PgTypes/PgPoint.cs: * source/PgTypes/PgPolygon.cs: - Changed to be structs instead of classes. * source/PgTypes/PgTimeSpan.cs: - New struct type for handle PostgreSQL interval types. --- NEW FILE: PgTimeSpan.cs --- (This appears to be a binary file; contents omitted.) | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes
In directory sc8-pr-cvs1:/tmp/cvs-serv10561
Modified Files:
	PgBox.cs PgCircle.cs PgLine.cs PgLSeg.cs PgPath.cs PgPoint.cs 
	PgPolygon.cs 
Log Message:
	* source/PgDataReader.cs:
		- Added changes for handle new supported types and in SqlClient and OracleClient 
		- New types are PgBox, PgCircle, PgPath, PgPoint, PgLSeg, PgPolygon and PgTimeSpan.
	* source/PgTypes/PgBox.cs:
	* source/PgTypes/PgCircle.cs:
	* source/PgTypes/PgLSeg.cs:
	* source/PgTypes/PgPath.cs:
	* source/PgTypes/PgPoint.cs:
	* source/PgTypes/PgPolygon.cs:
		- Changed to be structs instead of classes.
	* source/PgTypes/PgTimeSpan.cs:	
		- New struct type for handle PostgreSQL interval types.
Index: PgBox.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgBox.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PgBox.cs	18 Oct 2003 13:11:18 -0000	1.3
--- PgBox.cs	26 Oct 2003 14:56:59 -0000	1.4
***************
*** 21,25 ****
  namespace PostgreSql.Data.PgTypes
  {
! 	public class PgBox
  	{
  		#region FIELDS
--- 21,25 ----
  namespace PostgreSql.Data.PgTypes
  {
! 	public struct PgBox
  	{
  		#region FIELDS
***************
*** 105,109 ****
  			if (obj is PgBox)
  			{
! 				return (obj as PgBox) == this;
  			}
  			else
--- 105,109 ----
  			if (obj is PgBox)
  			{
! 				return ((PgBox)obj) == this;
  			}
  			else
Index: PgCircle.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgCircle.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PgCircle.cs	18 Oct 2003 13:11:18 -0000	1.2
--- PgCircle.cs	26 Oct 2003 14:56:59 -0000	1.3
***************
*** 21,25 ****
  namespace PostgreSql.Data.PgTypes
  {
! 	public class PgCircle
  	{
  		#region FIELDS
--- 21,25 ----
  namespace PostgreSql.Data.PgTypes
  {
! 	public struct PgCircle
  	{
  		#region FIELDS
***************
*** 102,106 ****
  			if (obj is PgCircle)
  			{
! 				return (obj as PgCircle) == this;
  			}
  			else
--- 102,106 ----
  			if (obj is PgCircle)
  			{
! 				return ((PgCircle)obj) == this;
  			}
  			else
Index: PgLine.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgLine.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PgLine.cs	18 Oct 2003 13:11:18 -0000	1.2
--- PgLine.cs	26 Oct 2003 14:56:59 -0000	1.3
***************
*** 21,25 ****
  namespace PostgreSql.Data.PgTypes
  {
! 	public class PgLine
  	{
  		#region FIELDS
--- 21,25 ----
  namespace PostgreSql.Data.PgTypes
  {
! 	public struct PgLine
  	{
  		#region FIELDS
***************
*** 105,109 ****
  			if (obj is PgLine)
  			{
! 				return (obj as PgLine) == this;
  			}
  			else
--- 105,109 ----
  			if (obj is PgLine)
  			{
! 				return ((PgLine)obj) == this;
  			}
  			else
Index: PgLSeg.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgLSeg.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PgLSeg.cs	20 Oct 2003 21:39:41 -0000	1.3
--- PgLSeg.cs	26 Oct 2003 14:56:59 -0000	1.4
***************
*** 21,25 ****
  namespace PostgreSql.Data.PgTypes
  {
! 	public class PgLSeg
  	{
  		#region FIELDS
--- 21,25 ----
  namespace PostgreSql.Data.PgTypes
  {
! 	public struct PgLSeg
  	{
  		#region FIELDS
***************
*** 105,109 ****
  			if (obj is PgLSeg)
  			{
! 				return (obj as PgLSeg) == this;
  			}
  			else
--- 105,109 ----
  			if (obj is PgLSeg)
  			{
! 				return ((PgLSeg)obj) == this;
  			}
  			else
Index: PgPath.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgPath.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PgPath.cs	20 Oct 2003 21:39:41 -0000	1.2
--- PgPath.cs	26 Oct 2003 14:56:59 -0000	1.3
***************
*** 21,25 ****
  namespace PostgreSql.Data.PgTypes
  {
! 	public class PgPath
  	{
  		#region FIELDS
--- 21,25 ----
  namespace PostgreSql.Data.PgTypes
  {
! 	public struct PgPath
  	{
  		#region FIELDS
***************
*** 129,133 ****
  			if (obj is PgPath)
  			{
! 				return (obj as PgPath) == this;
  			}
  			else
--- 129,133 ----
  			if (obj is PgPath)
  			{
! 				return ((PgPath)obj) == this;
  			}
  			else
Index: PgPoint.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgPoint.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PgPoint.cs	18 Oct 2003 13:11:18 -0000	1.2
--- PgPoint.cs	26 Oct 2003 14:56:59 -0000	1.3
***************
*** 21,25 ****
  namespace PostgreSql.Data.PgTypes
  {
! 	public class PgPoint
  	{
  		#region FIELDS
--- 21,25 ----
  namespace PostgreSql.Data.PgTypes
  {
! 	public struct PgPoint
  	{
  		#region FIELDS
***************
*** 101,105 ****
  			if (obj is PgPoint)
  			{
! 				return (obj as PgPoint) == this;
  			}
  			else
--- 101,105 ----
  			if (obj is PgPoint)
  			{
! 				return ((PgPoint)obj) == this;
  			}
  			else
Index: PgPolygon.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgPolygon.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PgPolygon.cs	20 Oct 2003 21:39:41 -0000	1.3
--- PgPolygon.cs	26 Oct 2003 14:56:59 -0000	1.4
***************
*** 21,25 ****
  namespace PostgreSql.Data.PgTypes
  {
! 	public class PgPolygon
  	{
  		#region FIELDS
--- 21,25 ----
  namespace PostgreSql.Data.PgTypes
  {
! 	public struct PgPolygon
  	{
  		#region FIELDS
***************
*** 122,126 ****
  			if (obj is PgPolygon)
  			{
! 				return (obj as PgPolygon) == this;
  			}
  			else
--- 122,126 ----
  			if (obj is PgPolygon)
  			{
! 				return ((PgPolygon)obj) == this;
  			}
  			else
 | 
| 
      
      
      From: <car...@us...> - 2003-10-26 14:57:25
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source
In directory sc8-pr-cvs1:/tmp/cvs-serv10531
Modified Files:
	PgDataReader.cs 
Log Message:
	* source/PgDataReader.cs:
		- Added changes for handle new supported types and in SqlClient and OracleClient 
		- New types are PgBox, PgCircle, PgPath, PgPoint, PgLSeg, PgPolygon and PgTimeSpan.
	* source/PgTypes/PgBox.cs:
	* source/PgTypes/PgCircle.cs:
	* source/PgTypes/PgLSeg.cs:
	* source/PgTypes/PgPath.cs:
	* source/PgTypes/PgPoint.cs:
	* source/PgTypes/PgPolygon.cs:
		- Changed to be structs instead of classes.
	* source/PgTypes/PgTimeSpan.cs:	
		- New struct type for handle PostgreSQL interval types.
Index: PgDataReader.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** PgDataReader.cs	17 Oct 2003 18:21:14 -0000	1.10
--- PgDataReader.cs	26 Oct 2003 14:56:38 -0000	1.11
***************
*** 24,29 ****
--- 24,31 ----
  using System.Reflection;
  using System.ComponentModel;
+ 
  using PostgreSql.Data.NPgClient;
  using PostgreSql.Data.PgSqlClient.DbSchema;
+ using PostgreSql.Data.PgTypes;
  
  namespace PostgreSql.Data.PgSqlClient
***************
*** 394,398 ****
  		}
  
! 		public Object GetValue(int i)
  		{
  			if (position == STARTPOS)
--- 396,400 ----
  		}
  
! 		public object GetValue(int i)
  		{
  			if (position == STARTPOS)
***************
*** 555,558 ****
--- 557,622 ----
  
  			return Convert.ToDateTime(GetValue(i));
+ 		}
+ 
+ 		public TimeSpan GetTimeSpan(int i)
+ 		{
+ 			if (position == STARTPOS)
+ 			{
+ 				throw new InvalidOperationException("There are no data to read.");
+ 			}
+ 
+ 			return (TimeSpan)GetValue(i);
+ 		}
+ 
+ 		public PgPoint GetPgPoint(int i)
+ 		{
+ 			return (PgPoint)this.GetPgValue(i);
+ 		}
+ 
+ 		public PgBox GetPgBox(int i)
+ 		{
+ 			return (PgBox)this.GetPgValue(i);
+ 		}
+ 
+ 		public PgLSeg GetPgLSeg(int i)
+ 		{
+ 			return (PgLSeg)this.GetPgValue(i);
+ 		}
+ 
+ 		public PgCircle GetPgCircle(int i)
+ 		{
+ 			return (PgCircle)this.GetPgValue(i);
+ 		}
+ 
+ 		public PgPath GetPgPath(int i)
+ 		{
+ 			return (PgPath)this.GetPgValue(i);
+ 		}
+ 
+ 		public PgPolygon GetPgPolygon(int i)
+ 		{
+ 			return (PgPolygon)this.GetPgValue(i);
+ 		}
+ 
+ 		public PgTimeSpan GetPgTimeSpan(int i)
+ 		{
+ 			return new PgTimeSpan(this.GetTimeSpan(i));
+ 		}
+ 
+ 		public object GetPgValue(int i)
+ 		{
+ 			switch (this.getProviderType(i))
+ 			{
+ 				case PgDbType.Interval:
+ 					return this.GetPgTimeSpan(i);
+ 
+ 				default:
+ 					return this.getValue(i);
+ 			}
+ 		}
+ 
+ 		public int GetPgValues(object[] values)
+ 		{
+ 			return this.GetValues(values);
  		}
  
 | 
| 
      
      
      From: <car...@us...> - 2003-10-26 11:36:34
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv4968 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** changelog.txt 25 Oct 2003 21:01:55 -0000 1.62 --- changelog.txt 26 Oct 2003 11:33:31 -0000 1.63 *************** *** 2,5 **** --- 2,17 ---- ------------------------------------------------------- + 2003-10-26 Carlos Guzmán Álvarez <car...@te...> + + * source/NPgClient/PgDbClient.cs: + * source/NPgClient/PgOutputPacket.cs: + * source/NPgClient/PgResponsePacket.cs: + * source/NPgClient/PgDataType.cs: + * source/PgDbType.cs: + * source/PgParameter.cs: + * source/PgType.cs: + + - Started to work on support for timetz, timestamptz and interval types [not finished yet]. + 2003-10-25 Carlos Guzmán Álvarez <car...@te...> | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient
In directory sc8-pr-cvs1:/tmp/cvs-serv4782
Modified Files:
	PgDataType.cs PgDbClient.cs PgOutputPacket.cs 
	PgResponsePacket.cs PgType.cs 
Log Message:
2003-10-26 Carlos Guzmán Álvarez <car...@te...>
	* source/NPgClient/PgDbClient.cs:
	* source/NPgClient/PgOutputPacket.cs:
	* source/NPgClient/PgResponsePacket.cs:
	* source/NPgClient/PgDataType.cs:
	* source/PgDbType.cs:
	* source/PgParameter.cs:
	* source/PgType.cs:
		- Started to work on support for timetz, timestamptz and interval types [not finished yet].
Index: PgDataType.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDataType.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PgDataType.cs	25 Oct 2003 20:52:53 -0000	1.3
--- PgDataType.cs	26 Oct 2003 11:32:33 -0000	1.4
***************
*** 41,44 ****
--- 41,45 ----
  		Int4			,
  		Int8			,
+ 		Interval		,
  		Line			,
  		LSeg			,
***************
*** 49,53 ****
  		Text			,
  		Time			,
! 		TimeStamp		,
  		VarChar			,
  		Vector
--- 50,56 ----
  		Text			,
  		Time			,
! 		TimeWithTZ		,
! 		Timestamp		,
! 		TimestampWithTZ	,
  		VarChar			,
  		Vector
Index: PgDbClient.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** PgDbClient.cs	25 Oct 2003 20:52:53 -0000	1.28
--- PgDbClient.cs	26 Oct 2003 11:32:33 -0000	1.29
***************
*** 695,699 ****
  			types.Add(1082	, "date"		, PgDataType.Date		, 0, 1, 4);
  			types.Add(1083	, "time"		, PgDataType.Time		, 0, 1, 8);
! 			types.Add(1114	, "timestamp"	, PgDataType.TimeStamp	, 0, 1, 8);
  			types.Add(1560	, "bit"			, PgDataType.Byte		, 0, 0, 1);
  			types.Add(1562	, "varbit"		, PgDataType.Byte		, 0, 1, 0);
--- 695,702 ----
  			types.Add(1082	, "date"		, PgDataType.Date		, 0, 1, 4);
  			types.Add(1083	, "time"		, PgDataType.Time		, 0, 1, 8);
! 			types.Add(1114	, "timestamp"	, PgDataType.Timestamp	, 0, 1, 8);
! 			types.Add(1184	, "timestamptz"	, PgDataType.TimestampWithTZ, 0, 1, 8);
! 			types.Add(1186	, "interval"	, PgDataType.Interval	, 0, 1, 12);
! 			types.Add(1266	, "timetz"		, PgDataType.TimeWithTZ	, 0, 1, 12);
  			types.Add(1560	, "bit"			, PgDataType.Byte		, 0, 0, 1);
  			types.Add(1562	, "varbit"		, PgDataType.Byte		, 0, 1, 0);
Index: PgOutputPacket.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** PgOutputPacket.cs	18 Oct 2003 14:46:26 -0000	1.13
--- PgOutputPacket.cs	26 Oct 2003 11:32:34 -0000	1.14
***************
*** 66,92 ****
  		#endregion
  
! 		#region WRITE_METHODS
! 
! 		// Standard types
  
  		public void WriteString(string data)
  		{
! 			Write(data.ToCharArray());
! 			Write(PgCodes.NULL_TERMINATOR);
  		}
  
  		public void WriteShort(short val)
  		{
! 			Write((short)IPAddress.HostToNetworkOrder(val));
  		}
  
  		public void WriteInt(int val)
  		{
! 			Write((int)IPAddress.HostToNetworkOrder(val));
  		}
  
  		public void WriteLong(long val)
  		{
! 			Write((long)IPAddress.HostToNetworkOrder(val));
  		}
  
--- 66,94 ----
  		#endregion
  
! 		#region STRING_TYPES_WRITE
  
  		public void WriteString(string data)
  		{
! 			this.Write(data.ToCharArray());
! 			this.Write(PgCodes.NULL_TERMINATOR);
  		}
  
+ 		#endregion
+ 
+ 		#region NUMERIC_TYPES_WRITE
+ 
  		public void WriteShort(short val)
  		{
! 			this.Write((short)IPAddress.HostToNetworkOrder(val));
  		}
  
  		public void WriteInt(int val)
  		{
! 			this.Write((int)IPAddress.HostToNetworkOrder(val));
  		}
  
  		public void WriteLong(long val)
  		{
! 			this.Write((long)IPAddress.HostToNetworkOrder(val));
  		}
  
***************
*** 98,102 ****
  			floatValue.i0 = IPAddress.HostToNetworkOrder(floatValue.i0);
  
! 			Write(floatValue.f);
  		}
  
--- 100,104 ----
  			floatValue.i0 = IPAddress.HostToNetworkOrder(floatValue.i0);
  
! 			this.Write(floatValue.f);
  		}
  
***************
*** 114,132 ****
  			doubleValue.i4 = temp;
  
! 			Write(doubleValue.d);
  		}
  
  		public void WriteDate(DateTime date)
  		{
  			TimeSpan days = date.Subtract(PgCodes.BASE_DATE);
  
! 			WriteInt(days.Days);
  		}
  
! 		public void WriteTimestamp(DateTime timestamp)
  		{
! 			TimeSpan days = timestamp.Subtract(PgCodes.BASE_DATE);
! 
! 			WriteDouble(days.TotalSeconds);
  		}
  
--- 116,137 ----
  			doubleValue.i4 = temp;
  
! 			this.Write(doubleValue.d);
  		}
  
+ 		#endregion
+ 
+ 		#region DATE_TIME_WRITE
+ 
  		public void WriteDate(DateTime date)
  		{
  			TimeSpan days = date.Subtract(PgCodes.BASE_DATE);
  
! 			this.WriteInt(days.Days);
  		}
  
! 		public void WriteInterval(TimeSpan interval)
  		{
! 			this.WriteDouble(interval.TotalSeconds);
! 			this.WriteInt(0);
  		}
  
***************
*** 134,179 ****
  		{
  			DateTime realTime = new DateTime(PgCodes.BASE_DATE.Year,
! 											PgCodes.BASE_DATE.Month,
! 											PgCodes.BASE_DATE.Day,
! 											time.Hour,
! 											time.Minute,
! 											time.Second,
! 											time.Millisecond);
  
  			TimeSpan seconds = realTime.Subtract(PgCodes.BASE_DATE);
  
! 			WriteDouble(seconds.TotalSeconds);
  		}
  
! 		// Geometric types
  
  		public void WritePoint(PgPoint point)
  		{
! 			WriteDouble(point.X);
! 			WriteDouble(point.Y);
  		}
  
  		public void WriteCircle(PgCircle circle)
  		{
! 			WritePoint(circle.Center);
! 			WriteDouble(circle.Radius);
  		}
  
  		public void WriteLine(PgLine line)
  		{
! 			WritePoint(line.StartPoint);
! 			WritePoint(line.EndPoint);
  		}
  
  		public void WriteLSeg(PgLSeg lseg)
  		{
! 			WritePoint(lseg.StartPoint);
! 			WritePoint(lseg.EndPoint);
  		}
  
  		public void WriteBox(PgBox box)
  		{
! 			WritePoint(box.UpperRight);
! 			WritePoint(box.LowerLeft);
  		}
  
--- 139,216 ----
  		{
  			DateTime realTime = new DateTime(PgCodes.BASE_DATE.Year,
! 				PgCodes.BASE_DATE.Month,
! 				PgCodes.BASE_DATE.Day,
! 				time.Hour,
! 				time.Minute,
! 				time.Second,
! 				time.Millisecond);
  
  			TimeSpan seconds = realTime.Subtract(PgCodes.BASE_DATE);
  
! 			this.WriteDouble(seconds.TotalSeconds);
  		}
  
! 		public void WriteTimeWithTZ(DateTime time)
! 		{
! 			DateTime realTime = new DateTime(PgCodes.BASE_DATE.Year,
! 				PgCodes.BASE_DATE.Month,
! 				PgCodes.BASE_DATE.Day,
! 				time.Hour,
! 				time.Minute,
! 				time.Second,
! 				time.Millisecond);
! 
! 			TimeSpan seconds = realTime.Subtract(PgCodes.BASE_DATE);
! 
! 			this.WriteDouble(seconds.TotalSeconds);
! 			this.WriteInt(0);
! 		}
! 
! 		public void WriteTimestamp(DateTime timestamp)
! 		{
! 			TimeSpan days = timestamp.Subtract(PgCodes.BASE_DATE);
! 
! 			this.WriteDouble(days.TotalSeconds);
! 		}
! 
! 		public void WriteTimestampWithTZ(DateTime timestamp)
! 		{
! 			TimeSpan days = timestamp.Subtract(PgCodes.BASE_DATE);
! 
! 			this.WriteDouble(days.TotalSeconds);
! 		}
! 
! 		#endregion
! 
! 		#region GEOMETRIC_TYPES_WRITE
  
  		public void WritePoint(PgPoint point)
  		{
! 			this.WriteDouble(point.X);
! 			this.WriteDouble(point.Y);
  		}
  
  		public void WriteCircle(PgCircle circle)
  		{
! 			this.WritePoint(circle.Center);
! 			this.WriteDouble(circle.Radius);
  		}
  
  		public void WriteLine(PgLine line)
  		{
! 			this.WritePoint(line.StartPoint);
! 			this.WritePoint(line.EndPoint);
  		}
  
  		public void WriteLSeg(PgLSeg lseg)
  		{
! 			this.WritePoint(lseg.StartPoint);
! 			this.WritePoint(lseg.EndPoint);
  		}
  
  		public void WriteBox(PgBox box)
  		{
! 			this.WritePoint(box.UpperRight);
! 			this.WritePoint(box.LowerLeft);
  		}
  
***************
*** 182,186 ****
  			for (int i = 0; i < polygon.Points.Length; i++)
  			{
! 				WritePoint(polygon.Points[0]);
  			}
  		}
--- 219,223 ----
  			for (int i = 0; i < polygon.Points.Length; i++)
  			{
! 				this.WritePoint(polygon.Points[0]);
  			}
  		}
***************
*** 190,198 ****
  			for (int i = 0; i < path.Points.Length; i++)
  			{
! 				WritePoint(path.Points[0]);
  			}
  		}
  
! 		// Parameters
  
  		public void WriteParameter(PgParameter parameter)
--- 227,237 ----
  			for (int i = 0; i < path.Points.Length; i++)
  			{
! 				this.WritePoint(path.Points[0]);
  			}
  		}
  
! 		#endregion
! 
! 		#region PARAMETER_WRITE
  
  		public void WriteParameter(PgParameter parameter)
***************
*** 204,208 ****
  			{
  				// -1 indicates a NULL argument value
! 				WriteInt(-1);
  			}
  			else
--- 243,247 ----
  			{
  				// -1 indicates a NULL argument value
! 				this.WriteInt(-1);
  			}
  			else
***************
*** 251,255 ****
  				else
  				{
! 					writeParameter(this, parameter.DataType.DataType, size, parameter.Value);
  				}
  			}
--- 290,294 ----
  				else
  				{
! 					this.writeParameter(this, parameter.DataType.DataType, size, parameter.Value);
  				}
  			}
***************
*** 289,292 ****
--- 328,336 ----
  					break;
  
+ 				case PgDataType.Interval:
+ 					packet.WriteInt(size);
+ 					packet.WriteInterval((TimeSpan)value);
+ 					break;
+ 
  				case PgDataType.Decimal:
  				{
***************
*** 322,328 ****
  					break;
  
! 				case PgDataType.TimeStamp:
  					packet.WriteInt(size);
  					packet.WriteTimestamp((DateTime)value);
  					break;
  
--- 366,382 ----
  					break;
  
! 				case PgDataType.TimeWithTZ:
! 					packet.WriteInt(size);
! 					packet.WriteTimeWithTZ((DateTime)value);
! 					break;
! 
! 				case PgDataType.Timestamp:
  					packet.WriteInt(size);
  					packet.WriteTimestamp((DateTime)value);
+ 					break;
+ 
+ 				case PgDataType.TimestampWithTZ:
+ 					packet.WriteInt(size);
+ 					packet.WriteTimestampWithTZ((DateTime)value);
  					break;
  
Index: PgResponsePacket.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgResponsePacket.cs,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** PgResponsePacket.cs	19 Oct 2003 14:08:22 -0000	1.14
--- PgResponsePacket.cs	26 Oct 2003 11:32:34 -0000	1.15
***************
*** 115,119 ****
  		#endregion
  
! 		#region READ_METHODS
  
  		public string ReadNullString()
--- 115,119 ----
  		#endregion
  
! 		#region STRING_TYPES_READ
  
  		public string ReadNullString()
***************
*** 149,152 ****
--- 149,156 ----
  		}
  
+ 		#endregion
+ 
+ 		#region NUMERIC_TYPES_READ
+ 
  		public short ReadShort()
  		{
***************
*** 199,203 ****
  
  			return doubleValue.d;
! 		}		
  
  		public DateTime ReadDate()
--- 203,211 ----
  
  			return doubleValue.d;
! 		}
! 
! 		#endregion
! 
! 		#region DATE_TIME_TYPES_READ
  
  		public DateTime ReadDate()
***************
*** 210,213 ****
--- 218,229 ----
  		}
  
+ 		public TimeSpan ReadInterval()
+ 		{
+ 			double	interval = this.ReadDouble();
+ 			int		timezone = (-1)*(this.ReadInt()/3600);
+ 
+ 			return TimeSpan.FromSeconds(interval);
+ 		}
+ 
  		public DateTime ReadTime()
  		{
***************
*** 217,220 ****
--- 233,244 ----
  		}
  
+ 		public DateTime ReadTimeWithTZ()
+ 		{
+ 			DateTime	time		= this.ReadTime();
+ 			int			timezone	= (-1)*(this.ReadInt()/3600);
+ 		
+ 			return time;
+ 		}
+ 
  		public DateTime ReadTimestamp()
  		{
***************
*** 224,227 ****
--- 248,260 ----
  		}
  
+ 		public DateTime ReadTimestampWithTZ()
+ 		{
+ 			return this.ReadTimestamp();
+ 		}
+ 
+ 		#endregion
+ 
+ 		#region ARRAY_VECTOR_TYPES_READ
+ 
  		public Array ReadArray(PgType type, int length)
  		{
***************
*** 289,293 ****
  		}
  
! 		// Geometric datatypes methods 
  
  		public PgPoint ReadPoint()
--- 322,328 ----
  		}
  
! 		#endregion
! 
! 		#region GEOMETRIC_TYPES_READ
  
  		public PgPoint ReadPoint()
***************
*** 346,350 ****
  		#endregion
  
! 		#region READ_VALUE
  
  		public object ReadValue(PgType type, int length)
--- 381,385 ----
  		#endregion
  
! 		#region COMMONT_READ_METHOD
  
  		public object ReadValue(PgType type, int length)
***************
*** 393,404 ****
  					return this.ReadLong();
  
  				case PgDataType.Date:
  					return this.ReadDate();					
  
  				case PgDataType.Time:
! 					return this.ReadTime();					
  
! 				case PgDataType.TimeStamp:
  					return this.ReadTimestamp();
  
  				case PgDataType.Point:
--- 428,448 ----
  					return this.ReadLong();
  
+ 				case PgDataType.Interval:
+ 					return this.ReadInterval();
+ 
  				case PgDataType.Date:
  					return this.ReadDate();					
  
  				case PgDataType.Time:
! 					return this.ReadTime();
  
! 				case PgDataType.TimeWithTZ:
! 					return this.ReadTimeWithTZ();					
! 
! 				case PgDataType.Timestamp:
  					return this.ReadTimestamp();
+ 
+ 				case PgDataType.TimestampWithTZ:
+ 					return this.ReadTimestampWithTZ();
  
  				case PgDataType.Point:
Index: PgType.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgType.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PgType.cs	20 Oct 2003 20:30:29 -0000	1.8
--- PgType.cs	26 Oct 2003 11:32:34 -0000	1.9
***************
*** 185,189 ****
  				case PgDataType.Date:
  				case PgDataType.Time:
! 				case PgDataType.TimeStamp:
  					return Type.GetType("System.DateTime");
  
--- 185,191 ----
  				case PgDataType.Date:
  				case PgDataType.Time:
! 				case PgDataType.TimeWithTZ:
! 				case PgDataType.Timestamp:
! 				case PgDataType.TimestampWithTZ:
  					return Type.GetType("System.DateTime");
  
 | 
| 
      
      
      From: <car...@us...> - 2003-10-26 11:35:55
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv4661 Modified Files: PgDbType.cs PgParameter.cs Log Message: 2003-10-26 Carlos Guzmán Álvarez <car...@te...> * source/NPgClient/PgDbClient.cs: * source/NPgClient/PgOutputPacket.cs: * source/NPgClient/PgResponsePacket.cs: * source/NPgClient/PgDataType.cs: * source/PgDbType.cs: * source/PgParameter.cs: * source/PgType.cs: - Started to work on support for timetz, timestamptz and interval types [not finished yet]. Index: PgDbType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDbType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgDbType.cs 17 Oct 2003 18:21:14 -0000 1.4 --- PgDbType.cs 26 Oct 2003 11:31:59 -0000 1.5 *************** *** 28,32 **** Boolean , Box , ! Byte , Char , Circle , --- 28,32 ---- Boolean , Box , ! Byte , Char , Circle , *************** *** 37,51 **** Float , Int2 , ! Int4 , Int8 , Line , LSeg , ! Numeric , Path , Point , ! Polygon , Text , Time , ! TimeStamp , VarChar , Vector --- 37,54 ---- Float , Int2 , ! Int4 , Int8 , + Interval , Line , LSeg , ! Numeric , Path , Point , ! Polygon , Text , Time , ! TimeWithTZ , ! Timestamp , ! TimestampWithTZ , VarChar , Vector Index: PgParameter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgParameter.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgParameter.cs 29 Sep 2003 19:41:39 -0000 1.7 --- PgParameter.cs 26 Oct 2003 11:32:00 -0000 1.8 *************** *** 291,295 **** case TypeCode.DateTime: ! PgDbType = PgDbType.TimeStamp; break; --- 291,295 ---- case TypeCode.DateTime: ! PgDbType = PgDbType.Timestamp; break; *************** *** 340,344 **** return DbType.Time; ! case PgDbType.TimeStamp: return DbType.DateTime; --- 340,344 ---- return DbType.Time; ! case PgDbType.Timestamp: return DbType.DateTime; *************** *** 387,391 **** case DbType.DateTime: ! return PgDbType.TimeStamp; case DbType.Int16: --- 387,391 ---- case DbType.DateTime: ! return PgDbType.Timestamp; case DbType.Int16: | 
| 
      
      
      From: <car...@us...> - 2003-10-25 22:01:26
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source
In directory sc8-pr-cvs1:/tmp/cvs-serv32010
Modified Files:
	PgGeometicTypesTest.cs 
Log Message:
Added empty test methods
Index: PgGeometicTypesTest.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgGeometicTypesTest.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PgGeometicTypesTest.cs	25 Oct 2003 20:59:49 -0000	1.1
--- PgGeometicTypesTest.cs	25 Oct 2003 21:59:33 -0000	1.2
***************
*** 19,30 ****
  using System;
  using System.Data;
- using PostgreSql.Data.PgSqlClient;
  using NUnit.Framework;
  
  namespace PostgreSql.Data.PgSqlClient.UnitTests
  {
  	[TestFixture]
! 	public class PgCommandTest : PgBaseTest
  	{
  	}
  }
--- 19,91 ----
  using System;
  using System.Data;
  using NUnit.Framework;
  
+ using PostgreSql.Data.PgSqlClient;
+ using PostgreSql.Data.PgTypes;
+ 
  namespace PostgreSql.Data.PgSqlClient.UnitTests
  {
  	[TestFixture]
! 	public class PgGeometricTypesTest : PgBaseTest
  	{
+ 		[Test]
+ 		public void PointTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void LineSegmentTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void BoxTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void PathTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void PolygonTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void CircleTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void PointArrayTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void LineSegmentArrayTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void BoxArrayTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void PathArrayTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void PolygonArrayTest()
+ 		{
+ 		}
+ 
+ 		[Test]
+ 		public void CircleArrayTest()
+ 		{
+ 		}
  	}
  }
 | 
| 
      
      
      From: <car...@us...> - 2003-10-25 21:07:20
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv22158 Modified Files: changelog.txt Log Message: updated changelog.txt Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** changelog.txt 25 Oct 2003 21:00:16 -0000 1.61 --- changelog.txt 25 Oct 2003 21:01:55 -0000 1.62 *************** *** 13,16 **** --- 13,23 ---- - Changed visibility level to internal + * source/DbSchema/PgAbstractDbSchema.cs: + + - Added fix for transaction handling. + + - Added better exception handling. + + 2003-10-24 Carlos Guzmán Álvarez <car...@te...> | 
| 
      
      
      From: <car...@us...> - 2003-10-25 21:05:37
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema
In directory sc8-pr-cvs1:/tmp/cvs-serv22058
Modified Files:
	PgAbstractDbSchema.cs 
Log Message:
* source/DbSchema/PgAbstractDbSchema.cs:
    - Added fix for transaction handling.
    - Added better exception handling.
Index: PgAbstractDbSchema.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgAbstractDbSchema.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PgAbstractDbSchema.cs	2 Aug 2003 19:43:01 -0000	1.1.1.1
--- PgAbstractDbSchema.cs	25 Oct 2003 21:01:23 -0000	1.2
***************
*** 176,191 ****
  			restrictions = ParseRestrictions(restrictions);
  
! 			PgCommand command = new PgCommand();
  			
! 			command.Connection	= connection;
! 			command.CommandText = GetCommandText(restrictions);
! 
! 			PgDataAdapter	adapter = new PgDataAdapter(command);
! 			DataSet			dataSet = new DataSet(tableName);
  
! 			adapter.Fill(dataSet, tableName);
  
! 			command.Dispose();
! 			adapter.Dispose();
  
  			return dataSet.Tables[tableName];
--- 176,211 ----
  			restrictions = ParseRestrictions(restrictions);
  
! 			DataSet			dataSet = null;
! 			PgDataAdapter	adapter = null;
! 			PgCommand		command = new PgCommand();
  			
! 			try
! 			{
! 				command.Connection	= connection;
! 				command.CommandText = GetCommandText(restrictions);
! 				if (connection.ActiveTransaction != null &&
! 					!connection.ActiveTransaction.IsUpdated)
! 				{
! 					command.Transaction = connection.ActiveTransaction;
! 				}
  
! 				adapter = new PgDataAdapter(command);
! 				dataSet = new DataSet(tableName);
  
! 				adapter.Fill(dataSet, tableName);
! 			}
! 			catch (PgException pgex)
! 			{
! 				throw pgex;
! 			}
! 			catch (Exception ex)
! 			{
! 				throw new PgException(ex.Message);
! 			}
! 			finally
! 			{
! 				command.Dispose();
! 				adapter.Dispose();
! 			}
  
  			return dataSet.Tables[tableName];
 | 
| 
      
      
      From: <car...@us...> - 2003-10-25 21:03:55
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10
In directory sc8-pr-cvs1:/tmp/cvs-serv21794
Modified Files:
	changelog.txt 
Log Message:
Updated changelog.txt
Index: changelog.txt
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** changelog.txt	25 Oct 2003 20:54:59 -0000	1.60
--- changelog.txt	25 Oct 2003 21:00:16 -0000	1.61
***************
*** 5,8 ****
--- 5,12 ----
  2003-10-25 Carlos Guzmán Álvarez <car...@te...>
  
+ 	* Added changes for allow future testing of geometic types.
+ 
+ 	* Added empty nunit test fixture for geometric types testing.
+ 
  	* source/NPgClient/PgDataType.cs:
            
 | 
| 
      
      
      From: <car...@us...> - 2003-10-25 21:03:50
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source
In directory sc8-pr-cvs1:/tmp/cvs-serv21381
Modified Files:
	PgBaseTest.cs PgCommandBuilderTest.cs 
Log Message:
Added changes for allow future testing of geometic types
Index: PgBaseTest.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgBaseTest.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PgBaseTest.cs	20 Sep 2003 10:47:30 -0000	1.5
--- PgBaseTest.cs	25 Oct 2003 20:57:49 -0000	1.6
***************
*** 133,136 ****
--- 133,137 ----
  			StringBuilder commandText = new StringBuilder();
  
+ 			// Table for general purpouse tests
  			commandText.Append("CREATE TABLE public.test_table(");
  			commandText.Append("int4_field int4 NOT NULL,");
***************
*** 147,155 ****
  			commandText.Append("int8_field int8,");
  			commandText.Append("money_field money,");
! 			commandText.Append("numeric_field numeric(8,2),");			
  			commandText.Append("int2_array int2[],");
  			commandText.Append("int4_array int4[],");
  			commandText.Append("int8_array int8[],");
  			commandText.Append("serial_field serial NOT NULL,");
  			commandText.Append("CONSTRAINT test_table_pkey PRIMARY KEY (int4_field)");
  			commandText.Append(") WITH OIDS;");
--- 148,161 ----
  			commandText.Append("int8_field int8,");
  			commandText.Append("money_field money,");
! 			commandText.Append("numeric_field numeric(8,2),");
! 			commandText.Append("bool_array bool[],");
  			commandText.Append("int2_array int2[],");
  			commandText.Append("int4_array int4[],");
  			commandText.Append("int8_array int8[],");
+ 			commandText.Append("mint2_array int2[][],");
  			commandText.Append("serial_field serial NOT NULL,");
+ 			commandText.Append("macaddr_field macaddr,");
+ 			commandText.Append("inet_field inet,");
+ 			commandText.Append("name_field name,");
  			commandText.Append("CONSTRAINT test_table_pkey PRIMARY KEY (int4_field)");
  			commandText.Append(") WITH OIDS;");
***************
*** 157,160 ****
--- 163,192 ----
  			PgCommand command = new PgCommand(commandText.ToString(), connection);
  			command.ExecuteNonQuery();
+ 						
+ 			commandText = new StringBuilder();
+ 
+ 			// Table for Geometric types tests
+ 
+ 			commandText.Append("CREATE TABLE public.gemetric_test(");
+ 			commandText.Append("pk int4 NOT NULL,");
+ 			commandText.Append("point_field point,");
+ 			commandText.Append("point_array point[][],");
+ 			commandText.Append("box_field box,");
+ 			commandText.Append("box_array box[],");
+ 			commandText.Append("line_field line,");
+ 			commandText.Append("line_array line[],");
+ 			commandText.Append("circle_field circle,");
+ 			commandText.Append("circle_array circle[],");
+ 			commandText.Append("polygon_field polygon,");
+ 			commandText.Append("polygon_array polygon[],");
+ 			commandText.Append("lseg_field lseg,");
+ 			commandText.Append("lseg_array lseg[],");
+ 			commandText.Append("path_field path,");
+ 			commandText.Append("path_array path[],");
+ 			commandText.Append("CONSTRAINT geometric_test_pkey PRIMARY KEY (pk)");
+ 			commandText.Append(") WITH OIDS;");
+ 
+ 			command.CommandText = commandText.ToString();
+ 			command.ExecuteNonQuery();
  			command.Dispose();
  			
***************
*** 164,169 ****
--- 196,221 ----
  		private void createFunctions()
  		{
+ 			// Create language functions
  			StringBuilder commandText = new StringBuilder();
  
+ 			commandText.Append("CREATE OR REPLACE FUNCTION public.plpgsql_call_handler()");
+ 			commandText.Append("RETURNS language_handler AS");
+ 			commandText.Append("'$libdir/plpgsql', 'plpgsql_call_handler'");
+ 			commandText.Append("LANGUAGE 'c' VOLATILE;");
+ 
+ 			PgCommand command = new PgCommand(commandText.ToString(), connection);
+ 			command.ExecuteNonQuery();
+ 
+ 			// Create languages
+ 			commandText = new StringBuilder();
+ 
+ 			commandText.Append("CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler;");
+ 			
+ 			command = new PgCommand(commandText.ToString(), connection);
+ 			command.ExecuteNonQuery();
+ 
+ 			// Create test function public.TestCount()
+ 			commandText = new StringBuilder();
+ 
  			commandText.Append("CREATE OR REPLACE FUNCTION public.TestCount()");
  			commandText.Append("RETURNS int8 AS");
***************
*** 173,180 ****
  			commandText.Append("LANGUAGE 'sql' VOLATILE;");
  
! 			PgCommand command = new PgCommand(commandText.ToString(), connection);
  			command.ExecuteNonQuery();
  
  			commandText = new StringBuilder();
  			commandText.Append("CREATE OR REPLACE FUNCTION public.DeriveCount(int4)");
  			commandText.Append("RETURNS int8 AS");
--- 225,234 ----
  			commandText.Append("LANGUAGE 'sql' VOLATILE;");
  
! 			command = new PgCommand(commandText.ToString(), connection);
  			command.ExecuteNonQuery();
  
+ 			// Create test function public.DeriveCount()
  			commandText = new StringBuilder();
+ 
  			commandText.Append("CREATE OR REPLACE FUNCTION public.DeriveCount(int4)");
  			commandText.Append("RETURNS int8 AS");
***************
*** 183,186 ****
--- 237,262 ----
  			commandText.Append("'");
  			commandText.Append("LANGUAGE 'sql' VOLATILE;");
+ 
+ 			command.CommandText = commandText.ToString();
+ 			command.ExecuteNonQuery();
+ 
+ 			// Create test function public.DeleteRows()
+ 			commandText = new StringBuilder();
+ 
+ 			commandText.Append("CREATE OR REPLACE FUNCTION public.DeleteRows(int4)\r\n");
+ 			commandText.Append("RETURNS BOOLEAN AS '\r\n");
+ 			commandText.Append("DECLARE\r\n");
+ 			commandText.Append("\t\trows INTEGER;\r\n");
+ 			commandText.Append("BEGIN\r\n");
+ 			commandText.Append("DELETE FROM public.test_table WHERE int4_field > $1;\r\n");
+ 			commandText.Append("GET DIAGNOSTICS rows = ROW_COUNT;\r\n");
+ 			commandText.Append("IF rows > 0 THEN\r\n");
+ 			commandText.Append("\t\tRETURN TRUE;\r\n");
+ 			commandText.Append("ELSE\r\n");
+ 			commandText.Append("\t\tRETURN FALSE;\r\n");
+ 			commandText.Append("END IF;\r\n");
+ 			commandText.Append("END;\r\n");
+ 			commandText.Append("'\r\n");
+ 			commandText.Append("LANGUAGE 'plpgsql' VOLATILE;");
  
  			command.CommandText = commandText.ToString();
Index: PgCommandBuilderTest.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgCommandBuilderTest.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PgCommandBuilderTest.cs	22 Aug 2003 19:40:36 -0000	1.3
--- PgCommandBuilderTest.cs	25 Oct 2003 20:57:49 -0000	1.4
***************
*** 148,151 ****
--- 148,177 ----
  
  		[Test]
+ 		public void DeriveParameters2()
+ 		{
+ 			PgTransaction transaction = Connection.BeginTransaction();
+ 
+ 			PgCommandBuilder builder = new PgCommandBuilder();
+ 			
+ 			PgCommand command = new PgCommand("DeriveCount", Connection, transaction);
+ 			
+ 			command.CommandType = CommandType.StoredProcedure;
+ 						
+ 			PgCommandBuilder.DeriveParameters(command);
+ 			
+ 			Console.WriteLine("\r\nPgCommandBuilder - DeriveParameters static Method Test");
+ 			
+ 			for (int i = 0; i < command.Parameters.Count; i++)
+ 			{
+ 				Console.WriteLine("Parameter name: {0}\tParameter Source Column:{1}\tDirection:{2}",
+ 					command.Parameters[i].ParameterName,
+ 					command.Parameters[i].SourceColumn,
+ 					command.Parameters[i].Direction);
+ 			}
+ 
+ 			transaction.Commit();
+ 		}
+ 
+ 		[Test]
  		public void TestWithClosedConnection()
  		{
 | 
| 
      
      
      From: <car...@us...> - 2003-10-25 21:03:02
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv21622 Added Files: PgGeometicTypesTest.cs Log Message: Added empty nunit test fixture for geometric types testing. --- NEW FILE: PgGeometicTypesTest.cs --- (This appears to be a binary file; contents omitted.) | 
| 
      
      
      From: <car...@us...> - 2003-10-25 21:00:46
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient
In directory sc8-pr-cvs1:/tmp/cvs-serv18915
Modified Files:
	PgDataType.cs PgDbClient.cs 
Log Message:
* source/NPgClient/PgDataType.cs:
          
          - Changed visibility level to internal
Index: PgDataType.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDataType.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PgDataType.cs	18 Oct 2003 19:14:43 -0000	1.2
--- PgDataType.cs	25 Oct 2003 20:52:53 -0000	1.3
***************
*** 24,28 ****
  	// allow a better and more simple handling of
  	// data types in the protocol implementation.
! 	public enum PgDataType
  	{
  		Array			,
--- 24,28 ----
  	// allow a better and more simple handling of
  	// data types in the protocol implementation.
! 	internal enum PgDataType
  	{
  		Array			,
Index: PgDbClient.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** PgDbClient.cs	19 Oct 2003 14:08:22 -0000	1.27
--- PgDbClient.cs	25 Oct 2003 20:52:53 -0000	1.28
***************
*** 143,149 ****
  					TlsSessionSettings tlsSettings = new TlsSessionSettings();
  
! 					tlsSettings.Protocol	= TlsProtocol.Tls1;
! 					tlsSettings.ServerName	= settings.ServerName; 
! 					tlsSettings.ServerPort	= settings.ServerPort;
  
  					// Create a new TLS Session
--- 143,150 ----
  					TlsSessionSettings tlsSettings = new TlsSessionSettings();
  
! 					tlsSettings.Protocol			= TlsProtocol.Tls1;
! 					tlsSettings.CompressionMethod	= TlsCompressionMethod.None;
! 					tlsSettings.ServerName			= settings.ServerName; 
! 					tlsSettings.ServerPort			= settings.ServerPort;
  
  					// Create a new TLS Session
 | 
| 
      
      
      From: <car...@us...> - 2003-10-25 20:59:52
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv20916 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** changelog.txt 24 Oct 2003 09:41:02 -0000 1.59 --- changelog.txt 25 Oct 2003 20:54:59 -0000 1.60 *************** *** 2,5 **** --- 2,12 ---- ------------------------------------------------------- + + 2003-10-25 Carlos Guzmán Álvarez <car...@te...> + + * source/NPgClient/PgDataType.cs: + + - Changed visibility level to internal + 2003-10-24 Carlos Guzmán Álvarez <car...@te...> | 
| 
      
      
      From: <car...@us...> - 2003-10-24 11:49:49
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv2596 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/changelog.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** changelog.txt 24 Oct 2003 09:37:54 -0000 1.1 --- changelog.txt 24 Oct 2003 09:39:57 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- * Added specific changelog file for the TLS/SSL implementation. + * Added partial implementation of SSL3 protocol. | 
| 
      
      
      From: <car...@us...> - 2003-10-24 11:18:37
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv2231 Added Files: changelog.txt Log Message: Added specific changelog file for the TLS library --- NEW FILE: changelog.txt --- (This appears to be a binary file; contents omitted.) | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls
In directory sc8-pr-cvs1:/tmp/cvs-serv2483
Modified Files:
	CipherSuite.cs TlsCipherSuite.cs TlsCipherSuiteFactory.cs 
	TlsSocket.cs TlsSslCipherSuite.cs 
Log Message:
Added partial implementation of SSL3 protocol
Index: CipherSuite.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/CipherSuite.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CipherSuite.cs	21 Oct 2003 23:07:19 -0000	1.2
--- CipherSuite.cs	24 Oct 2003 09:39:21 -0000	1.3
***************
*** 180,183 ****
--- 180,189 ----
  		#region METHODS
  
+ 		public void InitializeCipher()
+ 		{
+ 			createEncryptionCipher();
+ 			createDecryptionCipher();
+ 		}
+ 
  		public RSACryptoServiceProvider CreateRSA(X509Certificate certificate)
  		{
***************
*** 216,225 ****
  		}
  
- 		public void InitializeCipher()
- 		{
- 			createEncryptionCipher();
- 			createDecryptionCipher();
- 		}
- 
  		public void UpdateClientCipherIV(byte[] iv)
  		{
--- 222,225 ----
***************
*** 246,264 ****
  		}
  
! 		#endregion
  
! 		#region ABSTRACT_METHODS
  
! 		public abstract byte[] GenerateClientRecordMAC(TlsContentType contentType, byte[] fragment);
  
! 		public abstract byte[] GenerateServerRecordMAC(TlsContentType contentType, byte[] fragment);
  
! 		public abstract byte[] EncryptRecord(byte[] fragment, byte[] mac);
  
! 		public abstract void DecryptRecord(byte[] fragment, ref byte[] dcrFragment, ref byte[] dcrMAC);
  
! 		public abstract void CreateMasterSecret(byte[] preMasterSecret);
  
! 		public abstract void CreateKeys();
  
  		#endregion
--- 246,320 ----
  		}
  
! 		public byte[] EncryptRecord(byte[] fragment, byte[] mac)
! 		{
! 			// Encryption ( fragment + mac [+ padding + padding_length] )
! 			MemoryStream ms = new MemoryStream();
! 			CryptoStream cs = new CryptoStream(ms, this.EncryptionCipher, CryptoStreamMode.Write);
  
! 			cs.Write(fragment, 0, fragment.Length);
! 			cs.Write(mac, 0, mac.Length);
! 			if (this.CipherMode == CipherMode.CBC)
! 			{
! 				// Calculate padding_length
! 				int fragmentLength	= fragment.Length + mac.Length + 1;
! 				int paddingLength	= (((fragmentLength/this.BlockSize)*this.BlockSize) + this.BlockSize) - fragmentLength;
  
! 				// Write padding length byte
! 				cs.WriteByte((byte)paddingLength);
! 			}
! 			//cs.FlushFinalBlock();
! 			cs.Close();			
  
! 			return ms.ToArray();
! 		}
  
! 		public void DecryptRecord(byte[] fragment, ref byte[] dcrFragment, ref byte[] dcrMAC)
! 		{
! 			int	fragmentSize	= 0;
! 			int paddingLength	= 0;
  
! 			// Decrypt message fragment ( fragment + mac [+ padding + padding_length] )
! 			byte[] buffer = new byte[fragment.Length];
! 			this.DecryptionCipher.TransformBlock(fragment, 0, fragment.Length, buffer, 0);
  
! 			// Calculate fragment size
! 			if (this.CipherMode == CipherMode.CBC)
! 			{
! 				// Calculate padding_length
! 				paddingLength = buffer[buffer.Length - 1];
! 				for (int i = (buffer.Length - 1); i > (buffer.Length - (paddingLength + 1)); i--)
! 				{
! 					if (buffer[i] != paddingLength)
! 					{
! 						paddingLength = 0;
! 						break;
! 					}
! 				}
  
! 				fragmentSize = (buffer.Length - (paddingLength + 1)) - HashSize;
! 			}
! 			else
! 			{
! 				fragmentSize = buffer.Length - HashSize;
! 			}
! 
! 			dcrFragment = new byte[fragmentSize];
! 			dcrMAC		= new byte[HashSize];
! 
! 			Buffer.BlockCopy(buffer, 0, dcrFragment, 0, dcrFragment.Length);
! 			Buffer.BlockCopy(buffer, dcrFragment.Length, dcrMAC, 0, dcrMAC.Length);
! 		}
! 
! 		#endregion
! 
! 		#region ABSTRACT_METHODS
! 
! 		public abstract byte[] ComputeClientRecordMAC(TlsContentType contentType, byte[] fragment);
! 
! 		public abstract byte[] ComputeServerRecordMAC(TlsContentType contentType, byte[] fragment);
! 
! 		public abstract void ComputeMasterSecret(byte[] preMasterSecret);
! 
! 		public abstract void ComputeKeys();
  
  		#endregion
Index: TlsCipherSuite.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuite.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TlsCipherSuite.cs	21 Oct 2003 20:04:09 -0000	1.7
--- TlsCipherSuite.cs	24 Oct 2003 09:39:21 -0000	1.8
***************
*** 50,120 ****
  		#endregion
  
- 		#region METHODS
- 
- 		public override byte[] EncryptRecord(byte[] fragment, byte[] mac)
- 		{
- 			// Encryption ( fragment + mac [+ padding + padding_length] )
- 			MemoryStream ms = new MemoryStream();
- 			CryptoStream cs = new CryptoStream(ms, this.EncryptionCipher, CryptoStreamMode.Write);
- 
- 			cs.Write(fragment, 0, fragment.Length);
- 			cs.Write(mac, 0, mac.Length);
- 			if (this.CipherMode == CipherMode.CBC)
- 			{
- 				// Calculate padding_length
- 				int fragmentLength	= fragment.Length + mac.Length + 1;
- 				int paddingLength	= (((fragmentLength/this.BlockSize)*this.BlockSize) + this.BlockSize) - fragmentLength;
- 
- 				// Write padding length byte
- 				cs.WriteByte((byte)paddingLength);
- 			}
- 			//cs.FlushFinalBlock();
- 			cs.Close();			
- 
- 			return ms.ToArray();
- 		}
- 
- 		public override void DecryptRecord(byte[] fragment, ref byte[] dcrFragment, ref byte[] dcrMAC)
- 		{
- 			int	fragmentSize	= 0;
- 			int paddingLength	= 0;
- 
- 			// Decrypt message fragment ( fragment + mac [+ padding + padding_length] )
- 			byte[] buffer = new byte[fragment.Length];
- 			this.DecryptionCipher.TransformBlock(fragment, 0, fragment.Length, buffer, 0);
- 
- 			// Calculate fragment size
- 			if (this.CipherMode == CipherMode.CBC)
- 			{
- 				// Calculate padding_length
- 				paddingLength = buffer[buffer.Length - 1];
- 				for (int i = (buffer.Length - 1); i > (buffer.Length - (paddingLength + 1)); i--)
- 				{
- 					if (buffer[i] != paddingLength)
- 					{
- 						paddingLength = 0;
- 						break;
- 					}
- 				}
- 
- 				fragmentSize = (buffer.Length - (paddingLength + 1)) - HashSize;
- 			}
- 			else
- 			{
- 				fragmentSize = buffer.Length - HashSize;
- 			}
- 
- 			dcrFragment = new byte[fragmentSize];
- 			dcrMAC		= new byte[HashSize];
- 
- 			Buffer.BlockCopy(buffer, 0, dcrFragment, 0, dcrFragment.Length);
- 			Buffer.BlockCopy(buffer, dcrFragment.Length, dcrMAC, 0, dcrMAC.Length);
- 		}
- 
- 		#endregion
- 
  		#region MAC_GENERATION_METHOD
  
! 		public override byte[] GenerateServerRecordMAC(TlsContentType contentType, byte[] fragment)
  		{
  			TlsStream	data	= new TlsStream();
--- 50,56 ----
  		#endregion
  
  		#region MAC_GENERATION_METHOD
  
! 		public override byte[] ComputeServerRecordMAC(TlsContentType contentType, byte[] fragment)
  		{
  			TlsStream	data	= new TlsStream();
***************
*** 134,138 ****
  		}
  
! 		public override byte[] GenerateClientRecordMAC(TlsContentType contentType, byte[] fragment)
  		{
  			TlsStream	data	= new TlsStream();
--- 70,74 ----
  		}
  
! 		public override byte[] ComputeClientRecordMAC(TlsContentType contentType, byte[] fragment)
  		{
  			TlsStream	data	= new TlsStream();
***************
*** 156,160 ****
  		#region KEY_GENERATION_METODS
  
! 		public override void CreateMasterSecret(byte[] preMasterSecret)
  		{
  			// Create master secret
--- 92,96 ----
  		#region KEY_GENERATION_METODS
  
! 		public override void ComputeMasterSecret(byte[] preMasterSecret)
  		{
  			// Create master secret
***************
*** 164,168 ****
  		}
  
! 		public override void CreateKeys()
  		{
  			// Create keyblock
--- 100,104 ----
  		}
  
! 		public override void ComputeKeys()
  		{
  			// Create keyblock
Index: TlsCipherSuiteFactory.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TlsCipherSuiteFactory.cs	21 Oct 2003 23:07:19 -0000	1.4
--- TlsCipherSuiteFactory.cs	24 Oct 2003 09:39:21 -0000	1.5
***************
*** 120,125 ****
  
  			// Supported ciphers
! 			// scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA", false, true, 24, 24, 168, 8, 8);
! 			// scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", "DES", "SHA", false, true, 8, 8, 56, 8, 8);
  			scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", "RC4", "SHA", false, false, 16, 16, 128, 0, 0);
  			scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0);			
--- 120,125 ----
  
  			// Supported ciphers
! 			scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA", false, true, 24, 24, 168, 8, 8);
! 			scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", "DES", "SHA", false, true, 8, 8, 56, 8, 8);
  			scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", "RC4", "SHA", false, false, 16, 16, 128, 0, 0);
  			scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0);			
Index: TlsSocket.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsSocket.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** TlsSocket.cs	22 Oct 2003 11:47:44 -0000	1.9
--- TlsSocket.cs	24 Oct 2003 09:39:21 -0000	1.10
***************
*** 269,273 ****
  		{
  			// Calculate message MAC
! 			byte[] mac	= this.session.Context.Cipher.GenerateClientRecordMAC(contentType, fragment);
  
  			// Encrypt the message
--- 269,273 ----
  		{
  			// Calculate message MAC
! 			byte[] mac	= this.session.Context.Cipher.ComputeClientRecordMAC(contentType, fragment);
  
  			// Encrypt the message
***************
*** 307,311 ****
  			
  			// Check MAC code
! 			byte[] mac = this.session.Context.Cipher.GenerateServerRecordMAC(contentType, dcrFragment);
  
  			// Check that the mac is correct
--- 307,311 ----
  			
  			// Check MAC code
! 			byte[] mac = this.session.Context.Cipher.ComputeServerRecordMAC(contentType, dcrFragment);
  
  			// Check that the mac is correct
Index: TlsSslCipherSuite.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsSslCipherSuite.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TlsSslCipherSuite.cs	22 Oct 2003 11:47:44 -0000	1.7
--- TlsSslCipherSuite.cs	24 Oct 2003 09:39:21 -0000	1.8
***************
*** 72,142 ****
  		#endregion
  
- 		#region METHODS
- 
- 		public override byte[] EncryptRecord(byte[] fragment, byte[] mac)
- 		{
- 			// Encryption ( fragment + mac [+ padding + padding_length] )
- 			MemoryStream ms = new MemoryStream();
- 			CryptoStream cs = new CryptoStream(ms, this.EncryptionCipher, CryptoStreamMode.Write);
- 
- 			cs.Write(fragment, 0, fragment.Length);
- 			cs.Write(mac, 0, mac.Length);
- 			if (this.CipherMode == CipherMode.CBC)
- 			{
- 				// Calculate padding_length
- 				int fragmentLength	= fragment.Length + mac.Length + 1;
- 				int paddingLength	= (((fragmentLength/this.BlockSize)*8) + this.BlockSize) - fragmentLength;
- 
- 				// Write padding length byte
- 				cs.WriteByte((byte)paddingLength);
- 			}
- 			//cs.FlushFinalBlock();
- 			cs.Close();			
- 
- 			return ms.ToArray();
- 		}
- 
- 		public override void DecryptRecord(byte[] fragment, ref byte[] dcrFragment, ref byte[] dcrMAC)
- 		{
- 			int	fragmentSize	= 0;
- 			int paddingLength	= 0;
- 
- 			// Decrypt message fragment ( fragment + mac [+ padding + padding_length] )
- 			byte[] buffer = new byte[fragment.Length];
- 			this.DecryptionCipher.TransformBlock(fragment, 0, fragment.Length, buffer, 0);
- 
- 			// Calculate fragment size
- 			if (this.CipherMode == CipherMode.CBC)
- 			{
- 				// Calculate padding_length
- 				paddingLength = buffer[buffer.Length - 1];
- 				for (int i = (buffer.Length - 1); i > (buffer.Length - (paddingLength + 1)); i--)
- 				{
- 					if (buffer[i] != paddingLength)
- 					{
- 						paddingLength = 0;
- 						break;
- 					}
- 				}
- 
- 				fragmentSize = (buffer.Length - (paddingLength + 1)) - HashSize;
- 			}
- 			else
- 			{
- 				fragmentSize = buffer.Length - HashSize;
- 			}
- 
- 			dcrFragment = new byte[fragmentSize];
- 			dcrMAC		= new byte[HashSize];
- 
- 			Buffer.BlockCopy(buffer, 0, dcrFragment, 0, dcrFragment.Length);
- 			Buffer.BlockCopy(buffer, dcrFragment.Length, dcrMAC, 0, dcrMAC.Length);
- 		}
- 
- 		#endregion
- 
  		#region MAC_GENERATION_METHOD
  
! 		public override byte[] GenerateServerRecordMAC(TlsContentType contentType, byte[] fragment)
  		{
  			HashAlgorithm	hash	= HashAlgorithm.Create(this.HashName);
--- 72,78 ----
  		#endregion
  
  		#region MAC_GENERATION_METHOD
  
! 		public override byte[] ComputeServerRecordMAC(TlsContentType contentType, byte[] fragment)
  		{
  			HashAlgorithm	hash	= HashAlgorithm.Create(this.HashName);
***************
*** 158,169 ****
  			block.Write(blockHash);
  
! 			hash.TransformFinalBlock(block.ToArray(), 0, (int)block.Length);
  
  			block.Reset();
  
! 			return hash.Hash;
  		}
  
! 		public override byte[] GenerateClientRecordMAC(TlsContentType contentType, byte[] fragment)
  		{
  			HashAlgorithm	hash	= HashAlgorithm.Create(this.HashName);
--- 94,105 ----
  			block.Write(blockHash);
  
! 			blockHash = hash.ComputeHash(block.ToArray(), 0, (int)block.Length);
  
  			block.Reset();
  
! 			return blockHash;
  		}
  
! 		public override byte[] ComputeClientRecordMAC(TlsContentType contentType, byte[] fragment)
  		{
  			HashAlgorithm	hash	= HashAlgorithm.Create(this.HashName);
***************
*** 185,193 ****
  			block.Write(blockHash);
  
! 			hash.TransformFinalBlock(block.ToArray(), 0, (int)block.Length);
  
  			block.Reset();
  
! 			return hash.Hash;
  		}
  
--- 121,129 ----
  			block.Write(blockHash);
  
! 			blockHash = hash.ComputeHash(block.ToArray(), 0, (int)block.Length);
  
  			block.Reset();
  
! 			return blockHash;
  		}
  
***************
*** 219,223 ****
  		#region KEY_GENERATION_METODS
  
! 		public override void CreateMasterSecret(byte[] preMasterSecret)
  		{
  			TlsStream masterSecret = new TlsStream();
--- 155,159 ----
  		#region KEY_GENERATION_METODS
  
! 		public override void ComputeMasterSecret(byte[] preMasterSecret)
  		{
  			TlsStream masterSecret = new TlsStream();
***************
*** 230,234 ****
  		}
  
! 		public override void CreateKeys()
  		{
  			// Compute KeyBlock
--- 166,170 ----
  		}
  
! 		public override void ComputeKeys()
  		{
  			// Compute KeyBlock
 | 
| 
      
      
      From: <car...@us...> - 2003-10-24 09:44:09
      
     | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv2770 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** changelog.txt 21 Oct 2003 23:08:11 -0000 1.58 --- changelog.txt 24 Oct 2003 09:41:02 -0000 1.59 *************** *** 2,5 **** --- 2,9 ---- ------------------------------------------------------- + 2003-10-24 Carlos Guzmán Álvarez <car...@te...> + + * Added specific changelog file for the TLS/SSL implementation. + 2003-10-21 Carlos Guzmán Álvarez <car...@te...> | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client In directory sc8-pr-cvs1:/tmp/cvs-serv2483/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client Modified Files: TlsClientKeyExchange.cs Log Message: Added partial implementation of SSL3 protocol Index: TlsClientKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsClientKeyExchange.cs 22 Oct 2003 11:48:08 -0000 1.7 --- TlsClientKeyExchange.cs 24 Oct 2003 09:39:21 -0000 1.8 *************** *** 68,75 **** // Create master secret ! this.Session.Context.Cipher.CreateMasterSecret(preMasterSecret); // Create keys ! this.Session.Context.Cipher.CreateKeys(); // Clear resources --- 68,75 ---- // Create master secret ! this.Session.Context.Cipher.ComputeMasterSecret(preMasterSecret); // Create keys ! this.Session.Context.Cipher.ComputeKeys(); // Clear resources *************** *** 102,109 **** // Create master secret ! this.Session.Context.Cipher.CreateMasterSecret(preMasterSecret); // Create keys ! this.Session.Context.Cipher.CreateKeys(); // Clear resources --- 102,109 ---- // Create master secret ! this.Session.Context.Cipher.ComputeMasterSecret(preMasterSecret); // Create keys ! this.Session.Context.Cipher.ComputeKeys(); // Clear resources | 
| Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client
In directory sc8-pr-cvs1:/tmp/cvs-serv25125
Modified Files:
	TlsClientCertificate.cs TlsClientFinished.cs TlsClientHello.cs 
	TlsClientKeyExchange.cs TlsServerCertificate.cs 
	TlsServerCertificateRequest.cs TlsServerFinished.cs 
	TlsServerHello.cs TlsServerKeyExchange.cs 
Log Message:
Added partial implementation of SSL3 protocol
Index: TlsClientCertificate.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TlsClientCertificate.cs	16 Oct 2003 14:25:57 -0000	1.4
--- TlsClientCertificate.cs	22 Oct 2003 11:48:08 -0000	1.5
***************
*** 70,75 ****
  
  			// Compose the message
! 			WriteInt24((int)stream.Length);
! 			Write(stream.ToArray());
  		}
  
--- 70,75 ----
  
  			// Compose the message
! 			this.WriteInt24((int)stream.Length);
! 			this.Write(stream.ToArray());
  		}
  
Index: TlsClientFinished.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TlsClientFinished.cs	21 Oct 2003 20:06:28 -0000	1.6
--- TlsClientFinished.cs	22 Oct 2003 11:48:08 -0000	1.7
***************
*** 66,97 ****
  			block.Write(cipher.Pad1);
  
- 			block.Reset();
- 
  			byte[] blockHash = hash.ComputeHash(block.ToArray(), 0, (int)block.Length);
  
  			block.Write(this.Session.Context.MasterSecret);
  			block.Write(cipher.Pad2);
  			block.Write(blockHash);
  
! 			hash.TransformFinalBlock(block.ToArray(), 0, (int)block.Length);
  
  			block.Reset();
  
! 			return hash.Hash;			
  		}
  
  		protected override void ProcessAsSsl3()
  		{
! 			// Get hashes of handshake messages
! 			TlsStream hashes = new TlsStream();
! 
! 			hashes.Write(computeSslHash("MD5", Session.Context.HandshakeHashes.Messages, 0x434C4E54));
! 			hashes.Write(computeSslHash("SHA1", Session.Context.HandshakeHashes.Messages, 0x434C4E54));
  			
- 			// Write message contents
- 			Write(hashes.ToArray());
- 
- 			// Reset data
- 			hashes.Reset();
  			Session.Context.HandshakeHashes.Reset();
  		}
--- 66,89 ----
  			block.Write(cipher.Pad1);
  
  			byte[] blockHash = hash.ComputeHash(block.ToArray(), 0, (int)block.Length);
  
+ 			block.Reset();
+ 
  			block.Write(this.Session.Context.MasterSecret);
  			block.Write(cipher.Pad2);
  			block.Write(blockHash);
  
! 			blockHash = hash.ComputeHash(block.ToArray(), 0, (int)block.Length);
  
  			block.Reset();
  
! 			return blockHash;
  		}
  
  		protected override void ProcessAsSsl3()
  		{
! 			this.Write(computeSslHash("MD5", Session.Context.HandshakeHashes.Messages, 0x434C4E54));
! 			this.Write(computeSslHash("SHA1", Session.Context.HandshakeHashes.Messages, 0x434C4E54));
  			
  			Session.Context.HandshakeHashes.Reset();
  		}
Index: TlsClientHello.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TlsClientHello.cs	21 Oct 2003 20:06:28 -0000	1.8
--- TlsClientHello.cs	22 Oct 2003 11:48:08 -0000	1.9
***************
*** 68,72 ****
  		{
  			// Client Version
! 			Write((short)this.Session.Context.Protocol);
  								
  			// Random bytes - Unix time + Radom bytes [28]
--- 68,72 ----
  		{
  			// Client Version
! 			this.Write((short)this.Session.Context.Protocol);
  								
  			// Random bytes - Unix time + Radom bytes [28]
***************
*** 77,81 ****
  			clientRandom.Reset();
  
! 			Write(this.random);
  
  			// Session id
--- 77,81 ----
  			clientRandom.Reset();
  
! 			this.Write(this.random);
  
  			// Session id
***************
*** 83,111 ****
  			if (this.Session.SessionId != null)
  			{
! 				Write((byte)this.Session.SessionId.Length);
  				if (this.Session.SessionId.Length > 0)
  				{
! 					Write(this.Session.SessionId);
  				}
  			}
  			else
  			{
! 				Write((byte)0);
  			}
  			
  			// Write length of Cipher suites			
! 			Write((short)(this.Session.Context.SupportedCiphers.Count*2));
  
  			// Write Supported Cipher suites
  			for (int i = 0; i < this.Session.Context.SupportedCiphers.Count; i++)
  			{
! 				Write((short)this.Session.Context.SupportedCiphers[i].Code);
  			}
  
  			// Compression methods length
! 			Write((byte)1);
  			
  			// Compression methods ( 0 = none )
! 			Write((byte)TlsCompressionMethod.None);
  		}
  
--- 83,111 ----
  			if (this.Session.SessionId != null)
  			{
! 				this.Write((byte)this.Session.SessionId.Length);
  				if (this.Session.SessionId.Length > 0)
  				{
! 					this.Write(this.Session.SessionId);
  				}
  			}
  			else
  			{
! 				this.Write((byte)0);
  			}
  			
  			// Write length of Cipher suites			
! 			this.Write((short)(this.Session.Context.SupportedCiphers.Count*2));
  
  			// Write Supported Cipher suites
  			for (int i = 0; i < this.Session.Context.SupportedCiphers.Count; i++)
  			{
! 				this.Write((short)this.Session.Context.SupportedCiphers[i].Code);
  			}
  
  			// Compression methods length
! 			this.Write((byte)1);
  			
  			// Compression methods ( 0 = none )
! 			this.Write((byte)this.Session.Context.CompressionMethod);
  		}
  
Index: TlsClientKeyExchange.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TlsClientKeyExchange.cs	21 Oct 2003 23:07:37 -0000	1.6
--- TlsClientKeyExchange.cs	22 Oct 2003 11:48:08 -0000	1.7
***************
*** 47,61 ****
  		{
  			// Compute pre master secret
! 			byte[] preMasterSecret = Session.Context.Cipher.CreatePremasterSecret();
  
  			// Create a new RSA key
  			RSACryptoServiceProvider rsa = null;
! 			if (Session.Context.ServerSettings.ServerKeyExchange)
  			{
! 				rsa = Session.Context.Cipher.CreateRSA(Session.Context.ServerSettings.RsaParameters);
  			}
  			else
  			{
! 				rsa = Session.Context.Cipher.CreateRSA(Session.Context.ServerSettings.ServerCertificates[0]);
  			}			
  			
--- 47,61 ----
  		{
  			// Compute pre master secret
! 			byte[] preMasterSecret = this.Session.Context.Cipher.CreatePremasterSecret();
  
  			// Create a new RSA key
  			RSACryptoServiceProvider rsa = null;
! 			if (this.Session.Context.ServerSettings.ServerKeyExchange)
  			{
! 				rsa = this.Session.Context.Cipher.CreateRSA(this.Session.Context.ServerSettings.RsaParameters);
  			}
  			else
  			{
! 				rsa = this.Session.Context.Cipher.CreateRSA(this.Session.Context.ServerSettings.ServerCertificates[0]);
  			}			
  			
***************
*** 65,75 ****
  			// Write the preMasterSecret encrypted
  			byte[] buffer = formatter.CreateKeyExchange(preMasterSecret);
! 			Write(buffer);
  
  			// Create master secret
! 			Session.Context.Cipher.CreateMasterSecret(preMasterSecret);
  
  			// Create keys
! 			Session.Context.Cipher.CreateKeys();
  
  			// Clear resources
--- 65,75 ----
  			// Write the preMasterSecret encrypted
  			byte[] buffer = formatter.CreateKeyExchange(preMasterSecret);
! 			this.Write(buffer);
  
  			// Create master secret
! 			this.Session.Context.Cipher.CreateMasterSecret(preMasterSecret);
  
  			// Create keys
! 			this.Session.Context.Cipher.CreateKeys();
  
  			// Clear resources
***************
*** 80,94 ****
  		{
  			// Compute pre master secret
! 			byte[] preMasterSecret = Session.Context.Cipher.CreatePremasterSecret();
  
  			// Create a new RSA key
  			RSACryptoServiceProvider rsa = null;
! 			if (Session.Context.ServerSettings.ServerKeyExchange)
  			{
! 				rsa = Session.Context.Cipher.CreateRSA(Session.Context.ServerSettings.RsaParameters);
  			}
  			else
  			{
! 				rsa = Session.Context.Cipher.CreateRSA(Session.Context.ServerSettings.ServerCertificates[0]);
  			}			
  			
--- 80,94 ----
  		{
  			// Compute pre master secret
! 			byte[] preMasterSecret = this.Session.Context.Cipher.CreatePremasterSecret();
  
  			// Create a new RSA key
  			RSACryptoServiceProvider rsa = null;
! 			if (this.Session.Context.ServerSettings.ServerKeyExchange)
  			{
! 				rsa = this.Session.Context.Cipher.CreateRSA(this.Session.Context.ServerSettings.RsaParameters);
  			}
  			else
  			{
! 				rsa = this.Session.Context.Cipher.CreateRSA(this.Session.Context.ServerSettings.ServerCertificates[0]);
  			}			
  			
***************
*** 98,109 ****
  			// Write the preMasterSecret encrypted
  			byte[] buffer = formatter.CreateKeyExchange(preMasterSecret);
! 			Write((short)buffer.Length);
! 			Write(buffer);
  
  			// Create master secret
! 			Session.Context.Cipher.CreateMasterSecret(preMasterSecret);
  
  			// Create keys
! 			Session.Context.Cipher.CreateKeys();
  
  			// Clear resources
--- 98,109 ----
  			// Write the preMasterSecret encrypted
  			byte[] buffer = formatter.CreateKeyExchange(preMasterSecret);
! 			this.Write((short)buffer.Length);
! 			this.Write(buffer);
  
  			// Create master secret
! 			this.Session.Context.Cipher.CreateMasterSecret(preMasterSecret);
  
  			// Create keys
! 			this.Session.Context.Cipher.CreateKeys();
  
  			// Clear resources
Index: TlsServerCertificate.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TlsServerCertificate.cs	21 Oct 2003 16:06:15 -0000	1.5
--- TlsServerCertificate.cs	22 Oct 2003 11:48:08 -0000	1.6
***************
*** 79,83 ****
  			
  			int readed	= 0;
! 			int length	= ReadInt24();
  
  			while (readed < length)
--- 79,83 ----
  			
  			int readed	= 0;
! 			int length	= this.ReadInt24();
  
  			while (readed < length)
***************
*** 92,101 ****
  				{
  					// Read certificate
! 					X509Certificate certificate = new X509Certificate(ReadBytes(certLength));
  					certificates.Add(certificate);
  
  					readed += certLength;
  
! 					validateCertificate(certificate);
  				}
  			}
--- 92,101 ----
  				{
  					// Read certificate
! 					X509Certificate certificate = new X509Certificate(this.ReadBytes(certLength));
  					certificates.Add(certificate);
  
  					readed += certLength;
  
! 					this.validateCertificate(certificate);
  				}
  			}
Index: TlsServerCertificateRequest.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TlsServerCertificateRequest.cs	16 Oct 2003 14:25:57 -0000	1.4
--- TlsServerCertificateRequest.cs	22 Oct 2003 11:48:08 -0000	1.5
***************
*** 53,59 ****
  			base.UpdateSession();
  
! 			Session.Context.ServerSettings.CertificateTypes		= this.certificateTypes;
! 			Session.Context.ServerSettings.DistinguisedNames	= this.distinguisedNames;
! 			Session.Context.ServerSettings.CertificateRequest	= true;
  		}
  
--- 53,59 ----
  			base.UpdateSession();
  
! 			this.Session.Context.ServerSettings.CertificateTypes	= this.certificateTypes;
! 			this.Session.Context.ServerSettings.DistinguisedNames	= this.distinguisedNames;
! 			this.Session.Context.ServerSettings.CertificateRequest	= true;
  		}
  
***************
*** 70,74 ****
  		{
  			// Read requested certificate types
! 			int typesCount = ReadByte();
  						
  			certificateTypes = new TlsClientCertificateType[typesCount];
--- 70,74 ----
  		{
  			// Read requested certificate types
! 			int typesCount = this.ReadByte();
  						
  			certificateTypes = new TlsClientCertificateType[typesCount];
***************
*** 76,80 ****
  			for (int i = 0; i < typesCount; i++)
  			{
! 				certificateTypes[i] = (TlsClientCertificateType)ReadByte();
  			}
  
--- 76,80 ----
  			for (int i = 0; i < typesCount; i++)
  			{
! 				certificateTypes[i] = (TlsClientCertificateType)this.ReadByte();
  			}
  
***************
*** 90,95 ****
  			 * attributeValue ANY }
  			 */
! 			int		tmp = ReadInt16();
! 			ASN1	rdn = new ASN1(ReadBytes(ReadInt16()));
  
  			distinguisedNames = new string[rdn.Count];
--- 90,95 ----
  			 * attributeValue ANY }
  			 */
! 			int		tmp = this.ReadInt16();
! 			ASN1	rdn = new ASN1(this.ReadBytes(this.ReadInt16()));
  
  			distinguisedNames = new string[rdn.Count];
Index: TlsServerFinished.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TlsServerFinished.cs	21 Oct 2003 20:06:28 -0000	1.7
--- TlsServerFinished.cs	22 Oct 2003 11:48:08 -0000	1.8
***************
*** 59,69 ****
  		protected override void ProcessAsTls1()
  		{
! 			byte[]		serverPRF	= ReadBytes((int)Length);
  			TlsStream	hashes		= new TlsStream();
  
! 			hashes.Write(Session.Context.HandshakeHashes.GetMD5Hash());
! 			hashes.Write(Session.Context.HandshakeHashes.GetSHAHash());
  
! 			byte[] clientPRF = Session.Context.Cipher.PRF(Session.Context.MasterSecret, "server finished", hashes.ToArray(), 12);
  
  			hashes.Reset();
--- 59,69 ----
  		protected override void ProcessAsTls1()
  		{
! 			byte[]		serverPRF	= this.ReadBytes((int)Length);
  			TlsStream	hashes		= new TlsStream();
  
! 			hashes.Write(this.Session.Context.HandshakeHashes.GetMD5Hash());
! 			hashes.Write(this.Session.Context.HandshakeHashes.GetSHAHash());
  
! 			byte[] clientPRF = this.Session.Context.Cipher.PRF(this.Session.Context.MasterSecret, "server finished", hashes.ToArray(), 12);
  
  			hashes.Reset();
***************
*** 82,86 ****
  			}
  
! 			Session.Context.HandshakeHashes.Clear();
  		}
  
--- 82,86 ----
  			}
  
! 			this.Session.Context.HandshakeHashes.Clear();
  		}
  
Index: TlsServerHello.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** TlsServerHello.cs	21 Oct 2003 20:06:28 -0000	1.9
--- TlsServerHello.cs	22 Oct 2003 11:48:08 -0000	1.10
***************
*** 55,63 ****
  
  			this.Session.SetSessionId(this.sessionId);
- 			if (this.protocol != this.Session.Context.Protocol)
- 			{
- 				this.Session.Context.SupportedCiphers = TlsCipherSuiteFactory.GetSupportedCiphers(this.protocol);
- 			}
- 			this.Session.Context.Protocol			= this.protocol;
  			this.Session.Context.ServerRandom		= this.random;
  			this.Session.Context.Cipher				= this.cipherSuite;
--- 55,58 ----
Index: TlsServerKeyExchange.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TlsServerKeyExchange.cs	16 Oct 2003 14:25:57 -0000	1.5
--- TlsServerKeyExchange.cs	22 Oct 2003 11:48:08 -0000	1.6
***************
*** 70,86 ****
  		protected override void ProcessAsTls1()
  		{
! 			rsaParams = new RSAParameters();
  			
  			// Read modulus
! 			short length		= ReadInt16();
! 			rsaParams.Modulus	= ReadBytes(length);
  
  			// Read exponent
! 			length				= ReadInt16();
! 			rsaParams.Exponent	= ReadBytes(length);
  
  			// Read signed params
! 			length				= ReadInt16();
! 			signedParams		= ReadBytes(length);
  		}
  
--- 70,86 ----
  		protected override void ProcessAsTls1()
  		{
! 			this.rsaParams = new RSAParameters();
  			
  			// Read modulus
! 			short length		= this.ReadInt16();
! 			rsaParams.Modulus	= this.ReadBytes(length);
  
  			// Read exponent
! 			length				= this.ReadInt16();
! 			rsaParams.Exponent	= this.ReadBytes(length);
  
  			// Read signed params
! 			length				= this.ReadInt16();
! 			signedParams		= this.ReadBytes(length);
  		}
  
***************
*** 97,102 ****
  			TlsStream stream = new TlsStream();
  
! 			stream.Write(Session.Context.ClientRandom);
! 			stream.Write(Session.Context.ServerRandom);
  			stream.Write(rsaParams.Modulus.Length);
  			stream.Write(rsaParams.Modulus);
--- 97,101 ----
  			TlsStream stream = new TlsStream();
  
! 			stream.Write(this.Session.Context.RandomCS);
  			stream.Write(rsaParams.Modulus.Length);
  			stream.Write(rsaParams.Modulus);
 |