pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 41)
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
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/Client In directory sc8-pr-cvs1:/tmp/cvs-serv12852 Added Files: TlsClientCertificate.cs TlsClientCertificateVerify.cs TlsClientFinished.cs TlsClientHandshakeMessage.cs TlsClientHello.cs TlsClientKeyExchange.cs TlsServerCertificate.cs TlsServerCertificateRequest.cs TlsServerFinished.cs TlsServerHandshakeMessage.cs TlsServerHello.cs TlsServerHelloDone.cs TlsServerKeyExchange.cs Log Message: Moved to Handshake\Client directory --- NEW FILE: TlsClientCertificate.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsClientCertificateVerify.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsClientFinished.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsClientHandshakeMessage.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsClientHello.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsClientKeyExchange.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerCertificate.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerCertificateRequest.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerFinished.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerHandshakeMessage.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerHello.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerHelloDone.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerKeyExchange.cs --- (This appears to be a binary file; contents omitted.) |
From: <car...@us...> - 2003-10-10 15:40:24
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/Client In directory sc8-pr-cvs1:/tmp/cvs-serv12780/Client Log Message: Directory /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/Client added to the repository |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv12611 Added Files: TlsClientCertificateType.cs TlsHandshakeHashes.cs TlsHandshakeType.cs Log Message: Moved to Handshake\Client directory |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv12452 Removed Files: TlsClientCertificate.cs TlsClientCertificateType.cs TlsClientCertificateVerify.cs TlsClientFinished.cs TlsClientHandshakeMessage.cs TlsClientHello.cs TlsClientKeyExchange.cs TlsHandshakeHashes.cs TlsHandshakeType.cs TlsServerCertificate.cs TlsServerCertificateRequest.cs TlsServerFinished.cs TlsServerHandshakeMessage.cs TlsServerHello.cs TlsServerHelloDone.cs TlsServerKeyExchange.cs Log Message: Moved to Handshake\Client directory --- TlsClientCertificate.cs DELETED --- --- TlsClientCertificateType.cs DELETED --- --- TlsClientCertificateVerify.cs DELETED --- --- TlsClientFinished.cs DELETED --- --- TlsClientHandshakeMessage.cs DELETED --- --- TlsClientHello.cs DELETED --- --- TlsClientKeyExchange.cs DELETED --- --- TlsHandshakeHashes.cs DELETED --- --- TlsHandshakeType.cs DELETED --- --- TlsServerCertificate.cs DELETED --- --- TlsServerCertificateRequest.cs DELETED --- --- TlsServerFinished.cs DELETED --- --- TlsServerHandshakeMessage.cs DELETED --- --- TlsServerHello.cs DELETED --- --- TlsServerHelloDone.cs DELETED --- --- TlsServerKeyExchange.cs DELETED --- |
From: <car...@us...> - 2003-10-09 19:51:57
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv7401 Added Files: TlsSessionState.cs Log Message: - Added better control of session state and socket/session/networkstream closing ( needs testing but seems to be the way to go ). |
From: <car...@us...> - 2003-10-09 19:50:41
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv7125 Modified Files: TlsNetworkStream.cs TlsSession.cs TlsSocket.cs Log Message: - Added better control of session state and socket/session/networkstream closing ( needs testing but seems to be the way to go ). Index: TlsNetworkStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsNetworkStream.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsNetworkStream.cs 9 Oct 2003 10:21:45 -0000 1.4 --- TlsNetworkStream.cs 9 Oct 2003 19:50:34 -0000 1.5 *************** *** 24,28 **** namespace System.Security.Tls { ! public class TlsNetworkStream : Stream { #region PROPERTIES --- 24,28 ---- namespace System.Security.Tls { ! public class TlsNetworkStream : Stream, IDisposable { #region PROPERTIES *************** *** 32,35 **** --- 32,36 ---- private bool canRead; private bool canWrite; + private bool disposed; #endregion *************** *** 89,92 **** --- 90,143 ---- #endregion + #region DESTRUCTOR + + ~TlsNetworkStream() + { + this.Dispose(false); + } + + #endregion + + #region IDISPOSABLE + + void IDisposable.Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + if (this.socket != null) + { + if (this.ownsSocket) + { + try + { + this.socket.Shutdown(SocketShutdown.Both); + } + catch{} + finally + { + this.socket.Close(); + } + } + } + this.ownsSocket = false; + this.canRead = false; + this.canWrite = false; + this.socket = null; + } + + disposed = true; + } + } + + #endregion + #region PROTECTED_PROPERTIES *************** *** 129,132 **** --- 180,200 ---- public TlsNetworkStream(TlsSocket socket, FileAccess access, bool ownsSocket) { + if (socket == null) + { + throw new ArgumentNullException("socket is a null reference."); + } + if (!socket.Blocking) + { + throw new IOException("socket is in a nonblocking state."); + } + if (socket.SocketType != SocketType.Stream) + { + throw new IOException("The SocketType property of socket is not SocketType.Stream."); + } + if (!socket.Connected) + { + throw new IOException("socket is not connected."); + } + this.socket = socket; this.ownsSocket = ownsSocket; *************** *** 184,202 **** public override void Close() { ! if (socket != null) ! { ! if (this.ownsSocket) ! { ! try ! { ! socket.Shutdown(SocketShutdown.Both); ! } ! catch{} ! finally ! { ! socket.Close(); ! } ! } ! } } --- 252,256 ---- public override void Close() { ! ((IDisposable)this).Dispose(); } *************** *** 209,225 **** if (buffer == null) { ! throw new ArgumentNullException("buffer"); } ! if (offset < 0 || offset > buffer.Length) { ! throw new ArgumentOutOfRangeException("offset"); } ! if (size < 0 || size > (buffer.Length - offset)) { ! throw new ArgumentOutOfRangeException("size"); } ! if (socket == null) { ! throw new IOException(); } --- 263,291 ---- if (buffer == null) { ! throw new ArgumentNullException("buffer is a null reference."); } ! if (offset < 0) { ! throw new ArgumentOutOfRangeException("offset is less than 0."); } ! if (offset > buffer.Length) { ! throw new ArgumentOutOfRangeException("offset is greater than the length of buffer."); } ! if (size < 0) { ! throw new ArgumentOutOfRangeException("size is less than 0."); ! } ! if (size > (buffer.Length - offset)) ! { ! throw new ArgumentOutOfRangeException("size is less than the length of buffer minus the value of the offset parameter."); ! } ! if (disposed) ! { ! throw new ObjectDisposedException("The NetworkStream is closed."); ! } ! if (!socket.Connected) ! { ! throw new IOException("The underlying Socket is closed."); } *************** *** 252,270 **** if (buffer == null) { ! throw new ArgumentNullException("buffer"); } ! if (offset < 0 || offset > buffer.Length) { ! throw new ArgumentOutOfRangeException("offset"); } ! if (size < 0 || size > (buffer.Length - offset)) { ! throw new ArgumentOutOfRangeException("size"); } ! if (socket == null) { ! throw new IOException(); } ! try { --- 318,348 ---- if (buffer == null) { ! throw new ArgumentNullException("buffer is a null reference."); } ! if (offset < 0) { ! throw new ArgumentOutOfRangeException("offset is less than 0."); } ! if (offset > buffer.Length) { ! throw new ArgumentOutOfRangeException("offset is greater than the length of buffer."); } ! if (size < 0) { ! throw new ArgumentOutOfRangeException("size is less than 0."); } ! if (size > (buffer.Length - offset)) ! { ! throw new ArgumentOutOfRangeException("size is less than the length of buffer minus the value of the offset parameter."); ! } ! if (disposed) ! { ! throw new ObjectDisposedException("The NetworkStream is closed."); ! } ! if (!socket.Connected) ! { ! throw new IOException("The underlying Socket is closed."); ! } ! try { Index: TlsSession.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSession.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** TlsSession.cs 8 Oct 2003 21:57:16 -0000 1.23 --- TlsSession.cs 9 Oct 2003 19:50:34 -0000 1.24 *************** *** 27,31 **** using System.Security.Tls.Cryptography; using System.Security.Tls.Alerts; - // using System.Security.Tls.Handshake; namespace System.Security.Tls --- 27,30 ---- *************** *** 50,53 **** --- 49,53 ---- private TlsNetworkStream networkStream; private bool isSecure; + private TlsSessionState state; #endregion *************** *** 103,106 **** --- 103,111 ---- } + public TlsSessionState State + { + get { return state; } + } + #endregion *************** *** 113,117 **** this.context = new TlsSessionContext(); this.sessionId = new byte[0]; ! // Initialize socket for connection this.initializeSocket(); --- 118,122 ---- this.context = new TlsSessionContext(); this.sessionId = new byte[0]; ! // Initialize socket for connection this.initializeSocket(); *************** *** 137,140 **** --- 142,147 ---- internal TlsException CreateException(string message) { + this.state = TlsSessionState.Broken; + // Throw an exception will made the connection unavailable // for this both streams will be closed *************** *** 152,163 **** --- 159,173 ---- try { + this.state = TlsSessionState.OpeningSecure; this.socket.DoHandshake(); } catch (TlsException ex) { + this.state = TlsSessionState.Broken; throw ex; } catch (Exception ex) { + this.state = TlsSessionState.Broken; this.closeStreams(); throw ex; *************** *** 169,172 **** --- 179,184 ---- try { + this.state = TlsSessionState.Closing; + if (isSecure) { *************** *** 181,188 **** throw new TlsException("Invalid session termination"); } ! } } catch (Exception ex) { throw ex; } --- 193,201 ---- throw new TlsException("Invalid session termination"); } ! } } catch (Exception ex) { + this.state = TlsSessionState.Broken; throw ex; } *************** *** 191,194 **** --- 204,209 ---- // Close streams closeStreams(); + + this.state = TlsSessionState.Closed; } } *************** *** 217,234 **** private void initializeSocket() { ! // Initialize socket ! IPAddress hostadd = Dns.Resolve(settings.ServerName).AddressList[0]; ! IPEndPoint EPhost = new IPEndPoint(hostadd, settings.ServerPort); ! // Create the socket ! socket = new TlsSocket( ! this, ! AddressFamily.InterNetwork, ! SocketType.Stream, ! ProtocolType.IP); ! // Make the socket to connect to the Server ! socket.Connect(EPhost); ! networkStream = new TlsNetworkStream(socket, true); } --- 232,261 ---- private void initializeSocket() { ! try ! { ! this.state = TlsSessionState.Opening; ! // Initialize socket ! IPAddress hostadd = Dns.Resolve(settings.ServerName).AddressList[0]; ! IPEndPoint EPhost = new IPEndPoint(hostadd, settings.ServerPort); ! // Create the socket ! socket = new TlsSocket( ! this, ! AddressFamily.InterNetwork, ! SocketType.Stream, ! ProtocolType.IP); ! ! // Make the socket to connect to the Server ! socket.Connect(EPhost); ! networkStream = new TlsNetworkStream(socket, true); ! ! this.state = TlsSessionState.Open; ! } ! catch (Exception ex) ! { ! this.state = TlsSessionState.Broken; ! throw ex; ! } } *************** *** 239,246 **** // Close the socket and the networkStream ! if (!this.socket.Connected) ! { ! this.networkStream.Close(); ! } // Reset session information --- 266,270 ---- // Close the socket and the networkStream ! this.networkStream.Close(); // Reset session information *************** *** 249,253 **** this.handshakeFinished = false; this.context = new TlsSessionContext(); ! this.sessionId = new byte[0]; } --- 273,277 ---- this.handshakeFinished = false; this.context = new TlsSessionContext(); ! this.sessionId = new byte[0]; } Index: TlsSocket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSocket.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TlsSocket.cs 8 Oct 2003 20:28:13 -0000 1.10 --- TlsSocket.cs 9 Oct 2003 19:50:34 -0000 1.11 *************** *** 82,86 **** this.resetBuffer(); base.Close(); ! this.session.Close(); } --- 82,90 ---- this.resetBuffer(); base.Close(); ! if (this.session.State != TlsSessionState.Closing && ! this.session.State != TlsSessionState.Closed) ! { ! this.session.Close(); ! } } |
From: <car...@us...> - 2003-10-09 15:46:27
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv14824 Modified Files: PgDbConnection.cs Log Message: Avoid problems with empty elements on connection string. Index: PgDbConnection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDbConnection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgDbConnection.cs 12 Aug 2003 13:12:34 -0000 1.2 --- PgDbConnection.cs 9 Oct 2003 15:46:23 -0000 1.3 *************** *** 37,41 **** private bool pooled; private Regex search; - // private MatchCollection elements; #endregion --- 37,40 ---- *************** *** 81,85 **** { settings = new PgConnectionParams(); - // search = new Regex(@"([\w\s\d]*)\s*=\s*([\w\s\d]*)"); search = new Regex(@"([\w\s\d]*)\s*=\s*([^;]*)"); --- 80,83 ---- *************** *** 131,180 **** foreach (Match element in elements) { ! switch (element.Groups[1].Value.Trim().ToLower()) { ! case "datasource": ! case "server": ! case "host": ! settings.ServerName = element.Groups[2].Value.Trim(); ! break; ! case "database": ! settings.Database = element.Groups[2].Value.Trim(); ! break; ! case "user name": ! case "user": ! settings.UserName = element.Groups[2].Value.Trim(); ! break; ! case "user password": ! case "password": ! settings.UserPassword = element.Groups[2].Value.Trim(); ! break; ! case "port": ! settings.ServerPort = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! case "connection lifetime": ! lifetime = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! case "timeout": ! case "connection timeout": ! settings.Timeout = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! case "packet size": ! settings.PacketSize = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! case "pooling": ! settings.Pooling = Boolean.Parse(element.Groups[2].Value.Trim()); ! break; ! case "ssl": ! settings.SSL = Boolean.Parse(element.Groups[2].Value.Trim()); ! break; } } --- 129,181 ---- foreach (Match element in elements) { ! if (element.Groups[2].Value.Trim().Length > 0) { ! switch (element.Groups[1].Value.Trim().ToLower()) ! { ! case "datasource": ! case "server": ! case "host": ! settings.ServerName = element.Groups[2].Value.Trim(); ! break; ! case "database": ! settings.Database = element.Groups[2].Value.Trim(); ! break; ! case "user name": ! case "user": ! settings.UserName = element.Groups[2].Value.Trim(); ! break; ! case "user password": ! case "password": ! settings.UserPassword = element.Groups[2].Value.Trim(); ! break; ! case "port": ! settings.ServerPort = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! case "connection lifetime": ! lifetime = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! case "timeout": ! case "connection timeout": ! settings.Timeout = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! case "packet size": ! settings.PacketSize = Int32.Parse(element.Groups[2].Value.Trim()); ! break; ! case "pooling": ! settings.Pooling = Boolean.Parse(element.Groups[2].Value.Trim()); ! break; ! case "ssl": ! settings.SSL = Boolean.Parse(element.Groups[2].Value.Trim()); ! break; ! } } } |
From: <car...@us...> - 2003-10-09 14:59:50
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv6297 Modified Files: makefile Log Message: Updated makefile Index: makefile =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** makefile 5 Oct 2003 16:43:16 -0000 1.6 --- makefile 9 Oct 2003 14:59:46 -0000 1.7 *************** *** 18,22 **** RECURSE_TLS = -recurse:./PgSqlClient.Security.Tls/source/*.cs RECURSE_SOURCE = -recurse:./PostgreSql.Data.PgSqlClient/source/*.cs ! RECURSE_TESTS = -recurse:./PostgreSql.Data.PgSqlClient.UnitTests/source/*.cs # COnfiguration files --- 18,22 ---- RECURSE_TLS = -recurse:./PgSqlClient.Security.Tls/source/*.cs RECURSE_SOURCE = -recurse:./PostgreSql.Data.PgSqlClient/source/*.cs ! RECURSE_TESTS = -recurse:./PostgreSql.Data.PgSqlClient.UnitTests/source/*.cs # COnfiguration files *************** *** 33,37 **** PostgreSql.Data.PgSqlClient.UnitTests.dll: - $(CSC) -target:library -out:$(NUNIT_SUITE) $(LD_BASIC_FLAGS) -reference:${LIBRARY} -reference:NUnit.Framework.dll $(DEFINE) $(TOOL_RESOURCES) $(RECURSE_TESTS) --- 33,36 ---- *************** *** 47,49 **** rm $(TLS) rm $(LIBRARY) ! rm ${NUNIT_SUITE \ No newline at end of file --- 46,48 ---- rm $(TLS) rm $(LIBRARY) ! rm ${NUNIT_SUITE} \ No newline at end of file |
From: <car...@us...> - 2003-10-09 11:59:13
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv25497 Modified Files: PgCommandBuilder.cs Log Message: Back to prior command text format Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PgCommandBuilder.cs 9 Oct 2003 11:31:23 -0000 1.9 --- PgCommandBuilder.cs 9 Oct 2003 11:59:09 -0000 1.10 *************** *** 125,129 **** sqlUpdate = "UPDATE {0} SET {1} WHERE ( {2} )"; sqlDelete = "DELETE FROM {0} WHERE ( {1} )"; ! whereClausule1 = "(({0} IS NULL AND ${1} = NULL) OR ({0} = ${2}))"; whereClausule2 = "({0} = ${1})"; setClausule = "{0} = ${1}"; --- 125,129 ---- sqlUpdate = "UPDATE {0} SET {1} WHERE ( {2} )"; sqlDelete = "DELETE FROM {0} WHERE ( {1} )"; ! whereClausule1 = "(({0} IS NULL AND ${1} = NULL) OR ({0} = ${2}))"; whereClausule2 = "({0} = ${1})"; setClausule = "{0} = ${1}"; *************** *** 437,441 **** foreach (DataRow schemaRow in schemaTable.Rows) { ! if (includedInWhereClause (schemaRow)) { if (where.Length > 0) --- 437,441 ---- foreach (DataRow schemaRow in schemaTable.Rows) { ! if (includedInWhereClause(schemaRow)) { if (where.Length > 0) *************** *** 447,486 **** string quotedId = getQuotedIdentifier(schemaRow["BaseColumnName"]); - if ((bool)schemaRow["IsKey"]) - { - PgParameter parameter = createParameter(schemaRow, i, true); - where.AppendFormat(whereClausule2, quotedId, i); ! if (row != null) ! { ! parameter.Value = row[dsColumnName, DataRowVersion.Original]; ! } ! updateCommand.Parameters.Add(parameter); ! } ! else { ! // Create parameters for this field ! int paramIndex1 = i; ! PgParameter parameter1 = createParameter(schemaRow, paramIndex1, true); ! int paramIndex2 = ++i; ! PgParameter parameter2 = createParameter(schemaRow, paramIndex2, true); ! ! // Add where clausule for this field ! where.AppendFormat(whereClausule1, ! quotedId, paramIndex1, paramIndex2); ! ! // Set parameter values ! if (row != null) ! { ! parameter1.Value = row[dsColumnName, DataRowVersion.Original]; ! parameter2.Value = row[dsColumnName, DataRowVersion.Original]; ! } ! ! // Add parameters to command parameter collectionb ! updateCommand.Parameters.Add(parameter1); ! updateCommand.Parameters.Add(parameter2); } i++; } --- 447,461 ---- string quotedId = getQuotedIdentifier(schemaRow["BaseColumnName"]); ! PgParameter parameter = createParameter(schemaRow, i, true); ! where.AppendFormat(whereClausule2, quotedId, i); ! if (row != null) { ! parameter.Value = row[dsColumnName, DataRowVersion.Original]; } + updateCommand.Parameters.Add(parameter); + i++; } *************** *** 526,565 **** string quotedId = getQuotedIdentifier(schemaRow["BaseColumnName"]); - if ((bool)schemaRow["IsKey"]) - { - PgParameter parameter = createParameter(schemaRow, i, true); - where.AppendFormat(whereClausule2, quotedId, i); ! if (row != null) ! { ! parameter.Value = row[dsColumnName, DataRowVersion.Original]; ! } ! deleteCommand.Parameters.Add(parameter); ! } ! else { ! // Create parameters for this field ! int paramIndex1 = i; ! PgParameter parameter1 = createParameter(schemaRow, paramIndex1, true); ! int paramIndex2 = ++i; ! PgParameter parameter2 = createParameter(schemaRow, paramIndex2, true); ! ! // Add where clausule for this field ! where.AppendFormat(whereClausule1, ! quotedId, paramIndex1, paramIndex2); ! ! // Set parameter values ! if (row != null) ! { ! parameter1.Value = row[dsColumnName, DataRowVersion.Original]; ! parameter2.Value = row[dsColumnName, DataRowVersion.Original]; ! } ! ! // Add parameters to command parameter collectionb ! deleteCommand.Parameters.Add(parameter1); ! deleteCommand.Parameters.Add(parameter2); } i++; } --- 501,515 ---- string quotedId = getQuotedIdentifier(schemaRow["BaseColumnName"]); ! PgParameter parameter = createParameter(schemaRow, i, true); ! where.AppendFormat(whereClausule2, quotedId, i); ! if (row != null) { ! parameter.Value = row[dsColumnName, DataRowVersion.Original]; } + deleteCommand.Parameters.Add(parameter); + i++; } *************** *** 672,680 **** private bool includedInWhereClause(DataRow schemaRow) { ! if (!(bool)schemaRow["IsKey"]) ! { ! // return false; ! } ! PgDbType pgDbType= (PgDbType)schemaRow["ProviderType"]; --- 622,626 ---- private bool includedInWhereClause(DataRow schemaRow) { ! /* PgDbType pgDbType= (PgDbType)schemaRow["ProviderType"]; *************** *** 685,688 **** --- 631,640 ---- if (pgDbType == PgDbType.Array) + { + return false; + } + */ + + if (!(bool)schemaRow["IsKey"]) { return false; |
From: <car...@us...> - 2003-10-09 11:46:51
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source In directory sc8-pr-cvs1:/tmp/cvs-serv23928 Modified Files: PgDataAdapterTest.cs PgDataReaderTest.cs Log Message: Updated tests Index: PgDataAdapterTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgDataAdapterTest.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PgDataAdapterTest.cs 2 Aug 2003 19:43:03 -0000 1.1.1.1 --- PgDataAdapterTest.cs 9 Oct 2003 11:46:47 -0000 1.2 *************** *** 93,97 **** { PgTransaction transaction = Connection.BeginTransaction(); ! PgCommand command = new PgCommand("SELECT * FROM public.test_table", Connection); PgDataAdapter adapter = new PgDataAdapter(command); --- 93,97 ---- { PgTransaction transaction = Connection.BeginTransaction(); ! PgCommand command = new PgCommand("SELECT * FROM public.test_table", Connection, transaction); PgDataAdapter adapter = new PgDataAdapter(command); Index: PgDataReaderTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgDataReaderTest.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PgDataReaderTest.cs 2 Aug 2003 19:43:03 -0000 1.1.1.1 --- PgDataReaderTest.cs 9 Oct 2003 11:46:47 -0000 1.2 *************** *** 200,208 **** } [Test] - [Ignore("Not implemented")] public void NextResultTest() { ! } } } --- 200,246 ---- } + [Test] public void NextResultTest() { ! string querys = ! "select * from public.test_table order by int4_field asc;" + ! "select * from public.test_table order by int4_field desc;"; ! ! PgCommand command = new PgCommand(querys, Connection); ! ! PgDataReader reader = command.ExecuteReader(); ! ! Console.WriteLine(); ! Console.WriteLine("DataReader - NextResult Method - Test ( First Result )"); ! ! while (reader.Read()) ! { ! for(int i = 0; i < reader.FieldCount; i++) ! { ! Console.Write(reader.GetValue(i) + "\t"); ! } ! ! Console.WriteLine(); ! } ! ! if (reader.NextResult()) ! { ! Console.WriteLine("DataReader - NextResult Method - Test ( Second Result )"); ! ! while (reader.Read()) ! { ! for(int i = 0; i < reader.FieldCount; i++) ! { ! Console.Write(reader.GetValue(i) + "\t"); ! } ! ! Console.WriteLine(); ! } ! } ! ! reader.Close(); ! command.Dispose(); ! } } } |
From: <car...@us...> - 2003-10-09 11:32:21
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv21912 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** changelog.txt 8 Oct 2003 20:28:42 -0000 1.38 --- changelog.txt 9 Oct 2003 11:32:18 -0000 1.39 *************** *** 4,7 **** --- 4,15 ---- 2003-10-08 Carlos Guzmán Álvarez <car...@te...> + * source/PgCommand.cs: + * source/PgCommandbuilder.cs: + * source/PgDatareader.cs: + + - Fixed some bugs introduced with latest commits + + 2003-10-08 Carlos Guzmán Álvarez <car...@te...> + * TLS library: |
From: <car...@us...> - 2003-10-09 11:31:26
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv21809 Modified Files: PgCommand.cs PgCommandBuilder.cs PgDataReader.cs Log Message: Fixed some bugs introduced with latest commits Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PgCommand.cs 7 Oct 2003 10:26:06 -0000 1.9 --- PgCommand.cs 9 Oct 2003 11:31:23 -0000 1.10 *************** *** 232,237 **** { this.CommandText = cmdText; ! this.Connection = connection; ! this.Transaction = transaction; } --- 232,237 ---- { this.CommandText = cmdText; ! this.connection = connection; ! this.transaction = transaction; } Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PgCommandBuilder.cs 29 Sep 2003 14:37:14 -0000 1.8 --- PgCommandBuilder.cs 9 Oct 2003 11:31:23 -0000 1.9 *************** *** 359,368 **** values.Append(separator); } - - // Build Field name and append it to the string - fields.Append(getQuotedIdentifier(schemaRow["BaseColumnName"])); - - // Build value name and append it to the string - values.Append("@param_" + i.ToString()); PgParameter parameter = createParameter(schemaRow, i, false); --- 359,362 ---- *************** *** 375,378 **** --- 369,378 ---- i++; + + // Build Field name and append it to the string + fields.Append(getQuotedIdentifier(schemaRow["BaseColumnName"])); + + // Build value name and append it to the string + values.Append(parameter.ParameterName); insertCommand.Parameters.Add(parameter); Index: PgDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PgDataReader.cs 7 Oct 2003 09:05:01 -0000 1.8 --- PgDataReader.cs 9 Oct 2003 11:31:23 -0000 1.9 *************** *** 182,190 **** public bool Read() { ! bool read = true; ! if (command.CommandBehavior == CommandBehavior.SingleRow && position != STARTPOS) { - read = false; } else --- 182,190 ---- public bool Read() { ! bool read = false; ! if ((command.CommandBehavior == CommandBehavior.SingleRow && ! position != STARTPOS) || !command.Statement.HasRows) { } else |
From: <car...@us...> - 2003-10-09 10:23:43
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv12410 Modified Files: TlsServerCertificate.cs Log Message: Improved a little more the read of the server certificates Index: TlsServerCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/TlsServerCertificate.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsServerCertificate.cs 8 Oct 2003 20:27:05 -0000 1.8 --- TlsServerCertificate.cs 9 Oct 2003 10:23:40 -0000 1.9 *************** *** 67,82 **** this.certificates = new X509CertificateCollection(); ! // Read Length ! int length = Reader.ReadInt24(); ! int count = 3; ! // Skip next 3 bytes ! int skip = Reader.ReadInt24(); ! while (count < length) { // Read certificate length int certLength = Reader.ReadInt24(); if (certLength > 0) { --- 67,85 ---- this.certificates = new X509CertificateCollection(); ! // Skip first 3 bytes ! int skip = Reader.ReadInt24(); ! int readed = 0; ! // Read Length ! int length = Reader.ReadInt24(); ! while (readed < length) { // Read certificate length int certLength = Reader.ReadInt24(); + // Increment readed + readed += 3; + if (certLength > 0) { *************** *** 85,89 **** certificates.Add(certificate); ! count += certLength + 3; validateCertificate(certificate); --- 88,92 ---- certificates.Add(certificate); ! readed += certLength; validateCertificate(certificate); |
From: <car...@us...> - 2003-10-09 10:21:49
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv12184 Modified Files: TlsNetworkStream.cs Log Message: Override async methods ( throws always an exception at this moment ) Index: TlsNetworkStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsNetworkStream.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsNetworkStream.cs 17 Sep 2003 14:44:16 -0000 1.3 --- TlsNetworkStream.cs 9 Oct 2003 10:21:45 -0000 1.4 *************** *** 152,155 **** --- 152,185 ---- #region METHODS + public override IAsyncResult BeginRead( + byte[] buffer, + int offset, + int count, + AsyncCallback callback, + object state) + { + throw new NotSupportedException(); + } + + public override IAsyncResult BeginWrite( + byte[] buffer, + int offset, + int count, + AsyncCallback callback, + object state) + { + throw new NotSupportedException(); + } + + public override int EndRead(IAsyncResult asyncResult) + { + throw new NotSupportedException(); + } + + public override void EndWrite(IAsyncResult asyncResult) + { + throw new NotSupportedException(); + } + public override void Close() { |
From: <car...@us...> - 2003-10-09 08:54:59
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv1648 Modified Files: TlsSessionContext.cs TlsSessionSettings.cs Log Message: Updated files Index: TlsSessionContext.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSessionContext.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsSessionContext.cs 8 Oct 2003 21:57:16 -0000 1.3 --- TlsSessionContext.cs 9 Oct 2003 08:54:55 -0000 1.4 *************** *** 56,59 **** --- 56,62 ---- private byte[] serverWriteIV; + // Handshake hashes + private TlsHandshakeHashes handshakeHashes; + #endregion Index: TlsSessionSettings.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSessionSettings.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TlsSessionSettings.cs 13 Sep 2003 10:23:10 -0000 1.6 --- TlsSessionSettings.cs 9 Oct 2003 08:54:56 -0000 1.7 *************** *** 58,62 **** { get { return protocol; } ! set { protocol = value; } } --- 58,69 ---- { get { return protocol; } ! set ! { ! if (value != TlsProtocol.Tls1) ! { ! throw new NotSupportedException("Specified protocol is not supported"); ! } ! protocol = value; ! } } *************** *** 82,91 **** public TlsSessionSettings(TlsProtocol protocol) : this() { ! this.protocol = protocol; } ! public TlsSessionSettings(TlsProtocol protocol, Encoding encoding) : this() { - this.protocol = protocol; this.encoding = encoding; } --- 89,97 ---- public TlsSessionSettings(TlsProtocol protocol) : this() { ! this.Protocol = protocol; } ! public TlsSessionSettings(TlsProtocol protocol, Encoding encoding) : this(protocol) { this.encoding = encoding; } *************** *** 115,127 **** } ! public TlsSessionSettings(TlsProtocol protocol, string serverName) : this() { - this.protocol = protocol; this.serverName = serverName; } ! public TlsSessionSettings(TlsProtocol protocol, string serverName, Encoding encoding) : this() { - this.protocol = protocol; this.serverName = serverName; this.encoding = encoding; --- 121,131 ---- } ! public TlsSessionSettings(TlsProtocol protocol, string serverName) : this(protocol) { this.serverName = serverName; } ! public TlsSessionSettings(TlsProtocol protocol, string serverName, Encoding encoding) : this(protocol) { this.serverName = serverName; this.encoding = encoding; *************** *** 129,142 **** ! public TlsSessionSettings(TlsProtocol protocol, string serverName, int serverPort) : this() { - this.protocol = protocol; this.serverName = serverName; this.serverPort = serverPort; } ! public TlsSessionSettings(TlsProtocol protocol, string serverName, int serverPort, Encoding encoding) : this() { - this.protocol = protocol; this.serverName = serverName; this.serverPort = serverPort; --- 133,144 ---- ! public TlsSessionSettings(TlsProtocol protocol, string serverName, int serverPort) : this(protocol) { this.serverName = serverName; this.serverPort = serverPort; } ! public TlsSessionSettings(TlsProtocol protocol, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.serverName = serverName; this.serverPort = serverPort; *************** *** 144,163 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates) : this() { - this.protocol = protocol; this.certificates = certificates; } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, Encoding encoding) : this() { - this.protocol = protocol; this.certificates = certificates; this.encoding = encoding; } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, string serverName, int serverPort) : this() { - this.protocol = protocol; this.certificates = certificates; this.serverName = serverName; --- 146,162 ---- } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates) : this(protocol) { this.certificates = certificates; } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, Encoding encoding) : this(protocol) { this.certificates = certificates; this.encoding = encoding; } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, string serverName, int serverPort) : this(protocol) { this.certificates = certificates; this.serverName = serverName; *************** *** 165,171 **** } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, string serverName, int serverPort, Encoding encoding) : this() { - this.protocol = protocol; this.certificates = certificates; this.serverName = serverName; --- 164,169 ---- } ! public TlsSessionSettings(TlsProtocol protocol, X509CertificateCollection certificates, string serverName, int serverPort, Encoding encoding) : this(protocol) { this.certificates = certificates; this.serverName = serverName; |
From: <car...@us...> - 2003-10-08 21:57:56
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv5815 Modified Files: TlsClientCertificate.cs TlsServerCertificateRequest.cs Log Message: Added changes to the client authentication stuff Index: TlsClientCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/TlsClientCertificate.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TlsClientCertificate.cs 8 Oct 2003 12:20:08 -0000 1.1 --- TlsClientCertificate.cs 8 Oct 2003 21:57:52 -0000 1.2 *************** *** 18,21 **** --- 18,22 ---- using System; + using System.Security.Tls; using System.Security.Cryptography.X509Certificates; *************** *** 47,51 **** protected override void Fill() { ! #warning "Process message here" } --- 48,64 ---- protected override void Fill() { ! #warning "Check which type of certificates has been requested by the server" ! ! // Write client certificates information to a stream ! TlsStreamWriter stream = new TlsStreamWriter(); ! foreach (X509Certificate cert in Session.Settings.Certificates) ! { ! stream.WriteInt24(cert.GetRawCertData().Length); ! stream.Write(cert.GetRawCertData()); ! } ! ! // Compose the message ! this.WriteInt24((int)stream.Length); ! this.Write(stream.GetBytes()); } Index: TlsServerCertificateRequest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/TlsServerCertificateRequest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TlsServerCertificateRequest.cs 8 Oct 2003 18:23:18 -0000 1.6 --- TlsServerCertificateRequest.cs 8 Oct 2003 21:57:52 -0000 1.7 *************** *** 47,51 **** base.UpdateSession(); ! Session.Context.ServerSettings.CertificateRequest = true; } --- 47,53 ---- base.UpdateSession(); ! Session.Context.ServerSettings.CertificateTypes = this.certificateTypes; ! Session.Context.ServerSettings.DistinguisedNames = this.distinguisedNames; ! Session.Context.ServerSettings.CertificateRequest = true; } *************** *** 85,88 **** --- 87,91 ---- distinguisedNames = new string[rdn.Count]; + #warning "needs testing" for (int i = 0; i < rdn.Count; i++) { |
From: <car...@us...> - 2003-10-08 21:57:20
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv5752 Modified Files: TlsServerSettings.cs TlsSession.cs TlsSessionContext.cs Log Message: Added changes to the client authentication stuff Index: TlsServerSettings.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsServerSettings.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsServerSettings.cs 1 Sep 2003 10:19:44 -0000 1.2 --- TlsServerSettings.cs 8 Oct 2003 21:57:16 -0000 1.3 *************** *** 33,36 **** --- 33,37 ---- private bool certificateRequest; private TlsClientCertificateType[] certificateTypes; + private string[] distinguisedNames; private RSAParameters rsaParameters; private byte[] signedParams; *************** *** 68,71 **** --- 69,78 ---- get { return certificateTypes; } set { certificateTypes = value; } + } + + public string[] DistinguisedNames + { + get { return distinguisedNames; } + set { distinguisedNames = value; } } Index: TlsSession.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSession.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** TlsSession.cs 8 Oct 2003 12:16:47 -0000 1.22 --- TlsSession.cs 8 Oct 2003 21:57:16 -0000 1.23 *************** *** 88,94 **** } ! public TlsNetworkStream NetworkStream { ! get { return networkStream; } } --- 88,94 ---- } ! internal TlsSessionSettings Settings { ! get { return settings; } } *************** *** 96,99 **** --- 96,104 ---- { get { return (short)Math.Pow(2, 14); } + } + + public TlsNetworkStream NetworkStream + { + get { return networkStream; } } Index: TlsSessionContext.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSessionContext.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsSessionContext.cs 8 Oct 2003 12:16:47 -0000 1.2 --- TlsSessionContext.cs 8 Oct 2003 21:57:16 -0000 1.3 *************** *** 30,47 **** #region FIELDS private TlsServerSettings serverSettings; ! private TlsHandshakeHashes handshakeHashes; ! private bool connectionEnd; private TlsCipherSuite cipher; private int compressionMethod; - private byte[] masterSecret; - private byte[] clientRandom; - private byte[] serverRandom; private long writeSequenceNumber; private long readSequenceNumber; private byte[] clientWriteMAC; private byte[] serverWriteMAC; --- 30,52 ---- #region FIELDS + // Information sent and request by the server in the Handshake protocol private TlsServerSettings serverSettings; ! // Misc ! private bool isActual; private bool connectionEnd; private TlsCipherSuite cipher; private int compressionMethod; + // Sequence numbers private long writeSequenceNumber; private long readSequenceNumber; + // Random data + private byte[] clientRandom; + private byte[] serverRandom; + + // Key information + private byte[] masterSecret; private byte[] clientWriteMAC; private byte[] serverWriteMAC; *************** *** 50,56 **** private byte[] clientWriteIV; private byte[] serverWriteIV; ! ! private bool isActual; ! #endregion --- 55,59 ---- private byte[] clientWriteIV; private byte[] serverWriteIV; ! #endregion *************** *** 63,75 **** } ! public bool ConnectionEnd { ! get { return connectionEnd; } ! set { connectionEnd = value; } } ! public TlsHandshakeHashes HandshakeHashes { ! get { return handshakeHashes; } } --- 66,79 ---- } ! public bool IsActual { ! get { return isActual; } ! set { isActual = value; } } ! public bool ConnectionEnd { ! get { return connectionEnd; } ! set { connectionEnd = value; } } *************** *** 86,93 **** } ! public byte[] MasterSecret { ! get { return masterSecret; } ! set { masterSecret = value; } } --- 90,108 ---- } ! public TlsHandshakeHashes HandshakeHashes { ! get { return handshakeHashes; } ! } ! ! public long WriteSequenceNumber ! { ! get { return writeSequenceNumber; } ! set { writeSequenceNumber = value; } ! } ! ! public long ReadSequenceNumber ! { ! get { return readSequenceNumber; } ! set { readSequenceNumber = value; } } *************** *** 104,117 **** } ! public long WriteSequenceNumber ! { ! get { return writeSequenceNumber; } ! set { writeSequenceNumber = value; } ! } ! ! public long ReadSequenceNumber { ! get { return readSequenceNumber; } ! set { readSequenceNumber = value; } } --- 119,126 ---- } ! public byte[] MasterSecret { ! get { return masterSecret; } ! set { masterSecret = value; } } *************** *** 152,161 **** } - public bool IsActual - { - get { return isActual; } - set { isActual = value; } - } - #endregion --- 161,164 ---- *************** *** 364,367 **** --- 367,372 ---- serverWriteIV = null; serverWriteMAC = null; + + // Force the GC to recollect the memry ?? } |
From: <car...@us...> - 2003-10-08 20:28:46
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv20300 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** changelog.txt 8 Oct 2003 12:21:03 -0000 1.37 --- changelog.txt 8 Oct 2003 20:28:42 -0000 1.38 *************** *** 10,13 **** --- 10,15 ---- - Started the work to implement Client Certificate and Client certificate verify handshake messages. + - Fixed server certificate chain read + 2003-10-07 Carlos Guzmán Álvarez <car...@te...> |
From: <car...@us...> - 2003-10-08 20:28:17
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv20174 Modified Files: TlsSocket.cs Log Message: Updated file Index: TlsSocket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSocket.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsSocket.cs 8 Oct 2003 16:26:26 -0000 1.9 --- TlsSocket.cs 8 Oct 2003 20:28:13 -0000 1.10 *************** *** 451,461 **** message = createServerHandshakeMessage(handshakeType, handMsg); - if (message == null) - { - throw new TlsException("Unknown handshake message received from server."); - } // Update session ! message.UpdateSession(); } --- 451,460 ---- message = createServerHandshakeMessage(handshakeType, handMsg); // Update session ! if (message != null) ! { ! message.UpdateSession(); ! } } *************** *** 653,656 **** --- 652,659 ---- switch (type) { + case TlsHandshakeType.HelloRequest: + this.sendRecord(TlsHandshakeType.ClientHello); + return null; + case TlsHandshakeType.ServerHello: return new TlsServerHello(session, handMsg); *************** *** 672,676 **** default: ! throw session.CreateException("Unknown server handshake message received ({0})", type.ToString()); } } --- 675,679 ---- default: ! throw session.CreateException("Unknown server handshake message received ({0})", type.ToString()); } } |
From: <car...@us...> - 2003-10-08 20:27:08
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv19988 Modified Files: TlsServerCertificate.cs Log Message: Fixed certificate chain read Index: TlsServerCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/TlsServerCertificate.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsServerCertificate.cs 3 Oct 2003 19:09:56 -0000 1.7 --- TlsServerCertificate.cs 8 Oct 2003 20:27:05 -0000 1.8 *************** *** 69,79 **** // Read Length int length = Reader.ReadInt24(); ! int count = 0; while (count < length) { - // Skip next 3 bytes - int skip = Reader.ReadInt24(); - // Read certificate length int certLength = Reader.ReadInt24(); --- 69,79 ---- // Read Length int length = Reader.ReadInt24(); ! int count = 3; ! ! // Skip next 3 bytes ! int skip = Reader.ReadInt24(); while (count < length) { // Read certificate length int certLength = Reader.ReadInt24(); *************** *** 85,89 **** certificates.Add(certificate); ! count += skip + 3; validateCertificate(certificate); --- 85,89 ---- certificates.Add(certificate); ! count += certLength + 3; validateCertificate(certificate); |
From: <car...@us...> - 2003-10-08 18:23:22
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv13883 Modified Files: TlsServerCertificateRequest.cs Log Message: Finxihed decoding of distinguished names ( nedds testing but in first place seems to work ) Index: TlsServerCertificateRequest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/TlsServerCertificateRequest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsServerCertificateRequest.cs 8 Oct 2003 16:32:03 -0000 1.5 --- TlsServerCertificateRequest.cs 8 Oct 2003 18:23:18 -0000 1.6 *************** *** 19,22 **** --- 19,23 ---- using System; using System.Text; + using Mono.Security; namespace System.Security.Tls.Handshake *************** *** 67,74 **** } ! // Read requested certificate authorities ! byte[] rdn = Reader.ReadBytes(Reader.ReadShort()); ! #warning "Process distinguished names here" } --- 68,96 ---- } ! // Read requested certificate authorities (Distinguised Names) ! /* ! Name ::= SEQUENCE OF RelativeDistinguishedName ! ! RelativeDistinguishedName ::= SET OF AttributeValueAssertion ! ! AttributeValueAssertion ::= SEQUENCE { ! attributeType OBJECT IDENTIFIER ! attributeValue ANY } ! */ ! ! int tmp = Reader.ReadShort(); ! ASN1 rdn = new ASN1(Reader.ReadBytes(Reader.ReadShort())); ! ! distinguisedNames = new string[rdn.Count]; ! ! for (int i = 0; i < rdn.Count; i++) ! { ! // element[0] = attributeType ! // element[1] = attributeValue ! ASN1 element = new ASN1(rdn[i].Value); ! ! distinguisedNames[i] = Encoding.UTF8.GetString(element[1].Value); ! } } |
From: <car...@us...> - 2003-10-08 16:32:51
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv26197 Modified Files: TlsServerHello.cs Log Message: Minor change Index: TlsServerHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/TlsServerHello.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsServerHello.cs 16 Sep 2003 12:29:08 -0000 1.4 --- TlsServerHello.cs 8 Oct 2003 16:32:46 -0000 1.5 *************** *** 50,56 **** Session.SetSessionId(this.sessionId); ! Session.Context.ServerRandom = this.random; Session.Context.Cipher = this.cipherSuite; ! Session.Context.CompressionMethod = this.compressionMethod; Session.Context.Cipher.SessionState = Session.Context; } --- 50,56 ---- Session.SetSessionId(this.sessionId); ! Session.Context.ServerRandom = this.random; Session.Context.Cipher = this.cipherSuite; ! Session.Context.CompressionMethod = this.compressionMethod; Session.Context.Cipher.SessionState = Session.Context; } |
From: <car...@us...> - 2003-10-08 16:32:09
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake In directory sc8-pr-cvs1:/tmp/cvs-serv26092 Modified Files: TlsServerCertificateRequest.cs Log Message: Added partial implementation for this handshake message Index: TlsServerCertificateRequest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/TlsServerCertificateRequest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsServerCertificateRequest.cs 16 Sep 2003 12:29:08 -0000 1.4 --- TlsServerCertificateRequest.cs 8 Oct 2003 16:32:03 -0000 1.5 *************** *** 18,21 **** --- 18,22 ---- using System; + using System.Text; namespace System.Security.Tls.Handshake *************** *** 23,26 **** --- 24,34 ---- internal class TlsServerCertificateRequest : TlsServerHandshakeMessage { + #region FIELDS + + private TlsClientCertificateType[] certificateTypes; + private string[] distinguisedNames; + + #endregion + #region CONSTRUCTORS *************** *** 47,51 **** protected override void Parse() { ! #warning "Process message data" } --- 55,74 ---- protected override void Parse() { ! int length = Reader.ReadInt24(); ! ! // Read requested certificate types ! int typesCount = Reader.ReadByte(); ! ! certificateTypes = new TlsClientCertificateType[typesCount]; ! ! for (int i = 0; i < typesCount; i++) ! { ! certificateTypes[i] = (TlsClientCertificateType)Reader.ReadByte(); ! } ! ! // Read requested certificate authorities ! byte[] rdn = Reader.ReadBytes(Reader.ReadShort()); ! ! #warning "Process distinguished names here" } |
From: <car...@us...> - 2003-10-08 16:26:47
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv25135 Modified Files: TlsSocket.cs Log Message: reorganization Index: TlsSocket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSocket.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsSocket.cs 8 Oct 2003 12:16:47 -0000 1.8 --- TlsSocket.cs 8 Oct 2003 16:26:26 -0000 1.9 *************** *** 552,605 **** #region HANDSHAKE_METHODS ! private TlsClientHandshakeMessage createClientHandshakeMessage(TlsHandshakeType type) ! { ! switch (type) ! { ! case TlsHandshakeType.ClientHello: ! return new TlsClientHello(session); ! ! case TlsHandshakeType.ClientKeyExchange: ! return new TlsClientKeyExchange(session); ! ! case TlsHandshakeType.Certificate: ! return new TlsClientCertificate(session); ! ! case TlsHandshakeType.CertificateVerify: ! return new TlsClientCertificateVerify(session); ! ! case TlsHandshakeType.Finished: ! return new TlsClientFinished(session); ! ! default: ! throw new InvalidOperationException("Unknown client handshake message type: " + type.ToString() ); ! } ! } ! ! private TlsServerHandshakeMessage createServerHandshakeMessage(TlsHandshakeType type, TlsStreamReader handMsg) ! { ! switch (type) ! { ! case TlsHandshakeType.Certificate: ! return new TlsServerCertificate(session, handMsg); ! ! case TlsHandshakeType.CertificateRequest: ! return new TlsServerCertificateRequest(session, handMsg); ! ! case TlsHandshakeType.ServerHello: ! return new TlsServerHello(session, handMsg); ! ! case TlsHandshakeType.ServerHelloDone: ! return new TlsServerHelloDone(session, handMsg); ! ! case TlsHandshakeType.ServerKeyExchange: ! return new TlsServerKeyExchange(session, handMsg); ! case TlsHandshakeType.Finished: ! return new TlsServerFinished(session, handMsg); ! default: ! throw session.CreateException("Unknown server handshake message received ({0})", type.ToString()); ! } ! } internal void DoHandshake() --- 552,575 ---- #region HANDSHAKE_METHODS ! /* ! Client Server ! ClientHello --------> ! ServerHello ! Certificate* ! ServerKeyExchange* ! CertificateRequest* ! <-------- ServerHelloDone ! Certificate* ! ClientKeyExchange ! CertificateVerify* ! [ChangeCipherSpec] ! Finished --------> ! [ChangeCipherSpec] ! <-------- Finished ! Application Data <-------> Application Data ! Fig. 1 - Message flow for a full handshake ! */ internal void DoHandshake() *************** *** 621,625 **** if (session.Context.ServerSettings.CertificateRequest) { - #warning "Send client certificate if requested" this.sendRecord(TlsHandshakeType.Certificate); } --- 591,594 ---- *************** *** 634,638 **** if (session.Context.ServerSettings.CertificateRequest) { ! #warning "Send certificate verify if requested" } --- 603,607 ---- if (session.Context.ServerSettings.CertificateRequest) { ! this.sendRecord(TlsHandshakeType.CertificateVerify); } *************** *** 654,657 **** --- 623,677 ---- // Set isSecure session.IsSecure = true; + } + + private TlsClientHandshakeMessage createClientHandshakeMessage(TlsHandshakeType type) + { + switch (type) + { + case TlsHandshakeType.ClientHello: + return new TlsClientHello(session); + + case TlsHandshakeType.Certificate: + return new TlsClientCertificate(session); + + case TlsHandshakeType.ClientKeyExchange: + return new TlsClientKeyExchange(session); + + case TlsHandshakeType.CertificateVerify: + return new TlsClientCertificateVerify(session); + + case TlsHandshakeType.Finished: + return new TlsClientFinished(session); + + default: + throw new InvalidOperationException("Unknown client handshake message type: " + type.ToString() ); + } + } + + private TlsServerHandshakeMessage createServerHandshakeMessage(TlsHandshakeType type, TlsStreamReader handMsg) + { + switch (type) + { + case TlsHandshakeType.ServerHello: + return new TlsServerHello(session, handMsg); + + case TlsHandshakeType.Certificate: + return new TlsServerCertificate(session, handMsg); + + case TlsHandshakeType.ServerKeyExchange: + return new TlsServerKeyExchange(session, handMsg); + + case TlsHandshakeType.CertificateRequest: + return new TlsServerCertificateRequest(session, handMsg); + + case TlsHandshakeType.ServerHelloDone: + return new TlsServerHelloDone(session, handMsg); + + case TlsHandshakeType.Finished: + return new TlsServerFinished(session, handMsg); + + default: + throw session.CreateException("Unknown server handshake message received ({0})", type.ToString()); + } } |
From: <car...@us...> - 2003-10-08 12:21:06
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv13794 Modified Files: changelog.txt Log Message: Updated CHANGELOG.TXT Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** changelog.txt 7 Oct 2003 10:26:48 -0000 1.36 --- changelog.txt 8 Oct 2003 12:21:03 -0000 1.37 *************** *** 2,5 **** --- 2,12 ---- ------------------------------------------------------- + 2003-10-08 Carlos Guzmán Álvarez <car...@te...> + + * TLS library: + + - Added some code reorganization. + + - Started the work to implement Client Certificate and Client certificate verify handshake messages. 2003-10-07 Carlos Guzmán Álvarez <car...@te...> |