From 454f5e65e84d49a34d7839343b584a21b34b7cd9 Mon Sep 17 00:00:00 2001
From: Peter Dettman
Date: Tue, 21 Jun 2022 23:10:22 +0700
Subject: Cleanup old build systems
---
crypto/src/asn1/Asn1Exception.cs | 2 +-
crypto/src/asn1/Asn1ParsingException.cs | 2 +-
crypto/src/asn1/Asn1TaggedObject.cs | 3 +-
crypto/src/asn1/DerGeneralizedTime.cs | 2 +-
crypto/src/asn1/x509/NameConstraints.cs | 2 +-
crypto/src/asn1/x509/PolicyMappings.cs | 2 +-
crypto/src/asn1/x509/X509Name.cs | 6 ++--
crypto/src/bcpg/BcpgInputStream.cs | 2 +-
.../cms/CMSAttributeTableGenerationException.cs | 2 +-
crypto/src/cms/CMSException.cs | 2 +-
crypto/src/cms/CMSSignedDataGenerator.cs | 2 +-
crypto/src/cms/CMSStreamException.cs | 2 +-
crypto/src/cms/CMSTypedStream.cs | 2 +-
.../cms/DefaultSignedAttributeTableGenerator.cs | 2 +-
crypto/src/crypto/CryptoException.cs | 2 +-
crypto/src/crypto/DataLengthException.cs | 2 +-
crypto/src/crypto/InvalidCipherTextException.cs | 2 +-
crypto/src/crypto/MaxBytesExceededException.cs | 2 +-
crypto/src/crypto/OutputLengthException.cs | 2 +-
.../crypto/prng/CryptoApiEntropySourceProvider.cs | 2 +-
crypto/src/crypto/prng/CryptoApiRandomGenerator.cs | 2 +-
crypto/src/crypto/prng/ThreadedSeedGenerator.cs | 8 +-----
crypto/src/math/BigInteger.cs | 2 +-
crypto/src/ocsp/OCSPException.cs | 2 +-
crypto/src/openpgp/PgpDataValidationException.cs | 2 +-
crypto/src/openpgp/PgpException.cs | 2 +-
crypto/src/openpgp/PgpKeyValidationException.cs | 2 +-
crypto/src/openssl/EncryptionException.cs | 2 +-
crypto/src/openssl/PEMException.cs | 2 +-
crypto/src/openssl/PasswordException.cs | 2 +-
crypto/src/pkix/PkixCertPathBuilderException.cs | 2 +-
crypto/src/pkix/PkixCertPathValidatorException.cs | 2 +-
.../pkix/PkixNameConstraintValidatorException.cs | 2 +-
crypto/src/security/DotNetUtilities.cs | 2 +-
crypto/src/security/GeneralSecurityException.cs | 2 +-
crypto/src/security/InvalidKeyException.cs | 2 +-
crypto/src/security/InvalidParameterException.cs | 2 +-
crypto/src/security/KeyException.cs | 2 +-
crypto/src/security/SecureRandom.cs | 2 +-
crypto/src/security/SecurityUtilityException.cs | 2 +-
crypto/src/security/SignatureException.cs | 2 +-
.../security/cert/CertificateEncodingException.cs | 2 +-
crypto/src/security/cert/CertificateException.cs | 2 +-
.../security/cert/CertificateExpiredException.cs | 2 +-
.../cert/CertificateNotYetValidException.cs | 2 +-
.../security/cert/CertificateParsingException.cs | 2 +-
crypto/src/security/cert/CrlException.cs | 2 +-
crypto/src/tls/AbstractTlsContext.cs | 11 --------
crypto/src/tls/TlsUtilities.cs | 4 ---
crypto/src/tsp/TSPException.cs | 2 +-
crypto/src/tsp/TSPValidationException.cs | 2 +-
crypto/src/util/Enums.cs | 25 +---------------
crypto/src/util/Platform.cs | 33 ++--------------------
crypto/src/util/Strings.cs | 6 ++--
crypto/src/util/io/StreamOverflowException.cs | 2 +-
crypto/src/util/io/pem/PemGenerationException.cs | 2 +-
crypto/src/x509/store/IX509Selector.cs | 4 +--
crypto/src/x509/store/NoSuchStoreException.cs | 2 +-
crypto/src/x509/store/X509StoreException.cs | 2 +-
59 files changed, 64 insertions(+), 136 deletions(-)
(limited to 'crypto/src')
diff --git a/crypto/src/asn1/Asn1Exception.cs b/crypto/src/asn1/Asn1Exception.cs
index 1dfe1732c..9e4afb49f 100644
--- a/crypto/src/asn1/Asn1Exception.cs
+++ b/crypto/src/asn1/Asn1Exception.cs
@@ -3,7 +3,7 @@ using System.IO;
namespace Org.BouncyCastle.Asn1
{
-#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE)
+#if !PORTABLE
[Serializable]
#endif
public class Asn1Exception
diff --git a/crypto/src/asn1/Asn1ParsingException.cs b/crypto/src/asn1/Asn1ParsingException.cs
index 84cdb780d..294e4c2c9 100644
--- a/crypto/src/asn1/Asn1ParsingException.cs
+++ b/crypto/src/asn1/Asn1ParsingException.cs
@@ -2,7 +2,7 @@ using System;
namespace Org.BouncyCastle.Asn1
{
-#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE)
+#if !PORTABLE
[Serializable]
#endif
public class Asn1ParsingException
diff --git a/crypto/src/asn1/Asn1TaggedObject.cs b/crypto/src/asn1/Asn1TaggedObject.cs
index 8882cdcb7..f2eca9ad8 100644
--- a/crypto/src/asn1/Asn1TaggedObject.cs
+++ b/crypto/src/asn1/Asn1TaggedObject.cs
@@ -379,8 +379,7 @@ namespace Org.BouncyCastle.Asn1
internal static Asn1Object CreatePrimitive(int tagClass, int tagNo, byte[] contentsOctets)
{
// Note: !CONSTRUCTED => IMPLICIT
- return new DLTaggedObject(ParsedImplicit, tagClass, tagNo,
- new DerOctetString(contentsOctets));
+ return new DLTaggedObject(ParsedImplicit, tagClass, tagNo, new DerOctetString(contentsOctets));
}
private static Asn1TaggedObject CheckedCast(Asn1Object asn1Object)
diff --git a/crypto/src/asn1/DerGeneralizedTime.cs b/crypto/src/asn1/DerGeneralizedTime.cs
index ed2cb5e62..1efa792df 100644
--- a/crypto/src/asn1/DerGeneralizedTime.cs
+++ b/crypto/src/asn1/DerGeneralizedTime.cs
@@ -181,7 +181,7 @@ namespace Org.BouncyCastle.Asn1
char sign = '+';
DateTime time = ToDateTime();
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
long offset = time.Ticks - time.ToUniversalTime().Ticks;
if (offset < 0)
{
diff --git a/crypto/src/asn1/x509/NameConstraints.cs b/crypto/src/asn1/x509/NameConstraints.cs
index b8cc7c0ab..40178c126 100644
--- a/crypto/src/asn1/x509/NameConstraints.cs
+++ b/crypto/src/asn1/x509/NameConstraints.cs
@@ -43,7 +43,7 @@ namespace Org.BouncyCastle.Asn1.X509
}
}
-#if !(SILVERLIGHT || PORTABLE)
+#if !PORTABLE
public NameConstraints(
ArrayList permitted,
ArrayList excluded)
diff --git a/crypto/src/asn1/x509/PolicyMappings.cs b/crypto/src/asn1/x509/PolicyMappings.cs
index 928ad134d..8c9f97814 100644
--- a/crypto/src/asn1/x509/PolicyMappings.cs
+++ b/crypto/src/asn1/x509/PolicyMappings.cs
@@ -29,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.X509
this.seq = seq;
}
-#if !(SILVERLIGHT || PORTABLE)
+#if !PORTABLE
public PolicyMappings(
Hashtable mappings)
: this((IDictionary)mappings)
diff --git a/crypto/src/asn1/x509/X509Name.cs b/crypto/src/asn1/x509/X509Name.cs
index bd8f9fb3e..33c395712 100644
--- a/crypto/src/asn1/x509/X509Name.cs
+++ b/crypto/src/asn1/x509/X509Name.cs
@@ -3,7 +3,7 @@ using System.Collections;
using System.IO;
using System.Text;
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
using System.Collections.Generic;
#endif
@@ -208,7 +208,7 @@ namespace Org.BouncyCastle.Asn1.X509
private static readonly bool[] defaultReverse = { false };
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
/**
* default look up table translating OID values into their common symbols following
* the convention in RFC 2253 with a few extras
@@ -1024,7 +1024,7 @@ namespace Org.BouncyCastle.Asn1.X509
bool reverse,
IDictionary oidSymbols)
{
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
List
*/
-#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE)
+#if !PORTABLE
[Serializable]
#endif
public class TspValidationException
diff --git a/crypto/src/util/Enums.cs b/crypto/src/util/Enums.cs
index 9e908c4c0..c369511d4 100644
--- a/crypto/src/util/Enums.cs
+++ b/crypto/src/util/Enums.cs
@@ -1,7 +1,6 @@
using System;
-using System.Text;
-#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE
+#if PORTABLE
using System.Collections;
using System.Reflection;
#endif
@@ -23,15 +22,7 @@ namespace Org.BouncyCastle.Utilities
s = s.Replace('-', '_');
s = s.Replace('/', '_');
-#if NETCF_1_0
- FieldInfo field = enumType.GetField(s, BindingFlags.Static | BindingFlags.Public);
- if (field != null)
- {
- return (Enum)field.GetValue(null);
- }
-#else
return (Enum)Enum.Parse(enumType, s, false);
-#endif
}
throw new ArgumentException();
@@ -42,21 +33,7 @@ namespace Org.BouncyCastle.Utilities
if (!IsEnumType(enumType))
throw new ArgumentException("Not an enumeration type", "enumType");
-#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT
- IList result = Platform.CreateArrayList();
- FieldInfo[] fields = enumType.GetFields(BindingFlags.Static | BindingFlags.Public);
- foreach (FieldInfo field in fields)
- {
- // Note: Argument to GetValue() ignored since the fields are static,
- // but Silverlight for Windows Phone throws exception if we pass null
- result.Add(field.GetValue(enumType));
- }
- object[] arr = new object[result.Count];
- result.CopyTo(arr, 0);
- return arr;
-#else
return Enum.GetValues(enumType);
-#endif
}
internal static Enum GetArbitraryValue(System.Type enumType)
diff --git a/crypto/src/util/Platform.cs b/crypto/src/util/Platform.cs
index 547cef3fa..b0cd5dcb7 100644
--- a/crypto/src/util/Platform.cs
+++ b/crypto/src/util/Platform.cs
@@ -3,7 +3,7 @@ using System.Globalization;
using System.IO;
using System.Text;
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
using System.Collections.Generic;
#else
using System.Collections;
@@ -15,22 +15,10 @@ namespace Org.BouncyCastle.Utilities
{
private static readonly CompareInfo InvariantCompareInfo = CultureInfo.InvariantCulture.CompareInfo;
-#if NETCF_1_0 || NETCF_2_0
- private static string GetNewLine()
- {
- MemoryStream buf = new MemoryStream();
- StreamWriter w = new StreamWriter(buf, Encoding.UTF8);
- w.WriteLine();
- Dispose(w);
- byte[] bs = buf.ToArray();
- return Encoding.UTF8.GetString(bs, 0, bs.Length);
- }
-#else
private static string GetNewLine()
{
return Environment.NewLine;
}
-#endif
internal static bool EqualsIgnoreCase(string a, string b)
{
@@ -41,7 +29,7 @@ namespace Org.BouncyCastle.Utilities
#endif
}
-#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || (PORTABLE && !DOTNET)
+#if PORTABLE && !DOTNET
internal static string GetEnvironmentVariable(
string variable)
{
@@ -64,28 +52,13 @@ namespace Org.BouncyCastle.Utilities
}
#endif
-#if NETCF_1_0
- internal static Exception CreateNotImplementedException(
- string message)
- {
- return new Exception("Not implemented: " + message);
- }
-
- internal static bool Equals(
- object a,
- object b)
- {
- return a == b || (a != null && b != null && a.Equals(b));
- }
-#else
internal static Exception CreateNotImplementedException(
string message)
{
return new NotImplementedException(message);
}
-#endif
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
internal static System.Collections.IList CreateArrayList()
{
return new List();
diff --git a/crypto/src/util/Strings.cs b/crypto/src/util/Strings.cs
index 73a15ea73..83d1f13fb 100644
--- a/crypto/src/util/Strings.cs
+++ b/crypto/src/util/Strings.cs
@@ -77,7 +77,7 @@ namespace Org.BouncyCastle.Utilities
public static string FromAsciiByteArray(
byte[] bytes)
{
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
// TODO Check for non-ASCII bytes in input?
return Encoding.UTF8.GetString(bytes, 0, bytes.Length);
#else
@@ -88,7 +88,7 @@ namespace Org.BouncyCastle.Utilities
public static byte[] ToAsciiByteArray(
char[] cs)
{
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
// TODO Check for non-ASCII characters in input?
return Encoding.UTF8.GetBytes(cs);
#else
@@ -99,7 +99,7 @@ namespace Org.BouncyCastle.Utilities
public static byte[] ToAsciiByteArray(
string s)
{
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
// TODO Check for non-ASCII characters in input?
return Encoding.UTF8.GetBytes(s);
#else
diff --git a/crypto/src/util/io/StreamOverflowException.cs b/crypto/src/util/io/StreamOverflowException.cs
index 36d21e23e..7e100e7b5 100644
--- a/crypto/src/util/io/StreamOverflowException.cs
+++ b/crypto/src/util/io/StreamOverflowException.cs
@@ -3,7 +3,7 @@ using System.IO;
namespace Org.BouncyCastle.Utilities.IO
{
-#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE)
+#if !PORTABLE
[Serializable]
#endif
public class StreamOverflowException
diff --git a/crypto/src/util/io/pem/PemGenerationException.cs b/crypto/src/util/io/pem/PemGenerationException.cs
index 6b3958577..a49dda0e7 100644
--- a/crypto/src/util/io/pem/PemGenerationException.cs
+++ b/crypto/src/util/io/pem/PemGenerationException.cs
@@ -2,7 +2,7 @@ using System;
namespace Org.BouncyCastle.Utilities.IO.Pem
{
-#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE)
+#if !PORTABLE
[Serializable]
#endif
public class PemGenerationException
diff --git a/crypto/src/x509/store/IX509Selector.cs b/crypto/src/x509/store/IX509Selector.cs
index 75358cbbf..4459903e7 100644
--- a/crypto/src/x509/store/IX509Selector.cs
+++ b/crypto/src/x509/store/IX509Selector.cs
@@ -3,11 +3,11 @@ using System;
namespace Org.BouncyCastle.X509.Store
{
public interface IX509Selector
-#if !(SILVERLIGHT || PORTABLE)
+#if !PORTABLE
: ICloneable
#endif
{
-#if SILVERLIGHT || PORTABLE
+#if PORTABLE
object Clone();
#endif
bool Match(object obj);
diff --git a/crypto/src/x509/store/NoSuchStoreException.cs b/crypto/src/x509/store/NoSuchStoreException.cs
index 28b18892a..bf6bdf76c 100644
--- a/crypto/src/x509/store/NoSuchStoreException.cs
+++ b/crypto/src/x509/store/NoSuchStoreException.cs
@@ -2,7 +2,7 @@ using System;
namespace Org.BouncyCastle.X509.Store
{
-#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE)
+#if !PORTABLE
[Serializable]
#endif
public class NoSuchStoreException
diff --git a/crypto/src/x509/store/X509StoreException.cs b/crypto/src/x509/store/X509StoreException.cs
index ea7e51e79..f697c116a 100644
--- a/crypto/src/x509/store/X509StoreException.cs
+++ b/crypto/src/x509/store/X509StoreException.cs
@@ -2,7 +2,7 @@ using System;
namespace Org.BouncyCastle.X509.Store
{
-#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE)
+#if !PORTABLE
[Serializable]
#endif
public class X509StoreException
--
cgit 1.5.1