summary refs log tree commit diff
path: root/crypto/src/x509
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-01-27 01:58:23 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-01-27 01:58:23 +0700
commite71fe27c302d36e6355d9da12f3d9ec51540825a (patch)
tree6aa065f627d14e659e68ae0cbe355b656af3e40f /crypto/src/x509
parentAdd CrlID.GetInstance methods, obsolete public constructor (diff)
downloadBouncyCastle.NET-ed25519-e71fe27c302d36e6355d9da12f3d9ec51540825a.tar.xz
Misc. cleanup after bc-fips-csharp updates
Diffstat (limited to 'crypto/src/x509')
-rw-r--r--crypto/src/x509/X509AttrCertParser.cs4
-rw-r--r--crypto/src/x509/store/X509AttrCertStoreSelector.cs24
2 files changed, 4 insertions, 24 deletions
diff --git a/crypto/src/x509/X509AttrCertParser.cs b/crypto/src/x509/X509AttrCertParser.cs
index f1dc09543..0019a48eb 100644
--- a/crypto/src/x509/X509AttrCertParser.cs
+++ b/crypto/src/x509/X509AttrCertParser.cs
@@ -114,9 +114,7 @@ namespace Org.BouncyCastle.X509
 				if (sData != null)
 				{
 					if (sDataObjectCount != sData.Count)
-					{
 						return GetCertificate();
-					}
 
 					sData = null;
 					sDataObjectCount = 0;
@@ -139,9 +137,7 @@ namespace Org.BouncyCastle.X509
                 }
 
                 if (tag != 0x30)  // assume ascii PEM encoded.
-				{
 					return ReadPemCertificate(inStream);
-				}
 
 				return ReadDerCertificate(new Asn1InputStream(inStream));
 			}
diff --git a/crypto/src/x509/store/X509AttrCertStoreSelector.cs b/crypto/src/x509/store/X509AttrCertStoreSelector.cs
index e68208c74..6b3c854f1 100644
--- a/crypto/src/x509/store/X509AttrCertStoreSelector.cs
+++ b/crypto/src/x509/store/X509AttrCertStoreSelector.cs
@@ -72,8 +72,7 @@ namespace Org.BouncyCastle.X509.Store
 
 			if (targetNames.Count > 0 || targetGroups.Count > 0)
 			{
-				Asn1OctetString targetInfoExt = attrCert.GetExtensionValue(
-					X509Extensions.TargetInformation);
+				Asn1OctetString targetInfoExt = attrCert.GetExtensionValue(X509Extensions.TargetInformation);
 
 				if (targetInfoExt != null)
 				{
@@ -109,10 +108,9 @@ namespace Org.BouncyCastle.X509.Store
 								}
 							}
 						}
+
 						if (!found)
-						{
 							return false;
-						}
 					}
 
 					if (targetGroups.Count > 0)
@@ -136,9 +134,7 @@ namespace Org.BouncyCastle.X509.Store
 						}
 
 						if (!found)
-						{
 							return false;
-						}
 					}
 				}
 			}
@@ -204,8 +200,7 @@ namespace Org.BouncyCastle.X509.Store
 		*
 		* @param name The name as a GeneralName (not <code>null</code>)
 		*/
-		public void AddTargetName(
-			GeneralName name)
+		public void AddTargetName(GeneralName name)
 		{
 			targetNames.Add(name);
 		}
@@ -338,18 +333,7 @@ namespace Org.BouncyCastle.X509.Store
 			{
 				foreach (object o in names)
 				{
-					if (o is GeneralName gn)
-					{
-						result.Add(gn);
-					}
-					else if (o is byte[] bs)
-					{
-						result.Add(GeneralName.GetInstance(Asn1Object.FromByteArray(bs)));
-					}
-					else
-                    {
-						throw new InvalidOperationException();
-                    }
+                    result.Add(GeneralName.GetInstance(o));
 				}
 			}