diff options
author | Raja R Harinath <harinath@hurrynot.org> | 2005-06-29 13:50:30 +0400 |
---|---|---|
committer | Raja R Harinath <harinath@hurrynot.org> | 2005-06-29 13:50:30 +0400 |
commit | cae752893e76a348fbd2fc36e1c0537d348547bc (patch) | |
tree | ae471a9e7150a6e6054775ea2878ccc9a7591033 | |
parent | add5da86935ae6d654127884c4d3539fc594787c (diff) |
Standardize file-endings. Set svn:eol-style=native on LF-terminated files.
svn path=/trunk/mcs/; revision=46710
64 files changed, 1429 insertions, 1429 deletions
diff --git a/mcs/class/Mono.Data.SybaseClient/test/SybaseTest.cs b/mcs/class/Mono.Data.SybaseClient/test/SybaseTest.cs index 9edf13cba58..a3bb709db7b 100644 --- a/mcs/class/Mono.Data.SybaseClient/test/SybaseTest.cs +++ b/mcs/class/Mono.Data.SybaseClient/test/SybaseTest.cs @@ -444,55 +444,55 @@ namespace Test.Mono.Data.SybaseClient // used internally by ReadData() to read each result set static void ReadResult(IDataReader rdr, DataTable dt) - {
- // number of columns in the table
- Console.WriteLine(" Total Columns: " +
- dt.Rows.Count);
-
- // display the schema
- foreach (DataRow schemaRow in dt.Rows) {
- foreach (DataColumn schemaCol in dt.Columns)
- Console.WriteLine(schemaCol.ColumnName +
- " = " +
- schemaRow[schemaCol]);
- Console.WriteLine();
- }
-
- int nRows = 0;
- int c = 0;
- string output, metadataValue, dataValue;
- // Read and display the rows
- Console.WriteLine("Gonna do a Read() now...");
- while(rdr.Read()) {
- Console.WriteLine(" Row " + nRows + ": ");
-
- for(c = 0; c < rdr.FieldCount; c++) {
- // column meta data
- DataRow dr = dt.Rows[c];
- metadataValue =
- " Col " +
- c + ": " +
- dr["ColumnName"];
-
- // column data
- if (rdr.IsDBNull(c) == true)
- dataValue = " is NULL";
+ { + // number of columns in the table + Console.WriteLine(" Total Columns: " + + dt.Rows.Count); + + // display the schema + foreach (DataRow schemaRow in dt.Rows) { + foreach (DataColumn schemaCol in dt.Columns) + Console.WriteLine(schemaCol.ColumnName + + " = " + + schemaRow[schemaCol]); + Console.WriteLine(); + } + + int nRows = 0; + int c = 0; + string output, metadataValue, dataValue; + // Read and display the rows + Console.WriteLine("Gonna do a Read() now..."); + while(rdr.Read()) { + Console.WriteLine(" Row " + nRows + ": "); + + for(c = 0; c < rdr.FieldCount; c++) { + // column meta data + DataRow dr = dt.Rows[c]; + metadataValue = + " Col " + + c + ": " + + dr["ColumnName"]; + + // column data + if (rdr.IsDBNull(c) == true) + dataValue = " is NULL"; else if ((Type) dr["DataType"] == typeof (byte[])) dataValue = ": 0x" + BitConverter.ToString ((byte[]) rdr.GetValue (c)).Replace ("-", "").ToLower (); - else
- dataValue =
- ": " +
- rdr.GetValue(c);
-
- // display column meta data and data
- output = metadataValue + dataValue;
- Console.WriteLine(output);
- }
- nRows++;
- }
- Console.WriteLine(" Total Rows Retrieved: " +
+ else + dataValue = + ": " + + rdr.GetValue(c); + + // display column meta data and data + output = metadataValue + dataValue; + Console.WriteLine(output); + } + nRows++; + } + Console.WriteLine(" Total Rows Retrieved: " + nRows); } @@ -505,36 +505,36 @@ namespace Test.Mono.Data.SybaseClient Console.WriteLine("IDataReader has a Null Reference."); } else { - do {
- DataTable dt = rdr.GetSchemaTable();
- if(rdr.RecordsAffected != -1) {
- // Results for
- // SQL INSERT, UPDATE, DELETE Commands
- // have RecordsAffected >= 0
- Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- }
- else if(dt == null)
- // Results for
- // SQL Commands not INSERT, UPDATE, nor DELETE
- // have RecordsAffected == -1
- // and GetSchemaTable() returns a null reference
- Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- else {
- // Results for
- // SQL SELECT Queries
- // have RecordsAffected = -1
- // and GetSchemaTable() returns a reference to a DataTable
- Console.WriteLine("Result is from a SELECT SQL Query. Records Affected: " + rdr.RecordsAffected);
-
- results++;
- Console.WriteLine("Result Set " + results + "...");
-
- ReadResult(rdr, dt);
- }
-
- } while(rdr.NextResult());
- Console.WriteLine("Total Result sets: " + results);
-
+ do { + DataTable dt = rdr.GetSchemaTable(); + if(rdr.RecordsAffected != -1) { + // Results for + // SQL INSERT, UPDATE, DELETE Commands + // have RecordsAffected >= 0 + Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected); + } + else if(dt == null) + // Results for + // SQL Commands not INSERT, UPDATE, nor DELETE + // have RecordsAffected == -1 + // and GetSchemaTable() returns a null reference + Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected); + else { + // Results for + // SQL SELECT Queries + // have RecordsAffected = -1 + // and GetSchemaTable() returns a reference to a DataTable + Console.WriteLine("Result is from a SELECT SQL Query. Records Affected: " + rdr.RecordsAffected); + + results++; + Console.WriteLine("Result Set " + results + "..."); + + ReadResult(rdr, dt); + } + + } while(rdr.NextResult()); + Console.WriteLine("Total Result sets: " + results); + rdr.Close(); } } @@ -601,15 +601,15 @@ namespace Test.Mono.Data.SybaseClient Console.WriteLine("\t\tCall ExecuteReader with a SQL Command. (Is INSERT,UPDATE,DELETE)."); reader = SelectDataUsingInsertCommand(cnc); ReadData(reader); -
- // Call a Stored Procedure named Version()
- Console.WriteLine("\t\tCalling stored procedure sp_server_info()");
- object obj = CallStoredProcedure(cnc);
- Console.WriteLine("Result: " + obj);
-
- Console.WriteLine("Database Server Version: " +
- ((SybaseConnection)cnc).ServerVersion);
-
+ + // Call a Stored Procedure named Version() + Console.WriteLine("\t\tCalling stored procedure sp_server_info()"); + object obj = CallStoredProcedure(cnc); + Console.WriteLine("Result: " + obj); + + Console.WriteLine("Database Server Version: " + + ((SybaseConnection)cnc).ServerVersion); + /* Clean up */ Console.WriteLine ("Clean up..."); Console.WriteLine ("\t\tDrop table..."); @@ -621,13 +621,13 @@ namespace Test.Mono.Data.SybaseClient } } - [STAThread]
- static void Main(string[] args)
- {
- string connectionString = "";
-
- if(args.Length == 3 || args.Length == 4) {
- if(args.Length == 3) {
+ [STAThread] + static void Main(string[] args) + { + string connectionString = ""; + + if(args.Length == 3 || args.Length == 4) { + if(args.Length == 3) { connectionString = String.Format( "Server={0};" + "Database={1};" + @@ -647,11 +647,11 @@ namespace Test.Mono.Data.SybaseClient Console.WriteLine("Usage: mono SybaseTest.exe sql_server database user_id password"); return; } -
- SybaseConnection cnc = new SybaseConnection ();
- cnc.ConnectionString = connectionString;
-
- cnc.Open();
+ + SybaseConnection cnc = new SybaseConnection (); + cnc.ConnectionString = connectionString; + + cnc.Open(); DoSybaseTest(cnc); cnc.Close(); } diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs index 63905c42b92..95a62378c11 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs @@ -615,41 +615,41 @@ namespace Mono.Data.Tds.Protocol { return new Decimal (bits[0], bits[1], bits[2], !positive, scale); } - private object GetDecimalValueTds50 (byte precision, byte scale) {
- int[] bits = new int[4] {0,0,0,0};
-
- int len = (comm.GetByte() & 0xff);
- if (len == 0)
- return DBNull.Value;
-
- byte[] dec_bytes=comm.GetBytes(len,false);
-
- byte[] easy=new byte[4];
-
- bool positive = dec_bytes[0]==1;
-
- if (len > 17)
- throw new OverflowException ();
-
- for (int i = 1, index = 0; i < len && i < 16; i +=
- 4, index += 1) {
- for(int j=0; j<4; j++)
- if(i+j<len)
- easy[j]=dec_bytes[len-
- (i+j)];
- else
- easy[j]=0;
- if(!BitConverter.IsLittleEndian)
- easy=comm.Swap(easy);
- bits[index] = BitConverter.ToInt32(easy,0);
- }
- if (bits [3] != 0)
- return new TdsBigDecimal (precision,
- scale, positive, bits);
- else
- return new Decimal(bits[0], bits[1], bits
- [2], positive, scale);
-
+ private object GetDecimalValueTds50 (byte precision, byte scale) { + int[] bits = new int[4] {0,0,0,0}; + + int len = (comm.GetByte() & 0xff); + if (len == 0) + return DBNull.Value; + + byte[] dec_bytes=comm.GetBytes(len,false); + + byte[] easy=new byte[4]; + + bool positive = dec_bytes[0]==1; + + if (len > 17) + throw new OverflowException (); + + for (int i = 1, index = 0; i < len && i < 16; i += + 4, index += 1) { + for(int j=0; j<4; j++) + if(i+j<len) + easy[j]=dec_bytes[len- + (i+j)]; + else + easy[j]=0; + if(!BitConverter.IsLittleEndian) + easy=comm.Swap(easy); + bits[index] = BitConverter.ToInt32(easy,0); + } + if (bits [3] != 0) + return new TdsBigDecimal (precision, + scale, positive, bits); + else + return new Decimal(bits[0], bits[1], bits + [2], positive, scale); + } private object GetFloatValue (TdsColumnType columnType) diff --git a/mcs/class/Mono.Data.TdsClient/Mono.Data.TdsClient/TdsConnection.cs b/mcs/class/Mono.Data.TdsClient/Mono.Data.TdsClient/TdsConnection.cs index 4a272db8fbf..d316de4328c 100644 --- a/mcs/class/Mono.Data.TdsClient/Mono.Data.TdsClient/TdsConnection.cs +++ b/mcs/class/Mono.Data.TdsClient/Mono.Data.TdsClient/TdsConnection.cs @@ -351,9 +351,9 @@ namespace Mono.Data.TdsClient { { theServerName = ""; thePort = 1433; // default TCP port for SQL Server -
- int idx = 0;
- if ((idx = theDataSource.IndexOf (",")) > -1) {
+ + int idx = 0; + if ((idx = theDataSource.IndexOf (",")) > -1) { theServerName = theDataSource.Substring (0, idx); string p = theDataSource.Substring (idx + 1); thePort = Int32.Parse (p); diff --git a/mcs/class/Mono.Data/DataTools.cs b/mcs/class/Mono.Data/DataTools.cs index c767d7fde67..6322fc08878 100644 --- a/mcs/class/Mono.Data/DataTools.cs +++ b/mcs/class/Mono.Data/DataTools.cs @@ -8,27 +8,27 @@ // Copyright (C) Brian Ritchie, 2002
//
//
- -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Data;
diff --git a/mcs/class/Mono.Data/Provider.cs b/mcs/class/Mono.Data/Provider.cs index 6d1d11a015b..3420481da62 100644 --- a/mcs/class/Mono.Data/Provider.cs +++ b/mcs/class/Mono.Data/Provider.cs @@ -8,27 +8,27 @@ // Copyright (C) Brian Ritchie, 2002
//
//
- -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Data;
using System.Reflection;
diff --git a/mcs/class/Mono.Data/ProviderCollection.cs b/mcs/class/Mono.Data/ProviderCollection.cs index 4edc9bee74a..c82b36e4495 100644 --- a/mcs/class/Mono.Data/ProviderCollection.cs +++ b/mcs/class/Mono.Data/ProviderCollection.cs @@ -8,27 +8,27 @@ // Copyright (C) Brian Ritchie, 2002
//
//
- -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
namespace Mono.Data
{
using System;
diff --git a/mcs/class/Mono.Data/ProviderFactory.cs b/mcs/class/Mono.Data/ProviderFactory.cs index e249a9bc0c5..e04bb85eee2 100644 --- a/mcs/class/Mono.Data/ProviderFactory.cs +++ b/mcs/class/Mono.Data/ProviderFactory.cs @@ -8,27 +8,27 @@ // Copyright (C) Brian Ritchie, 2002
//
//
- -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Data;
using System.Reflection;
diff --git a/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionDetails.cs b/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionDetails.cs index 5b8ef54774f..7946eb64c35 100644 --- a/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionDetails.cs +++ b/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionDetails.cs @@ -109,7 +109,7 @@ namespace Mono.GetOptions if (parsingMode == OptionsParsingMode.Windows) { shortPrefix = "/"; longPrefix = "/"; - }
+ } if (this.ShortForm != string.Empty) return shortPrefix+this.ShortForm; else diff --git a/mcs/class/Mono.PEToolkit/BadImageException.cs b/mcs/class/Mono.PEToolkit/BadImageException.cs index 1a28055fe1b..48a85d5b246 100644 --- a/mcs/class/Mono.PEToolkit/BadImageException.cs +++ b/mcs/class/Mono.PEToolkit/BadImageException.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/COFFHeader.cs b/mcs/class/Mono.PEToolkit/COFFHeader.cs index 7d6b7db516a..8f8ef922302 100644 --- a/mcs/class/Mono.PEToolkit/COFFHeader.cs +++ b/mcs/class/Mono.PEToolkit/COFFHeader.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/Characteristics.cs b/mcs/class/Mono.PEToolkit/Characteristics.cs index 523a4c22a0c..b2865724b8d 100644 --- a/mcs/class/Mono.PEToolkit/Characteristics.cs +++ b/mcs/class/Mono.PEToolkit/Characteristics.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/CheckSum.cs b/mcs/class/Mono.PEToolkit/CheckSum.cs index 5e1b22b6248..b842eaa63f1 100644 --- a/mcs/class/Mono.PEToolkit/CheckSum.cs +++ b/mcs/class/Mono.PEToolkit/CheckSum.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/CorHeader.cs b/mcs/class/Mono.PEToolkit/CorHeader.cs index 82ee82ce203..2f76368b6f2 100644 --- a/mcs/class/Mono.PEToolkit/CorHeader.cs +++ b/mcs/class/Mono.PEToolkit/CorHeader.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/DOSHeader.cs b/mcs/class/Mono.PEToolkit/DOSHeader.cs index b97f5430804..6c57bdab672 100644 --- a/mcs/class/Mono.PEToolkit/DOSHeader.cs +++ b/mcs/class/Mono.PEToolkit/DOSHeader.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/DataDir.cs b/mcs/class/Mono.PEToolkit/DataDir.cs index 79d254c933d..7c0b8b6922e 100644 --- a/mcs/class/Mono.PEToolkit/DataDir.cs +++ b/mcs/class/Mono.PEToolkit/DataDir.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/ExeSignature.cs b/mcs/class/Mono.PEToolkit/ExeSignature.cs index a35963530ef..8b9401920e5 100644 --- a/mcs/class/Mono.PEToolkit/ExeSignature.cs +++ b/mcs/class/Mono.PEToolkit/ExeSignature.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/Image.cs b/mcs/class/Mono.PEToolkit/Image.cs index bbe34fba801..f909b2b6b7b 100644 --- a/mcs/class/Mono.PEToolkit/Image.cs +++ b/mcs/class/Mono.PEToolkit/Image.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/LEBitConverter.cs b/mcs/class/Mono.PEToolkit/LEBitConverter.cs index 2814547df75..5efbe4e3893 100644 --- a/mcs/class/Mono.PEToolkit/LEBitConverter.cs +++ b/mcs/class/Mono.PEToolkit/LEBitConverter.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
// Auto-generated file - DO NOT EDIT!
// Please edit bitconverter.xsl if you want to make changes.
diff --git a/mcs/class/Mono.PEToolkit/MachineId.cs b/mcs/class/Mono.PEToolkit/MachineId.cs index e8a8deba375..8768aefe5de 100644 --- a/mcs/class/Mono.PEToolkit/MachineId.cs +++ b/mcs/class/Mono.PEToolkit/MachineId.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/PEHeader.cs b/mcs/class/Mono.PEToolkit/PEHeader.cs index 8a2f17f3fb8..3ff1e9becbc 100644 --- a/mcs/class/Mono.PEToolkit/PEHeader.cs +++ b/mcs/class/Mono.PEToolkit/PEHeader.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/PEUtils.cs b/mcs/class/Mono.PEToolkit/PEUtils.cs index 4f2e5485c90..a3673e0c72b 100644 --- a/mcs/class/Mono.PEToolkit/PEUtils.cs +++ b/mcs/class/Mono.PEToolkit/PEUtils.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/RVA.cs b/mcs/class/Mono.PEToolkit/RVA.cs index 49cc060e39b..c6960761c42 100644 --- a/mcs/class/Mono.PEToolkit/RVA.cs +++ b/mcs/class/Mono.PEToolkit/RVA.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/Section.cs b/mcs/class/Mono.PEToolkit/Section.cs index 688eae303d7..46ecf8ba435 100644 --- a/mcs/class/Mono.PEToolkit/Section.cs +++ b/mcs/class/Mono.PEToolkit/Section.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/SectionCharacteristics.cs b/mcs/class/Mono.PEToolkit/SectionCharacteristics.cs index e67889da95f..2dc57acf75c 100644 --- a/mcs/class/Mono.PEToolkit/SectionCharacteristics.cs +++ b/mcs/class/Mono.PEToolkit/SectionCharacteristics.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.PEToolkit/Subsystem.cs b/mcs/class/Mono.PEToolkit/Subsystem.cs index 55219dba6b3..ea9505249cd 100644 --- a/mcs/class/Mono.PEToolkit/Subsystem.cs +++ b/mcs/class/Mono.PEToolkit/Subsystem.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
/*
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
*/
diff --git a/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeFormatter.cs b/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeFormatter.cs index 71ede754315..d386bf0b5e7 100644 --- a/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeFormatter.cs +++ b/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeFormatter.cs @@ -294,10 +294,10 @@ namespace Mono.Security.Authenticode { // someday I may be sure enough to move this into DEBUG ;-) File.Copy (fileName, fileName + ".bak", true); - using (FileStream fs = File.Open (fileName, FileMode.Create, FileAccess.Write)) {
- int filesize = (dirSecurityOffset == 0) ? file.Length : dirSecurityOffset;
- // IMAGE_DIRECTORY_ENTRY_SECURITY (offset, size)
- byte[] data = BitConverterLE.GetBytes (filesize);
+ using (FileStream fs = File.Open (fileName, FileMode.Create, FileAccess.Write)) { + int filesize = (dirSecurityOffset == 0) ? file.Length : dirSecurityOffset; + // IMAGE_DIRECTORY_ENTRY_SECURITY (offset, size) + byte[] data = BitConverterLE.GetBytes (filesize); file [peOffset + 152] = data [0]; file [peOffset + 153] = data [1]; file [peOffset + 154] = data [2]; @@ -312,8 +312,8 @@ namespace Mono.Security.Authenticode { file [peOffset + 156] = data [0]; file [peOffset + 157] = data [1]; file [peOffset + 158] = data [2]; - file [peOffset + 159] = data [3];
- fs.Write (file, 0, filesize);
+ file [peOffset + 159] = data [3]; + fs.Write (file, 0, filesize); fs.Write (data, 0, data.Length); // length (again) data = BitConverterLE.GetBytes (0x00020200); // magic fs.Write (data, 0, data.Length); diff --git a/mcs/class/Mono.Security/Mono.Security.Cryptography/Null.cs b/mcs/class/Mono.Security/Mono.Security.Cryptography/Null.cs index 574f4aff819..40a215cfa8a 100644 --- a/mcs/class/Mono.Security/Mono.Security.Cryptography/Null.cs +++ b/mcs/class/Mono.Security/Mono.Security.Cryptography/Null.cs @@ -39,29 +39,29 @@ using System.Security.Cryptography; namespace Mono.Security.Cryptography { - public abstract class Null : SymmetricAlgorithm {
-
- public static new Null Create ()
- {
- return Create ("Mono.Security.Cryptography.Null");
- }
-
- public static new Null Create (string algName)
- {
- return (Null) CryptoConfig.CreateFromName (algName);
- }
-
- public Null ()
- {
- KeySizeValue = 128;
- BlockSizeValue = 128;
- FeedbackSizeValue = 128;
-
- LegalKeySizesValue = new KeySizes [1];
- LegalKeySizesValue [0] = new KeySizes (0, 1024, 8);
-
- LegalBlockSizesValue = new KeySizes [1];
- LegalBlockSizesValue [0] = new KeySizes (0, 1024, 8);
+ public abstract class Null : SymmetricAlgorithm { + + public static new Null Create () + { + return Create ("Mono.Security.Cryptography.Null"); + } + + public static new Null Create (string algName) + { + return (Null) CryptoConfig.CreateFromName (algName); + } + + public Null () + { + KeySizeValue = 128; + BlockSizeValue = 128; + FeedbackSizeValue = 128; + + LegalKeySizesValue = new KeySizes [1]; + LegalKeySizesValue [0] = new KeySizes (0, 1024, 8); + + LegalBlockSizesValue = new KeySizes [1]; + LegalBlockSizesValue [0] = new KeySizes (0, 1024, 8); } } diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs index f87be7eb819..793684e9bf0 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; using System.Security.Cryptography.X509Certificates; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs index 0c3dfbb4de4..66939ce488c 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; using System.Security.Cryptography.X509Certificates; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs index bfef2ee8b37..4e7929f1d2d 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; using System.Security.Cryptography; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs index 15679da9ade..b2692bebc69 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; using System.Security.Cryptography; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs index cb4a1721150..9b66dbb11be 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; using System.IO; using System.Security.Cryptography; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs index 1733bd8aa7f..cedb565c923 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; using System.Text; using Mono.Security; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs index 29575c4f10f..a9238061eb0 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; using System.Security.Cryptography; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs index 63cd194c0d2..0023d603559 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; namespace Mono.Security.Protocol.Tls.Handshake.Client diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs index ecea2b10244..7a0e61fb5da 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; namespace Mono.Security.Protocol.Tls.Handshake.Client diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs index bc48e1de601..d8778fc1611 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; using System.Security.Cryptography; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs index 7e35a68fbf1..8bff7127910 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; namespace Mono.Security.Protocol.Tls.Handshake diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs index 76a673cbdeb..0ff0882bab7 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; namespace Mono.Security.Protocol.Tls.Handshake diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs index bafef3f8795..a0165a3c619 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs @@ -20,8 +20,8 @@ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
+// + using System; namespace Mono.Security.Protocol.Tls.Handshake diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs index 2946013a517..8240e82a27f 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs @@ -21,7 +21,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -
+ using System; using System.Collections; using System.Globalization; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs index f03cd18a959..8c8f6ee7d96 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs @@ -130,9 +130,9 @@ namespace Mono.Security.Protocol.Tls { CipherSuiteCollection scs = new CipherSuiteCollection(SecurityProtocolType.Ssl3); - // Supported ciphers
- scs.Add((0x00 << 0x08) | 0x35, "SSL_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16);
- scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8);
+ // Supported ciphers + scs.Add((0x00 << 0x08) | 0x35, "SSL_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); + scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs index 1783057c74e..0cd3f075408 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs @@ -81,7 +81,7 @@ namespace Mono.Security.Protocol.Tls "The session is finished and it's no longer valid."); } - // Try to read the Record Content Type
+ // Try to read the Record Content Type int type = record.ReadByte (); if (type == -1) { @@ -92,10 +92,10 @@ namespace Mono.Security.Protocol.Tls this.context.LastHandshakeMsg = HandshakeType.ClientHello; ContentType contentType = (ContentType)type; - byte[] buffer = this.ReadRecordBuffer(type, record);
+ byte[] buffer = this.ReadRecordBuffer(type, record); if (buffer == null) { - // record incomplete (at the moment)
+ // record incomplete (at the moment) return null; } @@ -107,7 +107,7 @@ namespace Mono.Security.Protocol.Tls { if (this.context.IsActual && contentType != ContentType.ChangeCipherSpec) { - buffer = this.decryptRecordFragment(contentType, buffer);
+ buffer = this.decryptRecordFragment(contentType, buffer); DebugHelper.WriteLine("Decrypted record data", buffer); } } @@ -116,12 +116,12 @@ namespace Mono.Security.Protocol.Tls switch (contentType) { case ContentType.Alert: - this.ProcessAlert((AlertLevel)buffer [0], (AlertDescription)buffer [1]);
+ this.ProcessAlert((AlertLevel)buffer [0], (AlertDescription)buffer [1]); if (record.CanSeek) { - // don't reprocess that memory block
+ // don't reprocess that memory block record.SetLength (0); - }
+ } buffer = null; break; @@ -132,7 +132,7 @@ namespace Mono.Security.Protocol.Tls case ContentType.ApplicationData: break; - case ContentType.Handshake:
+ case ContentType.Handshake: TlsStream message = new TlsStream (buffer); while (!message.EOF) { @@ -160,8 +160,8 @@ namespace Mono.Security.Protocol.Tls } return buffer; - }
-
+ } + private byte[] ReadRecordBuffer (int contentType, Stream record) { switch (contentType) @@ -176,18 +176,18 @@ namespace Mono.Security.Protocol.Tls } return this.ReadStandardRecordBuffer(record); } - }
-
+ } + private byte[] ReadClientHelloV2 (Stream record) - {
- int msgLength = record.ReadByte ();
- // process further only if the whole record is available
+ { + int msgLength = record.ReadByte (); + // process further only if the whole record is available if (record.CanSeek && (msgLength + 1 > record.Length)) { return null; } -
- byte[] message = new byte[msgLength];
+ + byte[] message = new byte[msgLength]; record.Read (message, 0, msgLength); int msgType = message [0]; @@ -230,26 +230,26 @@ namespace Mono.Security.Protocol.Tls // Select the Cipher suite this.ProcessCipherSpecV2Buffer(this.Context.SecurityProtocol, cipherSpecV2); - // Updated the Client Random
- this.context.ClientRandom = new byte [32]; // Always 32
- // 1. if challenge is bigger than 32 bytes only use the last 32 bytes
- // 2. right justify (0) challenge in ClientRandom if less than 32
- Buffer.BlockCopy (challenge, challenge.Length - length, this.context.ClientRandom, 32 - length, length);
-
+ // Updated the Client Random + this.context.ClientRandom = new byte [32]; // Always 32 + // 1. if challenge is bigger than 32 bytes only use the last 32 bytes + // 2. right justify (0) challenge in ClientRandom if less than 32 + Buffer.BlockCopy (challenge, challenge.Length - length, this.context.ClientRandom, 32 - length, length); + // Set this.context.LastHandshakeMsg = HandshakeType.ClientHello; this.context.ProtocolNegotiated = true; return message; - }
-
+ } + private byte[] ReadStandardRecordBuffer (Stream record) { short protocol = this.ReadShort(record); short length = this.ReadShort(record); - // process further only if the whole record is available
- // note: the first 5 bytes aren't part of the length
+ // process further only if the whole record is available + // note: the first 5 bytes aren't part of the length if (record.CanSeek && (length + 5 > record.Length)) { return null; diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs index c18d10a9246..0fd5c89cb4e 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs @@ -408,7 +408,7 @@ namespace Mono.Security.Protocol.Tls int count, AsyncCallback callback, object state) - {
+ { this.checkDisposed (); if (buffer == null) @@ -461,25 +461,25 @@ namespace Mono.Security.Protocol.Tls if (!this.context.ConnectionEnd) { - if ((this.inputBuffer.Length == this.inputBuffer.Position) && (count > 0))
+ if ((this.inputBuffer.Length == this.inputBuffer.Position) && (count > 0)) { - // bigger than max record length for SSL/TLS
- byte[] recbuf = new byte[16384];
+ // bigger than max record length for SSL/TLS + byte[] recbuf = new byte[16384]; // this will read data from the network until we have (at least) one - // record to send back to the caller
+ // record to send back to the caller this.innerStream.BeginRead (recbuf, 0, recbuf.Length, - new AsyncCallback (NetworkReadCallback), recbuf);
-
- if (!recordEvent.WaitOne ()) // 300000, false)) // 5 minutes
+ new AsyncCallback (NetworkReadCallback), recbuf); + + if (!recordEvent.WaitOne ()) // 300000, false)) // 5 minutes { // FAILSAFE DebugHelper.WriteLine ("TIMEOUT length {0}, position {1}, count {2} - {3}\n{4}", this.inputBuffer.Length, this.inputBuffer.Position, count, GetHashCode (), - Environment.StackTrace);
- throw new TlsException (AlertDescription.InternalError);
+ Environment.StackTrace); + throw new TlsException (AlertDescription.InternalError); } - }
+ } } // return the record(s) to the caller @@ -501,103 +501,103 @@ namespace Mono.Security.Protocol.Tls } return asyncResult; - }
-
- private ManualResetEvent recordEvent = new ManualResetEvent (false);
- private MemoryStream recordStream = new MemoryStream ();
+ } + + private ManualResetEvent recordEvent = new ManualResetEvent (false); + private MemoryStream recordStream = new MemoryStream (); // read encrypted data until we have enough to decrypt (at least) one - // record and return are the records (may be more than one) we have
- private void NetworkReadCallback (IAsyncResult result)
+ // record and return are the records (may be more than one) we have + private void NetworkReadCallback (IAsyncResult result) { if (this.disposed) { - recordEvent.Set ();
+ recordEvent.Set (); return; - }
+ } - byte[] recbuf = (byte[])result.AsyncState;
+ byte[] recbuf = (byte[])result.AsyncState; int n = innerStream.EndRead (result); - if (n > 0)
- {
- // add the just received data to the waiting data
- recordStream.Write (recbuf, 0, n);
- }
-
- bool dataToReturn = false;
+ if (n > 0) + { + // add the just received data to the waiting data + recordStream.Write (recbuf, 0, n); + } + + bool dataToReturn = false; long pos = recordStream.Position; -
- recordStream.Position = 0;
+ + recordStream.Position = 0; byte[] record = null; - // don't try to decode record unless we have at least 5 bytes
- // i.e. type (1), protocol (2) and length (2)
- if (recordStream.Length >= 5)
- {
- record = this.protocol.ReceiveRecord (recordStream);
- }
+ // don't try to decode record unless we have at least 5 bytes + // i.e. type (1), protocol (2) and length (2) + if (recordStream.Length >= 5) + { + record = this.protocol.ReceiveRecord (recordStream); + } // a record of 0 length is valid (and there may be more record after it) - while (record != null)
- {
- // we probably received more stuff after the record, and we must keep it!
- long remainder = recordStream.Length - recordStream.Position;
- byte[] outofrecord = null;
- if (remainder > 0)
- {
- outofrecord = new byte[remainder];
- recordStream.Read (outofrecord, 0, outofrecord.Length);
- }
-
- long position = this.inputBuffer.Position;
+ while (record != null) + { + // we probably received more stuff after the record, and we must keep it! + long remainder = recordStream.Length - recordStream.Position; + byte[] outofrecord = null; + if (remainder > 0) + { + outofrecord = new byte[remainder]; + recordStream.Read (outofrecord, 0, outofrecord.Length); + } + + long position = this.inputBuffer.Position; if (record.Length > 0) - {
- // Write new data to the inputBuffer
- this.inputBuffer.Seek (0, SeekOrigin.End);
- this.inputBuffer.Write (record, 0, record.Length);
-
- // Restore buffer position
+ { + // Write new data to the inputBuffer + this.inputBuffer.Seek (0, SeekOrigin.End); + this.inputBuffer.Write (record, 0, record.Length); + + // Restore buffer position this.inputBuffer.Seek (position, SeekOrigin.Begin); dataToReturn = true; - }
-
- recordStream.SetLength (0);
- record = null;
-
- if (remainder > 0)
- {
- recordStream.Write (outofrecord, 0, outofrecord.Length);
- // type (1), protocol (2) and length (2)
- if (recordStream.Length >= 5)
- {
- // try to see if another record is available
- recordStream.Position = 0;
- record = this.protocol.ReceiveRecord (recordStream);
- if (record == null)
- pos = recordStream.Length;
- }
- else
- pos = remainder;
- }
- else
- pos = 0;
- }
- - if (!dataToReturn && (n > 0))
- { - // there is no record to return to caller and (possibly) more data waiting
- // so continue reading from network (and appending to stream)
- recordStream.Position = recordStream.Length;
+ } + + recordStream.SetLength (0); + record = null; + + if (remainder > 0) + { + recordStream.Write (outofrecord, 0, outofrecord.Length); + // type (1), protocol (2) and length (2) + if (recordStream.Length >= 5) + { + // try to see if another record is available + recordStream.Position = 0; + record = this.protocol.ReceiveRecord (recordStream); + if (record == null) + pos = recordStream.Length; + } + else + pos = remainder; + } + else + pos = 0; + } + + if (!dataToReturn && (n > 0)) + { + // there is no record to return to caller and (possibly) more data waiting + // so continue reading from network (and appending to stream) + recordStream.Position = recordStream.Length; this.innerStream.BeginRead (recbuf, 0, recbuf.Length, - new AsyncCallback (NetworkReadCallback), recbuf);
- }
- else
+ new AsyncCallback (NetworkReadCallback), recbuf); + } + else { // we have record(s) to return -or- no more available to read from network - // reset position for further reading
- recordStream.Position = pos;
- recordEvent.Set ();
- }
+ // reset position for further reading + recordStream.Position = pos; + recordEvent.Set (); + } } public override IAsyncResult BeginWrite( @@ -678,7 +678,7 @@ namespace Mono.Security.Protocol.Tls if (asyncResult == null) { throw new ArgumentNullException("asyncResult is null or was not obtained by calling BeginRead."); - }
+ } recordEvent.Reset (); return this.rd.EndInvoke (asyncResult); @@ -803,7 +803,7 @@ namespace Mono.Security.Protocol.Tls // Read server response while (this.context.LastHandshakeMsg != HandshakeType.ServerHelloDone) { - // Read next record
+ // Read next record this.protocol.ReceiveRecord (this.innerStream); } @@ -846,7 +846,7 @@ namespace Mono.Security.Protocol.Tls { // If all goes well this will process messages: // Change Cipher Spec - // Server finished
+ // Server finished this.protocol.ReceiveRecord (this.innerStream); } diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs index cd24080a64c..a4eafd385c9 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs @@ -649,7 +649,7 @@ namespace Mono.Security.Protocol.Tls // Set handshake state this.context.HandshakeState = HandshakeState.Started; - // Receive Client Hello message
+ // Receive Client Hello message this.protocol.ReceiveRecord (this.innerStream); // If received message is not an ClientHello send a @@ -685,7 +685,7 @@ namespace Mono.Security.Protocol.Tls // Receive client response, until the Client Finished message // is received while (this.context.LastHandshakeMsg != HandshakeType.Finished) - {
+ { this.protocol.ReceiveRecord (this.innerStream); } diff --git a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs index 028bc7a085a..50a5145631c 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs @@ -83,32 +83,32 @@ namespace Mono.Security.X509.Extensions { DistributionPoint = dp; Reasons = reasons; CRLIssuer = issuer; - }
-
- public DP (ASN1 dp)
- {
- for (int i = 0; i < dp.Count; i++) {
- ASN1 el = dp[i];
- switch (el.Tag) {
- case 0xA0: // DistributionPointName OPTIONAL
- for (int j = 0; j < el.Count; j++) {
- ASN1 dpn = el [j];
- if (dpn.Tag == 0xA0) {
- DistributionPoint = new GeneralNames (dpn).ToString ();
- }
- }
- break;
- case 0xA1: // ReasonFlags OPTIONAL
- break;
- case 0xA2: // RelativeDistinguishedName
- break;
- }
- }
- }
- }
-
- [Flags]
- public enum ReasonFlags
+ } + + public DP (ASN1 dp) + { + for (int i = 0; i < dp.Count; i++) { + ASN1 el = dp[i]; + switch (el.Tag) { + case 0xA0: // DistributionPointName OPTIONAL + for (int j = 0; j < el.Count; j++) { + ASN1 dpn = el [j]; + if (dpn.Tag == 0xA0) { + DistributionPoint = new GeneralNames (dpn).ToString (); + } + } + break; + case 0xA1: // ReasonFlags OPTIONAL + break; + case 0xA2: // RelativeDistinguishedName + break; + } + } + } + } + + [Flags] + public enum ReasonFlags { Unused = 0, KeyCompromise = 1, @@ -157,7 +157,7 @@ namespace Mono.Security.X509.Extensions { public override string ToString () { - StringBuilder sb = new StringBuilder ();
+ StringBuilder sb = new StringBuilder (); int i = 1; foreach (DP dp in dps) { sb.Append ("["); @@ -166,10 +166,10 @@ namespace Mono.Security.X509.Extensions { sb.Append (Environment.NewLine); sb.Append ("\tDistribution Point Name:"); sb.Append ("\t\tFull Name:"); - sb.Append (Environment.NewLine);
- sb.Append ("\t\t\t");
- sb.Append (dp.DistributionPoint);
- sb.Append (Environment.NewLine);
+ sb.Append (Environment.NewLine); + sb.Append ("\t\t\t"); + sb.Append (dp.DistributionPoint); + sb.Append (Environment.NewLine); } return sb.ToString (); } diff --git a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs index 4137ef132bb..aa3df697955 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs @@ -4,8 +4,8 @@ // Author: // Sebastien Pouliot <sebastien@ximian.com> // -// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// (C) 2003 Motus Technologies Inc. (http://www.motus.com) +// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -74,7 +74,7 @@ namespace Mono.Security.X509.Extensions { public SubjectAltNameExtension () { - extnOid = "2.5.29.17";
+ extnOid = "2.5.29.17"; _names = new GeneralNames (); } @@ -92,7 +92,7 @@ namespace Mono.Security.X509.Extensions { { ASN1 sequence = new ASN1 (extnValue.Value); if (sequence.Tag != 0x30) - throw new ArgumentException ("Invalid SubjectAltName extension");
+ throw new ArgumentException ("Invalid SubjectAltName extension"); _names = new GeneralNames (sequence); } @@ -100,21 +100,21 @@ namespace Mono.Security.X509.Extensions { get { return "Subject Alternative Name"; } } - public string[] RFC822 {
+ public string[] RFC822 { get { return _names.RFC822; } } - public string[] DNSNames {
+ public string[] DNSNames { get { return _names.DNSNames; } } // Incomplete support - public string[] IPAddresses {
+ public string[] IPAddresses { get { return _names.IPAddresses; } } public override string ToString () - {
+ { return _names.ToString (); } } diff --git a/mcs/class/Mono.Security/Mono.Security.X509/X501Name.cs b/mcs/class/Mono.Security/Mono.Security.X509/X501Name.cs index 7dd5c1a9f89..3e46027d8b6 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509/X501Name.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509/X501Name.cs @@ -78,70 +78,70 @@ namespace Mono.Security.X509 { StringBuilder sb = new StringBuilder (); for (int i = 0; i < seq.Count; i++) { ASN1 entry = seq [i]; - // multiple entries are valid
- for (int k = 0; k < entry.Count; k++) {
- ASN1 pair = entry [k];
- ASN1 s = pair [1];
- if (s == null)
- continue;
-
- ASN1 poid = pair [0];
- if (poid == null)
- continue;
-
- if (poid.CompareValue (countryName))
- sb.Append ("C=");
- else if (poid.CompareValue (organizationName))
- sb.Append ("O=");
- else if (poid.CompareValue (organizationalUnitName))
- sb.Append ("OU=");
- else if (poid.CompareValue (commonName))
- sb.Append ("CN=");
- else if (poid.CompareValue (localityName))
- sb.Append ("L=");
- else if (poid.CompareValue (stateOrProvinceName))
- sb.Append ("S="); // NOTE: RFC2253 uses ST=
- else if (poid.CompareValue (streetAddress))
- sb.Append ("STREET=");
- else if (poid.CompareValue (domainComponent))
- sb.Append ("DC=");
- else if (poid.CompareValue (userid))
- sb.Append ("UID=");
- else if (poid.CompareValue (email))
- sb.Append ("E="); // NOTE: Not part of RFC2253
- else {
- // unknown OID
- sb.Append ("OID."); // NOTE: Not present as RFC2253
- sb.Append (ASN1Convert.ToOid (poid));
- sb.Append ("=");
- }
-
- string sValue = null;
- // 16bits or 8bits string ? TODO not complete (+special chars!)
- if (s.Tag == 0x1E) {
- // BMPSTRING
- StringBuilder sb2 = new StringBuilder ();
- for (int j = 1; j < s.Value.Length; j += 2)
- sb2.Append ((char)s.Value[j]);
- sValue = sb2.ToString ();
- } else {
- sValue = System.Text.Encoding.UTF8.GetString (s.Value);
- // in some cases we must quote (") the value
- // Note: this doesn't seems to conform to RFC2253
- char[] specials = { ',', '+', '"', '\\', '<', '>', ';' };
- if (sValue.IndexOfAny (specials, 0, sValue.Length) > 0)
- sValue = "\"" + sValue + "\"";
- else if (sValue.StartsWith (" "))
- sValue = "\"" + sValue + "\"";
- else if (sValue.EndsWith (" "))
- sValue = "\"" + sValue + "\"";
- }
-
- sb.Append (sValue);
-
- // separator (not on last iteration)
- if (k < entry.Count - 1)
- sb.Append (", ");
+ // multiple entries are valid + for (int k = 0; k < entry.Count; k++) { + ASN1 pair = entry [k]; + ASN1 s = pair [1]; + if (s == null) + continue; + + ASN1 poid = pair [0]; + if (poid == null) + continue; + + if (poid.CompareValue (countryName)) + sb.Append ("C="); + else if (poid.CompareValue (organizationName)) + sb.Append ("O="); + else if (poid.CompareValue (organizationalUnitName)) + sb.Append ("OU="); + else if (poid.CompareValue (commonName)) + sb.Append ("CN="); + else if (poid.CompareValue (localityName)) + sb.Append ("L="); + else if (poid.CompareValue (stateOrProvinceName)) + sb.Append ("S="); // NOTE: RFC2253 uses ST= + else if (poid.CompareValue (streetAddress)) + sb.Append ("STREET="); + else if (poid.CompareValue (domainComponent)) + sb.Append ("DC="); + else if (poid.CompareValue (userid)) + sb.Append ("UID="); + else if (poid.CompareValue (email)) + sb.Append ("E="); // NOTE: Not part of RFC2253 + else { + // unknown OID + sb.Append ("OID."); // NOTE: Not present as RFC2253 + sb.Append (ASN1Convert.ToOid (poid)); + sb.Append ("="); + } + + string sValue = null; + // 16bits or 8bits string ? TODO not complete (+special chars!) + if (s.Tag == 0x1E) { + // BMPSTRING + StringBuilder sb2 = new StringBuilder (); + for (int j = 1; j < s.Value.Length; j += 2) + sb2.Append ((char)s.Value[j]); + sValue = sb2.ToString (); + } else { + sValue = System.Text.Encoding.UTF8.GetString (s.Value); + // in some cases we must quote (") the value + // Note: this doesn't seems to conform to RFC2253 + char[] specials = { ',', '+', '"', '\\', '<', '>', ';' }; + if (sValue.IndexOfAny (specials, 0, sValue.Length) > 0) + sValue = "\"" + sValue + "\""; + else if (sValue.StartsWith (" ")) + sValue = "\"" + sValue + "\""; + else if (sValue.EndsWith (" ")) + sValue = "\"" + sValue + "\""; + } + + sb.Append (sValue); + + // separator (not on last iteration) + if (k < entry.Count - 1) + sb.Append (", "); } // separator (not on last iteration) diff --git a/mcs/class/Mono.Security/Test/Mono.Math/BigIntegerTest.cs b/mcs/class/Mono.Security/Test/Mono.Math/BigIntegerTest.cs index 3f20a034032..2be718d96dc 100644 --- a/mcs/class/Mono.Security/Test/Mono.Math/BigIntegerTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Math/BigIntegerTest.cs @@ -56,39 +56,39 @@ namespace MonoTests.Mono.Math { Assert.AreEqual (new BigInteger (0), bi, "Zero"); } - [Test]
- public void ModPow_0_Even ()
+ [Test] + public void ModPow_0_Even () { BigInteger x = new BigInteger (1); BigInteger y = new BigInteger (0); BigInteger z = x.ModPow (y, 1024); Assert.AreEqual ("1", z.ToString (), "1 pow 0 == 1"); - }
-
- [Test]
- public void ModPow_Big_Even ()
- {
- // http://gcc.gnu.org/ml/java/2001-01/msg00150.html
- BigInteger x = BigInteger.Parse ("222556259477882361118129720038750144464896096345697329917462180806109470940281821580712930114298080816996240075704780895407778416354633927929850543336844729388676722554712356733107888579404671103423966348754128720372408391573576775380281687780687492527566938517625657849775850241884119610654472761291507970934");
- BigInteger y = BigInteger.Parse ("110319153937683287453746757581772092163629769182044007837690319614087550020383807943886070460712008994638849038231331120616035703719955147238394349941968802357224177878230564379014395900786093465543114548034361805469457605783731382574787980771957640613447628351175959168798011343064123908688343944150028709336");
- BigInteger z = BigInteger.Parse ("211455809992703561445401788842734346323873054957006050135582190157359001703882707072169880651159563587522668850959539052488297197610540840476872693108381476249027986010074543599432542677282684917897250864056294311624311681558854158430574409491081490219256907243905496547813878640883064959346343865887971384185");
- BigInteger a = z.ModPow (x, y);
- Assert.AreEqual ("89040229313686098274750802637193802904787850353791629688385431482589769348345172944539658366893587456857347312314974124445695423885005533414559099801699612294235861570065774222911180890417009385455826560773741520297884850460324781620974467560905975577765401911117379967692495136423710471201230243826129276993", a.ToString ());
- }
-
- [Test]
- public void ModPow_2 ()
- {
- // #70169
- BigInteger b = new BigInteger (10);
- BigInteger m = new BigInteger (32);
- // after 40 we start loosing double precision and result will differ
- for (int i=1; i < 40; i++) {
- BigInteger e = new BigInteger (i);
- BigInteger r = e.ModPow (b, m);
- long expected = (long) myalias.Math.Pow (i, 10) % 32;
- Assert.AreEqual (expected.ToString (), r.ToString (), i.ToString ());
- }
- }
- }
+ } + + [Test] + public void ModPow_Big_Even () + { + // http://gcc.gnu.org/ml/java/2001-01/msg00150.html + BigInteger x = BigInteger.Parse ("222556259477882361118129720038750144464896096345697329917462180806109470940281821580712930114298080816996240075704780895407778416354633927929850543336844729388676722554712356733107888579404671103423966348754128720372408391573576775380281687780687492527566938517625657849775850241884119610654472761291507970934"); + BigInteger y = BigInteger.Parse ("110319153937683287453746757581772092163629769182044007837690319614087550020383807943886070460712008994638849038231331120616035703719955147238394349941968802357224177878230564379014395900786093465543114548034361805469457605783731382574787980771957640613447628351175959168798011343064123908688343944150028709336"); + BigInteger z = BigInteger.Parse ("211455809992703561445401788842734346323873054957006050135582190157359001703882707072169880651159563587522668850959539052488297197610540840476872693108381476249027986010074543599432542677282684917897250864056294311624311681558854158430574409491081490219256907243905496547813878640883064959346343865887971384185"); + BigInteger a = z.ModPow (x, y); + Assert.AreEqual ("89040229313686098274750802637193802904787850353791629688385431482589769348345172944539658366893587456857347312314974124445695423885005533414559099801699612294235861570065774222911180890417009385455826560773741520297884850460324781620974467560905975577765401911117379967692495136423710471201230243826129276993", a.ToString ()); + } + + [Test] + public void ModPow_2 () + { + // #70169 + BigInteger b = new BigInteger (10); + BigInteger m = new BigInteger (32); + // after 40 we start loosing double precision and result will differ + for (int i=1; i < 40; i++) { + BigInteger e = new BigInteger (i); + BigInteger r = e.ModPow (b, m); + long expected = (long) myalias.Math.Pow (i, 10) % 32; + Assert.AreEqual (expected.ToString (), r.ToString (), i.ToString ()); + } + } + } } diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2ManagedTest.cs b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2ManagedTest.cs index 4292350a174..5f6469abf1d 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2ManagedTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2ManagedTest.cs @@ -2,10 +2,10 @@ // MD2ManagedTest.cs - NUnit Test Cases for MD2 (RFC1319) // // Author: -// Sebastien Pouliot (sebastien@ximian.com)
+// Sebastien Pouliot (sebastien@ximian.com) // // (C) 2003 Motus Technologies Inc. (http://www.motus.com) -// (C) 2004 Novell (http://www.novell.com)
+// (C) 2004 Novell (http://www.novell.com) // using System; diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2Test.cs b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2Test.cs index 03eab010cee..9a618feafc4 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2Test.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD2Test.cs @@ -2,10 +2,10 @@ // MD2Test.cs - NUnit Test Cases for MD2 (RFC1319) // // Author: -// Sebastien Pouliot (sebastien@ximian.com)
+// Sebastien Pouliot (sebastien@ximian.com) // // (C) 2002 Motus Technologies Inc. (http://www.motus.com) -// (C) 2004 Novell (http://www.novell.com)
+// (C) 2004 Novell (http://www.novell.com) // using System; diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4ManagedTest.cs b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4ManagedTest.cs index 148af999ec2..ff0bcfb8056 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4ManagedTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4ManagedTest.cs @@ -2,10 +2,10 @@ // MD4ManagedTest.cs - NUnit Test Cases for MD4 (RFC1320) // // Author: -// Sebastien Pouliot (sebastien@ximian.com)
+// Sebastien Pouliot (sebastien@ximian.com) // // (C) 2003 Motus Technologies Inc. (http://www.motus.com) -// (C) 2004 Novell (http://www.novell.com)
+// (C) 2004 Novell (http://www.novell.com) // using System; diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4Test.cs b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4Test.cs index fe18e10ed52..e9fbd063b11 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4Test.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/MD4Test.cs @@ -2,10 +2,10 @@ // MD4Test.cs - NUnit Test Cases for MD4 (RFC1320) // // Author: -// Sebastien Pouliot (sebastien@ximian.com)
+// Sebastien Pouliot (sebastien@ximian.com) // // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com) -// (C) 2004 Novell (http://www.novell.com)
+// (C) 2004 Novell (http://www.novell.com) // using System; diff --git a/mcs/class/Mono.Security/Test/Mono.Security/ASN1ConvertTest.cs b/mcs/class/Mono.Security/Test/Mono.Security/ASN1ConvertTest.cs index f36f6e42467..1807efcd76a 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security/ASN1ConvertTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security/ASN1ConvertTest.cs @@ -7,8 +7,8 @@ // (C) 2004 Novell (http://www.novell.com)
//
-using System; -using System.Security.Cryptography; +using System;
+using System.Security.Cryptography;
using System.Text;
using Mono.Security;
@@ -28,7 +28,7 @@ namespace MonoTests.Mono.Security { DateTime actual = ASN1Convert.ToDateTime (dt);
AssertEquals ("DateTime", expected.ToString (), actual.ToString ());
}
- +
[Test]
public void ConvertDateTimeAfter2000 ()
{
@@ -42,29 +42,29 @@ namespace MonoTests.Mono.Security { [Test]
public void ConvertDateTimeAfter2050 ()
{
- DateTime expected = DateTime.UtcNow.AddYears (50); - ASN1 dt = ASN1Convert.FromDateTime (expected); + DateTime expected = DateTime.UtcNow.AddYears (50);
+ ASN1 dt = ASN1Convert.FromDateTime (expected);
AssertEquals ("GENERALIZEDTIME", 0x18, dt.Tag);
DateTime actual = ASN1Convert.ToDateTime (dt);
AssertEquals ("DateTime", expected.ToString (), actual.ToString ());
}
- -
[Test]
+
+ [Test]
public void ConvertDateTimeInvalidButExistingFormat ()
- { - string nosecs = "9912312359Z"; + {
+ string nosecs = "9912312359Z";
ASN1 dt = new ASN1 (0x18, Encoding.ASCII.GetBytes (nosecs));
DateTime actual = ASN1Convert.ToDateTime (dt);
AssertEquals ("DateTime", nosecs, actual.ToUniversalTime ().ToString ("yyMMddHHmm") + "Z");
}
- [Test] + [Test]
[ExpectedException (typeof (ArgumentNullException))]
- public void ConvertToDate_Null () - { - ASN1Convert.ToDateTime (null); + public void ConvertToDate_Null ()
+ {
+ ASN1Convert.ToDateTime (null);
}
- +
[Test]
public void ConvertInt32_Negative ()
{
@@ -82,7 +82,7 @@ namespace MonoTests.Mono.Security { Int32 actual = ASN1Convert.ToInt32 (integer);
AssertEquals ("Int32_Zero", expected, actual);
}
-
[Test]
+ [Test]
public void ConvertInt32_One ()
{
Int32 expected = 1;
@@ -99,39 +99,39 @@ namespace MonoTests.Mono.Security { Int32 actual = ASN1Convert.ToInt32 (integer);
AssertEquals ("Int32_Positive", expected, actual);
}
- -
[Test] +
+ [Test]
[ExpectedException (typeof (FormatException))]
public void ConvertToInt32_WrongTag ()
- { + {
ASN1 nul = new ASN1 (0x05);
Int32 actual = ASN1Convert.ToInt32 (nul);
- } - -
[Test] + }
+
+ [Test]
[ExpectedException (typeof (ArgumentNullException))]
- public void ConvertToInt32_Null () - { - ASN1Convert.ToInt32 (null); + public void ConvertToInt32_Null ()
+ {
+ ASN1Convert.ToInt32 (null);
}
- -
[Test] +
+ [Test]
[ExpectedException (typeof (ArgumentNullException))]
- public void ConvertFromUnsignedBigInteger_Null () - { - ASN1Convert.FromUnsignedBigInteger (null); - }
- - [Test] - public void ConvertFromUnsignedBigInteger () - { - byte[] big = new byte [16]; - big [0] = 1; - ASN1 bigint = ASN1Convert.FromUnsignedBigInteger (big); - // one byte added as 0x00 to be sure for sign - AssertEquals ("BigInteger", 17, bigint.Value.Length); - }
- + public void ConvertFromUnsignedBigInteger_Null ()
+ {
+ ASN1Convert.FromUnsignedBigInteger (null);
+ }
+
+ [Test]
+ public void ConvertFromUnsignedBigInteger ()
+ {
+ byte[] big = new byte [16];
+ big [0] = 1;
+ ASN1 bigint = ASN1Convert.FromUnsignedBigInteger (big);
+ // one byte added as 0x00 to be sure for sign
+ AssertEquals ("BigInteger", 17, bigint.Value.Length);
+ }
+
[Test]
public void ConvertOID ()
{
@@ -139,29 +139,29 @@ namespace MonoTests.Mono.Security { ASN1 oid = ASN1Convert.FromOid (expected);
string actual = ASN1Convert.ToOid (oid);
AssertEquals ("OID", expected, actual);
- } - + }
+
[Test]
public void ConvertOID_LargeX ()
{
- ASN1 asn = new ASN1 (0x06, new byte [] { 0xA8, 0x00, 0x00 }); + ASN1 asn = new ASN1 (0x06, new byte [] { 0xA8, 0x00, 0x00 });
string oid = ASN1Convert.ToOid (asn);
- AssertEquals ("ToOID", "2.88.0.0", oid); - AssertEquals ("FromOID", BitConverter.ToString (asn.GetBytes ()), + AssertEquals ("ToOID", "2.88.0.0", oid);
+ AssertEquals ("FromOID", BitConverter.ToString (asn.GetBytes ()),
BitConverter.ToString (ASN1Convert.FromOid (oid).GetBytes ()));
- } -
[Test] + }
+ [Test]
[ExpectedException (typeof (ArgumentNullException))]
- public void ConvertFromOid_Null () - { - ASN1Convert.FromOid (null); - } - -
[Test] + public void ConvertFromOid_Null ()
+ {
+ ASN1Convert.FromOid (null);
+ }
+
+ [Test]
[ExpectedException (typeof (ArgumentNullException))]
- public void ConvertToOid_Null () - { - ASN1Convert.ToOid (null); + public void ConvertToOid_Null ()
+ {
+ ASN1Convert.ToOid (null);
}
}
}
diff --git a/mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs b/mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs index ad518482797..9be50336b31 100644 --- a/mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs +++ b/mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs @@ -2,10 +2,10 @@ // StrongNameTest.cs - NUnit Test Cases for Strong Name Key File // // Author: -// Sebastien Pouliot (sebastien@ximian.com)
+// Sebastien Pouliot (sebastien@ximian.com) // // (C) 2003 Motus Technologies Inc. (http://www.motus.com) -// (C) 2004 Novell (http://www.novell.com)
+// (C) 2004 Novell (http://www.novell.com) // using System; diff --git a/mcs/class/Mono.Security/Test/tools/mutual/mutual.cs b/mcs/class/Mono.Security/Test/tools/mutual/mutual.cs index c67bf98415c..280345edb2c 100644 --- a/mcs/class/Mono.Security/Test/tools/mutual/mutual.cs +++ b/mcs/class/Mono.Security/Test/tools/mutual/mutual.cs @@ -2,90 +2,90 @@ using System; using System.IO;
using System.Net.Sockets;
using System.Security.Cryptography;
-using System.Security.Cryptography.X509Certificates; +using System.Security.Cryptography.X509Certificates;
-using Mono.Security.Protocol.Tls; +using Mono.Security.Protocol.Tls;
-class TestSslClientStream { - - static Mono.Security.X509.PKCS12 p12; +class TestSslClientStream {
+
+ static Mono.Security.X509.PKCS12 p12;
[STAThread]
static void Main(string[] args)
{
string host = "localhost";
if (args.Length > 0)
- host = args[0]; + host = args[0];
SecurityProtocolType protocol = SecurityProtocolType.Tls;
- if (args.Length > 1) { - switch (args [1].ToUpper ()) { - case "SSL": - protocol = SecurityProtocolType.Ssl3; - break; - } - } - + if (args.Length > 1) {
+ switch (args [1].ToUpper ()) {
+ case "SSL":
+ protocol = SecurityProtocolType.Ssl3;
+ break;
+ }
+ }
+
X509CertificateCollection certificates = null;
- if (args.Length > 2) { + if (args.Length > 2) {
string password = null;
- if (args.Length > 3) - password = args [3]; - + if (args.Length > 3)
+ password = args [3];
+
p12 = Mono.Security.X509.PKCS12.LoadFromFile(args [2], password);
- - certificates = new X509CertificateCollection (); +
+ certificates = new X509CertificateCollection ();
foreach (Mono.Security.X509.X509Certificate cert in p12.Certificates) {
certificates.Add(new X509Certificate(cert.RawData));
}
- } + }
TcpClient client = new TcpClient ();
client.Connect (host, 4433);
- +
SslClientStream ssl = new SslClientStream (client.GetStream(), host, false, protocol, certificates);
ssl.ServerCertValidationDelegate += new CertificateValidationCallback (CertificateValidation);
ssl.ClientCertSelectionDelegate += new CertificateSelectionCallback (ClientCertificateSelection);
ssl.PrivateKeyCertSelectionDelegate += new PrivateKeySelectionCallback (PrivateKeySelection);
byte[] buf = { 0 };
- ssl.Write (buf, 0, buf.Length); - + ssl.Write (buf, 0, buf.Length);
+
Console.WriteLine ("OK");
}
- +
static bool CertificateValidation (X509Certificate certificate, int[] certificateErrors)
- { + {
Console.WriteLine ("CertificateValidation");
- Console.WriteLine (certificate.ToString (true)); - Console.WriteLine ("\tError(s)"); + Console.WriteLine (certificate.ToString (true));
+ Console.WriteLine ("\tError(s)");
foreach (int error in certificateErrors)
- Console.WriteLine ("\t\t#{0}", error); - Console.WriteLine (); + Console.WriteLine ("\t\t#{0}", error);
+ Console.WriteLine ();
return true;
}
- static X509Certificate ClientCertificateSelection (X509CertificateCollection clientCertificates, + static X509Certificate ClientCertificateSelection (X509CertificateCollection clientCertificates,
X509Certificate serverCertificate, string targetHost, X509CertificateCollection serverRequestedCertificates)
- { - Console.WriteLine ("ClientCertificateSelection"); - Console.WriteLine ("\tClient Certificates ({0})", clientCertificates.Count); - int i = 1; + {
+ Console.WriteLine ("ClientCertificateSelection");
+ Console.WriteLine ("\tClient Certificates ({0})", clientCertificates.Count);
+ int i = 1;
foreach (X509Certificate client in clientCertificates)
- Console.WriteLine ("#{0} - {1}", i++, client.ToString (true)); + Console.WriteLine ("#{0} - {1}", i++, client.ToString (true));
Console.WriteLine ("\tHost: {0}", targetHost);
- Console.Write ("SERVER {0}", serverCertificate.ToString (true)); - Console.WriteLine (); + Console.Write ("SERVER {0}", serverCertificate.ToString (true));
+ Console.WriteLine ();
return clientCertificates [0];
}
- +
static AsymmetricAlgorithm PrivateKeySelection (X509Certificate certificate, string targetHost)
- { + {
Console.WriteLine ("PrivateKeySelection");
Console.WriteLine ("\tHost: {0}", targetHost);
Console.WriteLine (certificate.ToString (true));
Console.WriteLine ("\tPrivateKeySelection ({0})", p12.Keys.Count);
- Console.WriteLine (); + Console.WriteLine ();
return (AsymmetricAlgorithm) p12.Keys [0];
}
}
diff --git a/mcs/class/Mono.Security/Test/tools/postecho/postecho.cs b/mcs/class/Mono.Security/Test/tools/postecho/postecho.cs index e770c318991..f340af865c9 100644 --- a/mcs/class/Mono.Security/Test/tools/postecho/postecho.cs +++ b/mcs/class/Mono.Security/Test/tools/postecho/postecho.cs @@ -10,26 +10,26 @@ using System; using System.IO; -using System.Net;
-using System.Net.Sockets;
-using System.Text;
-using System.Security.Cryptography.X509Certificates;
+using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Security.Cryptography.X509Certificates; using Mono.Security.Protocol.Tls; -class PostEcho {
-
- static void Help ()
- {
- Console.WriteLine ("postecho url [size] [--web | --ssl3 | --tls1]");
- Console.WriteLine (" default size is 1024 (bytes)");
- Console.WriteLine (" default mode is --tls1");
- Console.WriteLine ("* a server side script must be installed to run postecho");
- }
-
- static string PostWeb (string url, byte[] buffer)
+class PostEcho { + + static void Help () + { + Console.WriteLine ("postecho url [size] [--web | --ssl3 | --tls1]"); + Console.WriteLine (" default size is 1024 (bytes)"); + Console.WriteLine (" default mode is --tls1"); + Console.WriteLine ("* a server side script must be installed to run postecho"); + } + + static string PostWeb (string url, byte[] buffer) { ServicePointManager.CertificatePolicy = new TestCertificatePolicy (); -
+ string postdata = "TEST="; HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url); req.Method = "POST"; @@ -37,24 +37,24 @@ class PostEcho { req.ContentLength = 5 + buffer.Length; Stream output = req.GetRequestStream (); byte [] bytes = Encoding.Default.GetBytes (postdata); - output.Write (bytes, 0, bytes.Length);
+ output.Write (bytes, 0, bytes.Length); output.Write (buffer, 0, buffer.Length); output.Close (); HttpWebResponse response = (HttpWebResponse) req.GetResponse (); StreamReader reader = new StreamReader (response.GetResponseStream ()); - return reader.ReadToEnd ();
- }
-
- static string PostStream (Mono.Security.Protocol.Tls.SecurityProtocolType protocol, string url, byte[] buffer)
- {
+ return reader.ReadToEnd (); + } + + static string PostStream (Mono.Security.Protocol.Tls.SecurityProtocolType protocol, string url, byte[] buffer) + { Uri uri = new Uri (url); - string post = "POST " + uri.AbsolutePath + " HTTP/1.0\r\n";
- post += "Content-Type: application/x-www-form-urlencoded\r\n";
- post += "Content-Length: " + (buffer.Length + 5).ToString () + "\r\n";
- post += "Host: " + uri.Host + "\r\n\r\n";
- post += "TEST=";
- byte[] bytes = Encoding.Default.GetBytes (post);
-
+ string post = "POST " + uri.AbsolutePath + " HTTP/1.0\r\n"; + post += "Content-Type: application/x-www-form-urlencoded\r\n"; + post += "Content-Length: " + (buffer.Length + 5).ToString () + "\r\n"; + post += "Host: " + uri.Host + "\r\n\r\n"; + post += "TEST="; + byte[] bytes = Encoding.Default.GetBytes (post); + IPHostEntry host = Dns.Resolve (uri.Host); IPAddress ip = host.AddressList [0]; Socket socket = new Socket (ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp); @@ -63,125 +63,125 @@ class PostEcho { SslClientStream ssl = new SslClientStream (ns, uri.Host, false, protocol); ssl.ServerCertValidationDelegate += new CertificateValidationCallback (CertificateValidation); - ssl.Write (bytes, 0, bytes.Length);
- ssl.Write (buffer, 0, buffer.Length);
- ssl.Flush ();
-
- StreamReader reader = new StreamReader (ssl, Encoding.UTF8);
- string result = reader.ReadToEnd ();
- int start = result.IndexOf ("\r\n\r\n") + 4;
- start = result.IndexOf ("\r\n\r\n") + 4;
- return result.Substring (start);
+ ssl.Write (bytes, 0, bytes.Length); + ssl.Write (buffer, 0, buffer.Length); + ssl.Flush (); + + StreamReader reader = new StreamReader (ssl, Encoding.UTF8); + string result = reader.ReadToEnd (); + int start = result.IndexOf ("\r\n\r\n") + 4; + start = result.IndexOf ("\r\n\r\n") + 4; + return result.Substring (start); } static int Main (string[] args) { - if (args.Length < 1) {
- Help ();
- return 2;
+ if (args.Length < 1) { + Help (); + return 2; } string url = args [0]; int size = 1024; - bool ssl = true;
+ bool ssl = true; Mono.Security.Protocol.Tls.SecurityProtocolType protocol = Mono.Security.Protocol.Tls.SecurityProtocolType.Tls; if (args.Length > 1) { for (int i=1; i < args.Length; i++) { switch (args [i].ToLower ()) { case "--ssl3": - ssl = true;
+ ssl = true; protocol = Mono.Security.Protocol.Tls.SecurityProtocolType.Ssl3; - break;
- case "--tls":
+ break; + case "--tls": case "--tls1": - ssl = true;
+ ssl = true; protocol = Mono.Security.Protocol.Tls.SecurityProtocolType.Tls; break; case "--web": ssl = false; break; default: - size = Int32.Parse (args [i]);
- break;
- }
- }
- }
-
- // prepare test buffer
- byte[] data = new byte[size];
- for (int i = 0; i < size; i++)
+ size = Int32.Parse (args [i]); + break; + } + } + } + + // prepare test buffer + byte[] data = new byte[size]; + for (int i = 0; i < size; i++) data[i] = 65; - string result = (ssl ? PostStream (protocol, url, data) : PostWeb (url, data));
-
- if (data.Length != result.Length) {
- Console.WriteLine ("Invalid length {0}. Expected {1}", result.Length, data.Length);
- return 1;
- }
- for (int i = 0; i < result.Length; i++) {
- if (result[i] != 'A') {
- Console.WriteLine ("Error at position #{0} - received '{1}'", i, result[i]);
- return 1;
- }
- }
- Console.WriteLine ("Result OK (length: {0})", result.Length);
- return 0;
+ string result = (ssl ? PostStream (protocol, url, data) : PostWeb (url, data)); + + if (data.Length != result.Length) { + Console.WriteLine ("Invalid length {0}. Expected {1}", result.Length, data.Length); + return 1; + } + for (int i = 0; i < result.Length; i++) { + if (result[i] != 'A') { + Console.WriteLine ("Error at position #{0} - received '{1}'", i, result[i]); + return 1; + } + } + Console.WriteLine ("Result OK (length: {0})", result.Length); + return 0; } - private static void ShowCertificateError (int error)
- {
- string message = null;
- switch (error)
- {
- case -2146762490:
- message = "CERT_E_PURPOSE 0x800B0106";
- break;
- case -2146762481:
- message = "CERT_E_CN_NO_MATCH 0x800B010F";
- break;
- case -2146869223:
- message = "TRUST_E_BASIC_CONSTRAINTS 0x80096019";
- break;
- case -2146869232:
- message = "TRUST_E_BAD_DIGEST 0x80096010";
- break;
- case -2146762494:
- message = "CERT_E_VALIDITYPERIODNESTING 0x800B0102";
- break;
- case -2146762495:
- message = "CERT_E_EXPIRED 0x800B0101";
- break;
- case -2146762486:
- message = "CERT_E_CHAINING 0x800B010A";
- break;
- case -2146762487:
- message = "CERT_E_UNTRUSTEDROOT 0x800B0109";
- break;
- default:
- message = "unknown (try WinError.h)";
- break;
- }
- Console.WriteLine ("Error #{0}: {1}", error, message);
- }
-
- private static bool CertificateValidation (X509Certificate certificate, int[] certificateErrors)
- {
- if (certificateErrors.Length > 0)
- {
- Console.WriteLine (certificate.ToString (true));
- // X509Certificate.ToString(true) doesn't show dates :-(
- Console.WriteLine ("\tValid From: {0}", certificate.GetEffectiveDateString ());
- Console.WriteLine ("\tValid Until: {0}{1}", certificate.GetExpirationDateString (), Environment.NewLine);
- // multiple errors are possible using SslClientStream
- foreach (int error in certificateErrors)
- {
- ShowCertificateError (error);
- }
- }
- // whatever the reason we do not stop the SSL connection
- return true;
- }
+ private static void ShowCertificateError (int error) + { + string message = null; + switch (error) + { + case -2146762490: + message = "CERT_E_PURPOSE 0x800B0106"; + break; + case -2146762481: + message = "CERT_E_CN_NO_MATCH 0x800B010F"; + break; + case -2146869223: + message = "TRUST_E_BASIC_CONSTRAINTS 0x80096019"; + break; + case -2146869232: + message = "TRUST_E_BAD_DIGEST 0x80096010"; + break; + case -2146762494: + message = "CERT_E_VALIDITYPERIODNESTING 0x800B0102"; + break; + case -2146762495: + message = "CERT_E_EXPIRED 0x800B0101"; + break; + case -2146762486: + message = "CERT_E_CHAINING 0x800B010A"; + break; + case -2146762487: + message = "CERT_E_UNTRUSTEDROOT 0x800B0109"; + break; + default: + message = "unknown (try WinError.h)"; + break; + } + Console.WriteLine ("Error #{0}: {1}", error, message); + } + + private static bool CertificateValidation (X509Certificate certificate, int[] certificateErrors) + { + if (certificateErrors.Length > 0) + { + Console.WriteLine (certificate.ToString (true)); + // X509Certificate.ToString(true) doesn't show dates :-( + Console.WriteLine ("\tValid From: {0}", certificate.GetEffectiveDateString ()); + Console.WriteLine ("\tValid Until: {0}{1}", certificate.GetExpirationDateString (), Environment.NewLine); + // multiple errors are possible using SslClientStream + foreach (int error in certificateErrors) + { + ShowCertificateError (error); + } + } + // whatever the reason we do not stop the SSL connection + return true; + } public class TestCertificatePolicy : ICertificatePolicy { diff --git a/mcs/class/Mono.Security/Test/tools/postecho/postmulti.cs b/mcs/class/Mono.Security/Test/tools/postecho/postmulti.cs index 1193fcfd9be..a9f184ddd9f 100644 --- a/mcs/class/Mono.Security/Test/tools/postecho/postmulti.cs +++ b/mcs/class/Mono.Security/Test/tools/postecho/postmulti.cs @@ -64,7 +64,7 @@ public class MultiTest { public const int buffersize = 1024 * 1024; - static byte[] data = new byte [buffersize];
+ static byte[] data = new byte [buffersize]; public static void Main (string[] args) { @@ -74,7 +74,7 @@ public class MultiTest { byte[] bytes = Encoding.Default.GetBytes (postdata); // prepare test buffer - for (int i = 0; i < buffersize; i++)
+ for (int i = 0; i < buffersize; i++) data[i] = 65; int id = 1; @@ -86,7 +86,7 @@ public class MultiTest { req.ContentLength = 5 + data.Length; Stream output = req.GetRequestStream (); - output.Write (bytes, 0, bytes.Length);
+ output.Write (bytes, 0, bytes.Length); output.Write (data, 0, data.Length); output.Close (); @@ -106,20 +106,20 @@ public class MultiTest { StreamReader sr = new StreamReader (stream, Encoding.UTF8); string received = sr.ReadToEnd (); - if (data.Length != received.Length) {
- Console.WriteLine ("ECHO #{0} - Invalid length {1}. Expected {2}", state.Id, received.Length, data.Length);
+ if (data.Length != received.Length) { + Console.WriteLine ("ECHO #{0} - Invalid length {1}. Expected {2}", state.Id, received.Length, data.Length); } else { - bool ok = true;
- for (int i = 0; i < received.Length; i++) {
+ bool ok = true; + for (int i = 0; i < received.Length; i++) { if (received[i] != 'A') { - ok = false;
- Console.WriteLine ("ECHO #{0} - Error at position #{1} - received '{2}'", state.Id, i, received[i]);
- break;
+ ok = false; + Console.WriteLine ("ECHO #{0} - Error at position #{1} - received '{2}'", state.Id, i, received[i]); + break; } } - if (ok)
- Console.WriteLine ("ECHO #{0} - Result OK (length: {1})", state.Id, received.Length);
- }
+ if (ok) + Console.WriteLine ("ECHO #{0} - Result OK (length: {1})", state.Id, received.Length); + } state.Complete (); } diff --git a/mcs/class/Mono.Security/Test/tools/tlstest/tlsmulti.cs b/mcs/class/Mono.Security/Test/tools/tlstest/tlsmulti.cs index fac33550b34..8b196b14bf0 100644 --- a/mcs/class/Mono.Security/Test/tools/tlstest/tlsmulti.cs +++ b/mcs/class/Mono.Security/Test/tools/tlstest/tlsmulti.cs @@ -99,7 +99,7 @@ public class MultiTest { string data = sr.ReadToEnd (); if (alone) - Console.WriteLine (data);
+ Console.WriteLine (data); state.Complete (); } diff --git a/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath/DTMXPathDocumentWriter.cs b/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath/DTMXPathDocumentWriter.cs index 0dd7c7849ad..75f291803bd 100644 --- a/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath/DTMXPathDocumentWriter.cs +++ b/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath/DTMXPathDocumentWriter.cs @@ -176,8 +176,8 @@ namespace Mono.Xml.XPath if (!nodes [nodeIndex].IsEmptyElement) parentForFirstChild = nodeIndex; -
- state = WriteState.Content;
+ + state = WriteState.Content; writerDepth++; } @@ -304,40 +304,40 @@ namespace Mono.Xml.XPath } return null; } -
- public override void WriteCData (string data)
- {
- AddTextNode (data);
- }
-
- private void AddTextNode (string data)
- {
- switch (state) {
- case WriteState.Element:
- CloseStartElement ();
- break;
- case WriteState.Content:
- break;
- default:
- throw new InvalidOperationException ("Invalid document state for CDATA section: " + state);
- }
-
- // When text after text, just add the value, and return.
- if (nodes [nodeIndex].Depth == writerDepth) {
- switch (nodes [nodeIndex].NodeType) {
- case XPathNodeType.Text:
- case XPathNodeType.SignificantWhitespace:
- nodes [nodeIndex].Value += data;
- if (IsWhitespace (data))
- nodes [nodeIndex].NodeType = XPathNodeType.SignificantWhitespace;
- else
- nodes [nodeIndex].NodeType = XPathNodeType.Text;
- return;
- }
- }
-
- int parent = GetParentIndex ();
- UpdateTreeForAddition ();
+ + public override void WriteCData (string data) + { + AddTextNode (data); + } + + private void AddTextNode (string data) + { + switch (state) { + case WriteState.Element: + CloseStartElement (); + break; + case WriteState.Content: + break; + default: + throw new InvalidOperationException ("Invalid document state for CDATA section: " + state); + } + + // When text after text, just add the value, and return. + if (nodes [nodeIndex].Depth == writerDepth) { + switch (nodes [nodeIndex].NodeType) { + case XPathNodeType.Text: + case XPathNodeType.SignificantWhitespace: + nodes [nodeIndex].Value += data; + if (IsWhitespace (data)) + nodes [nodeIndex].NodeType = XPathNodeType.SignificantWhitespace; + else + nodes [nodeIndex].NodeType = XPathNodeType.Text; + return; + } + } + + int parent = GetParentIndex (); + UpdateTreeForAddition (); AddNode (parent, 0, // attribute @@ -354,29 +354,29 @@ namespace Mono.Xml.XPath 0, // nsIndex 0, // line info 0); - }
-
- private void CheckTopLevelNode ()
- {
- switch (state) {
- case WriteState.Element:
- CloseStartElement ();
- break;
- case WriteState.Content:
- case WriteState.Prolog:
- case WriteState.Start:
- break;
- default:
- throw new InvalidOperationException ("Invalid document state for CDATA section: " + state);
- }
- }
-
- public override void WriteComment (string data)
- {
- CheckTopLevelNode ();
-
- int parent = GetParentIndex ();
- UpdateTreeForAddition ();
+ } + + private void CheckTopLevelNode () + { + switch (state) { + case WriteState.Element: + CloseStartElement (); + break; + case WriteState.Content: + case WriteState.Prolog: + case WriteState.Start: + break; + default: + throw new InvalidOperationException ("Invalid document state for CDATA section: " + state); + } + } + + public override void WriteComment (string data) + { + CheckTopLevelNode (); + + int parent = GetParentIndex (); + UpdateTreeForAddition (); AddNode (parent, 0, // attribute @@ -393,14 +393,14 @@ namespace Mono.Xml.XPath 0, // nsIndex 0, // line info 0); - }
-
- public override void WriteProcessingInstruction (string name, string data)
- {
- CheckTopLevelNode ();
-
- int parent = GetParentIndex ();
- UpdateTreeForAddition ();
+ } + + public override void WriteProcessingInstruction (string name, string data) + { + CheckTopLevelNode (); + + int parent = GetParentIndex (); + UpdateTreeForAddition (); AddNode (parent, 0, // attribute @@ -417,14 +417,14 @@ namespace Mono.Xml.XPath 0, // nsIndex 0, // line info 0); - }
-
- public override void WriteWhitespace (string data)
- {
- CheckTopLevelNode ();
-
- int parent = GetParentIndex ();
- UpdateTreeForAddition ();
+ } + + public override void WriteWhitespace (string data) + { + CheckTopLevelNode (); + + int parent = GetParentIndex (); + UpdateTreeForAddition (); AddNode (parent, 0, // attribute @@ -441,43 +441,43 @@ namespace Mono.Xml.XPath 0, // nsIndex 0, // line info 0); - }
-
- public override void WriteStartDocument ()
- {
- // do nothing
- }
-
- public override void WriteStartDocument (bool standalone)
- {
- // do nothing
- }
-
- public override void WriteEndDocument ()
- {
- // do nothing
- }
-
- public override void WriteStartElement (string prefix, string localName, string ns)
- {
- switch (state) {
- case WriteState.Element:
- CloseStartElement ();
- break;
- case WriteState.Start:
- case WriteState.Prolog:
- case WriteState.Content:
- break;
- default:
- throw new InvalidOperationException ("Invalid document state for writing element: " + state);
- }
-
- int parent = GetParentIndex ();
- UpdateTreeForAddition ();
+ } + + public override void WriteStartDocument () + { + // do nothing + } + + public override void WriteStartDocument (bool standalone) + { + // do nothing + } + + public override void WriteEndDocument () + { + // do nothing + } + + public override void WriteStartElement (string prefix, string localName, string ns) + { + switch (state) { + case WriteState.Element: + CloseStartElement (); + break; + case WriteState.Start: + case WriteState.Prolog: + case WriteState.Content: + break; + default: + throw new InvalidOperationException ("Invalid document state for writing element: " + state); + } + + int parent = GetParentIndex (); + UpdateTreeForAddition (); WriteStartElement (parent, prevSibling, prefix, localName, ns); state = WriteState.Element; - }
+ } private void WriteStartElement (int parent, int previousSibling, string prefix, string localName, string ns) { @@ -511,49 +511,49 @@ namespace Mono.Xml.XPath lastNsInScope = namespaces [lastNsInScope].NextNamespace; } } -
- public override void WriteEndElement ()
- {
- WriteEndElement (false);
- }
-
- public override void WriteFullEndElement ()
- {
- WriteEndElement (true);
- }
-
- private void WriteEndElement (bool full)
- {
- switch (state) {
- case WriteState.Element:
- CloseStartElement ();
- break;
- case WriteState.Content:
- break;
- default:
- throw new InvalidOperationException ("Invalid state for writing EndElement: " + state);
- }
- parentForFirstChild = -1;
- if (nodes [nodeIndex].NodeType == XPathNodeType.Element) {
- if (!full)
- nodes [nodeIndex].IsEmptyElement = true;
- }
-
- writerDepth--;
- }
-
- public override void WriteStartAttribute (string prefix, string localName, string ns)
- {
- if (state != WriteState.Element)
- throw new InvalidOperationException ("Invalid document state for attribute: " + state);
-
- state = WriteState.Attribute;
+ + public override void WriteEndElement () + { + WriteEndElement (false); + } + + public override void WriteFullEndElement () + { + WriteEndElement (true); + } + + private void WriteEndElement (bool full) + { + switch (state) { + case WriteState.Element: + CloseStartElement (); + break; + case WriteState.Content: + break; + default: + throw new InvalidOperationException ("Invalid state for writing EndElement: " + state); + } + parentForFirstChild = -1; + if (nodes [nodeIndex].NodeType == XPathNodeType.Element) { + if (!full) + nodes [nodeIndex].IsEmptyElement = true; + } + + writerDepth--; + } + + public override void WriteStartAttribute (string prefix, string localName, string ns) + { + if (state != WriteState.Element) + throw new InvalidOperationException ("Invalid document state for attribute: " + state); + + state = WriteState.Attribute; if (ns == XmlNamespaces.XMLNS) ProcessNamespace ((prefix == null || prefix == String.Empty) ? "" : localName, String.Empty); // dummy: Value should be completed else ProcessAttribute (prefix, localName, ns, String.Empty); // dummy: Value should be completed - }
-
+ } + private void ProcessNamespace (string prefix, string ns) { nsIndex++; @@ -586,87 +586,87 @@ namespace Mono.Xml.XPath attributes [attributeIndex - 1].NextAttribute = attributeIndex; } - public override void WriteEndAttribute ()
- {
- if (state != WriteState.Attribute)
- throw new InvalidOperationException ();
-
- openNamespace = false;
- state = WriteState.Element;
- }
-
- public override void WriteString (string text)
- {
- if (WriteState == WriteState.Attribute) {
- if (openNamespace)
- namespaces [nsIndex].Namespace += text;
- else
- attributes [attributeIndex].Value += text;
- }
- else
- AddTextNode (text);
- }
-
- // Well, they cannot be supported, but actually used to
- // disable-output-escaping = "true"
- public override void WriteRaw (string data)
- {
- WriteString (data);
- }
- - public override void WriteRaw (char [] data, int start, int len)
- {
- WriteString (new string (data, start, len));
- }
-
- public override void WriteName (string name)
- {
- WriteString (name);
- }
-
- public override void WriteNmToken (string name)
- {
- WriteString (name);
- }
-
- public override void WriteBase64 (byte [] buffer, int index, int count)
- {
- throw new NotSupportedException ();
- } - - public override void WriteBinHex (byte [] buffer, int index, int count)
- {
- throw new NotSupportedException ();
- }
-
- public override void WriteChars (char [] buffer, int index, int count)
- {
- throw new NotSupportedException ();
- }
-
- public override void WriteCharEntity (char c)
- {
- throw new NotSupportedException ();
- }
-
- public override void WriteDocType (string name, string pub, string sys, string intSubset)
- {
- throw new NotSupportedException ();
- }
+ public override void WriteEndAttribute () + { + if (state != WriteState.Attribute) + throw new InvalidOperationException (); + + openNamespace = false; + state = WriteState.Element; + } + + public override void WriteString (string text) + { + if (WriteState == WriteState.Attribute) { + if (openNamespace) + namespaces [nsIndex].Namespace += text; + else + attributes [attributeIndex].Value += text; + } + else + AddTextNode (text); + } + + // Well, they cannot be supported, but actually used to + // disable-output-escaping = "true" + public override void WriteRaw (string data) + { + WriteString (data); + } + + public override void WriteRaw (char [] data, int start, int len) + { + WriteString (new string (data, start, len)); + } + + public override void WriteName (string name) + { + WriteString (name); + } + + public override void WriteNmToken (string name) + { + WriteString (name); + } + + public override void WriteBase64 (byte [] buffer, int index, int count) + { + throw new NotSupportedException (); + } + + public override void WriteBinHex (byte [] buffer, int index, int count) + { + throw new NotSupportedException (); + } + + public override void WriteChars (char [] buffer, int index, int count) + { + throw new NotSupportedException (); + } + + public override void WriteCharEntity (char c) + { + throw new NotSupportedException (); + } + + public override void WriteDocType (string name, string pub, string sys, string intSubset) + { + throw new NotSupportedException (); + } public override void WriteEntityRef (string name) { - throw new NotSupportedException ();
+ throw new NotSupportedException (); + } + + public override void WriteQualifiedName (string localName, string ns) + { + throw new NotSupportedException (); } - public override void WriteQualifiedName (string localName, string ns)
- {
- throw new NotSupportedException ();
- }
-
- public override void WriteSurrogateCharEntity (char high, char low)
- {
- throw new NotSupportedException ();
+ public override void WriteSurrogateCharEntity (char high, char low) + { + throw new NotSupportedException (); } private bool IsWhitespace (string data) @@ -683,7 +683,7 @@ namespace Mono.Xml.XPath } } return true; - }
+ } #endregion } } diff --git a/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath2/XmlQueryCompileException.cs b/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath2/XmlQueryCompileException.cs index c0edeb22b80..90f98e892cc 100644 --- a/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath2/XmlQueryCompileException.cs +++ b/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath2/XmlQueryCompileException.cs @@ -8,27 +8,27 @@ // Copyright (C) Tim Coleman, 2003
// Copyright (C) Novell Inc., 2004
//
- -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
#if NET_2_0
diff --git a/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath2/XmlQueryException.cs b/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath2/XmlQueryException.cs index 00e967cc32d..8c0dd144295 100644 --- a/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath2/XmlQueryException.cs +++ b/mcs/class/Mono.Xml.Ext/Mono.Xml.XPath2/XmlQueryException.cs @@ -6,27 +6,27 @@ //
// Copyright (C) Tim Coleman, 2003
//
- -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
#if NET_2_0
diff --git a/mcs/class/Mono.Xml.Ext/Mono.Xml/XmlCachingResolver.cs b/mcs/class/Mono.Xml.Ext/Mono.Xml/XmlCachingResolver.cs index 64b904f5cd8..f369a3b9aff 100644 --- a/mcs/class/Mono.Xml.Ext/Mono.Xml/XmlCachingResolver.cs +++ b/mcs/class/Mono.Xml.Ext/Mono.Xml/XmlCachingResolver.cs @@ -52,14 +52,14 @@ namespace Mono.Xml { if (File.Exists (GetCachedPath (url))) { // The file is in the cache, lets make sure it is up to date - HttpWebRequest hreq = req as HttpWebRequest;
- // MS has a bug in their .net that makes 3xx errors (such as NotModified, 304)
- // throw when this is *TRUE* even though their docs say it will throw when *FALSE*
+ HttpWebRequest hreq = req as HttpWebRequest; + // MS has a bug in their .net that makes 3xx errors (such as NotModified, 304) + // throw when this is *TRUE* even though their docs say it will throw when *FALSE* hreq.AllowAutoRedirect = false; hreq.IfModifiedSince = File.GetLastWriteTime (GetCachedPath (url)); HttpWebResponse hresp = hreq.GetResponse () as HttpWebResponse; - if (hresp.StatusCode != HttpStatusCode.NotModified)
+ if (hresp.StatusCode != HttpStatusCode.NotModified) using (Stream s = hresp.GetResponseStream ()) AddToCache (url, s); @@ -68,7 +68,7 @@ namespace Mono.Xml { } else { // The file has not been cached yet, so lets just get it // and add it there. - using (Stream s = req.GetResponse ().GetResponseStream ())
+ using (Stream s = req.GetResponse ().GetResponseStream ()) AddToCache (url, s); return GetFromCache (url); } diff --git a/mcs/class/Mono.Xml.Ext/Mono.Xml/XmlChar.cs b/mcs/class/Mono.Xml.Ext/Mono.Xml/XmlChar.cs index 252fc1f9885..b3130f3c3d8 100644 --- a/mcs/class/Mono.Xml.Ext/Mono.Xml/XmlChar.cs +++ b/mcs/class/Mono.Xml.Ext/Mono.Xml/XmlChar.cs @@ -1,24 +1,24 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
namespace System.Xml
@@ -33,7 +33,7 @@ namespace System.Xml /// </remarks>
internal class XmlChar//XmlConstructs
{
- internal static readonly char [] WhitespaceChars = {' ', '\n', '\t', '\r'}; + internal static readonly char [] WhitespaceChars = {' ', '\n', '\t', '\r'};
/** Character flags. */
internal static readonly byte [] CHARS = new byte [1 << 16];
@@ -665,8 +665,8 @@ namespace System.Xml public static bool IsWhitespace (string str)
{
- for (int i = 0; i < str.Length; i++) - if (!IsWhitespace (str [i])) return false; + for (int i = 0; i < str.Length; i++)
+ if (!IsWhitespace (str [i])) return false;
return true;
}
|