891 lines
31 KiB
C#
891 lines
31 KiB
C#
using System;
|
|
using System.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix
|
|
{
|
|
// Token: 0x02001A5F RID: 6751
|
|
[Token(Token = "0x2001A5F")]
|
|
public class PkixCertPathValidatorUtilities
|
|
{
|
|
// Token: 0x06009F01 RID: 40705 RVA: 0x0020BB2C File Offset: 0x00209D2C
|
|
[Token(Token = "0x6009F01")]
|
|
[Address(RVA = "0x64E220", Offset = "0x64D220", VA = "0x18064E220")]
|
|
internal static TrustAnchor FindTrustAnchor(X509Certificate cert, ISet trustAnchors)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009F01)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix.TrustAnchor BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix.PkixCertPathValidatorUtilities::FindTrustAnchor(BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Certificate,BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections.ISet)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_95:
|
|
stloc:Exception(var_9_A0, newobj:Exception(Exception::.ctor, ldstr:string("TrustAnchor found but certificate validation failed."), ldloc:int32[exp:Exception](var_1_03)))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x06009F02 RID: 40706 RVA: 0x0020BBDC File Offset: 0x00209DDC
|
|
[Token(Token = "0x6009F02")]
|
|
[Address(RVA = "0x6506D0", Offset = "0x64F6D0", VA = "0x1806506D0")]
|
|
internal static bool IsIssuerTrustAnchor(X509Certificate cert, ISet trustAnchors)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009F02)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix.PkixCertPathValidatorUtilities::IsIssuerTrustAnchor(BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Certificate,BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections.ISet)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:TrustAnchor(var_0_07, call:TrustAnchor(PkixCertPathValidatorUtilities::FindTrustAnchor, ldloc:X509Certificate(cert), ldloc:ISet(trustAnchors)))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x06009F03 RID: 40707 RVA: 0x0020BBF4 File Offset: 0x00209DF4
|
|
[Token(Token = "0x6009F03")]
|
|
[Address(RVA = "0x64D620", Offset = "0x64C620", VA = "0x18064D620")]
|
|
internal static void AddAdditionalStoresFromAltNames(X509Certificate cert, PkixParameters pkixParams)
|
|
{
|
|
while (cert.GetSubjectAlternativeNames() != 0)
|
|
{
|
|
ICollection subjectAlternativeNames = cert.GetSubjectAlternativeNames();
|
|
if (subjectAlternativeNames == 0)
|
|
{
|
|
break;
|
|
}
|
|
if (subjectAlternativeNames != 0)
|
|
{
|
|
int num;
|
|
while (num == 0)
|
|
{
|
|
}
|
|
if (num == 0 || num != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009F04 RID: 40708 RVA: 0x0020BC28 File Offset: 0x00209E28
|
|
[Token(Token = "0x6009F04")]
|
|
[Address(RVA = "0x6505B0", Offset = "0x64F5B0", VA = "0x1806505B0")]
|
|
internal static DateTime GetValidDate(PkixParameters paramsPKIX)
|
|
{
|
|
return DateTime.UtcNow;
|
|
}
|
|
|
|
// Token: 0x06009F05 RID: 40709 RVA: 0x0020BC44 File Offset: 0x00209E44
|
|
[Token(Token = "0x6009F05")]
|
|
[Address(RVA = "0x64FA30", Offset = "0x64EA30", VA = "0x18064FA30")]
|
|
internal static X509Name GetIssuerPrincipal(object cert)
|
|
{
|
|
for (;;)
|
|
{
|
|
if (cert == 0)
|
|
{
|
|
if (cert != 0 && cert != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
else if (cert != 0 && cert != 0)
|
|
{
|
|
goto Block_4;
|
|
}
|
|
}
|
|
X509Name[] array;
|
|
return array[0];
|
|
Block_4:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F06 RID: 40710 RVA: 0x0020BC7C File Offset: 0x00209E7C
|
|
[Token(Token = "0x6009F06")]
|
|
[Address(RVA = "0x650760", Offset = "0x64F760", VA = "0x180650760")]
|
|
internal static bool IsSelfIssued(X509Certificate cert)
|
|
{
|
|
X509Name issuerDN = cert.IssuerDN;
|
|
BigInteger serialNumber = cert.SerialNumber;
|
|
bool flag;
|
|
return flag;
|
|
}
|
|
|
|
// Token: 0x06009F07 RID: 40711 RVA: 0x0020BCA0 File Offset: 0x00209EA0
|
|
[Token(Token = "0x6009F07")]
|
|
[Address(RVA = "0x64E5D0", Offset = "0x64D5D0", VA = "0x18064E5D0")]
|
|
internal static AlgorithmIdentifier GetAlgorithmIdentifier(AsymmetricKeyParameter key)
|
|
{
|
|
return SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(key).algID;
|
|
}
|
|
|
|
// Token: 0x06009F08 RID: 40712 RVA: 0x0020BCC0 File Offset: 0x00209EC0
|
|
[Token(Token = "0x6009F08")]
|
|
[Address(RVA = "0x650630", Offset = "0x64F630", VA = "0x180650630")]
|
|
internal static bool IsAnyPolicy(ISet policySet)
|
|
{
|
|
bool flag;
|
|
return policySet == 0 || flag;
|
|
}
|
|
|
|
// Token: 0x06009F09 RID: 40713 RVA: 0x0020BCD4 File Offset: 0x00209ED4
|
|
[Token(Token = "0x6009F09")]
|
|
[Address(RVA = "0x64D480", Offset = "0x64C480", VA = "0x18064D480")]
|
|
internal static void AddAdditionalStoreFromLocation(string location, PkixParameters pkixParams)
|
|
{
|
|
if (pkixParams.GetStores() != 0)
|
|
{
|
|
if (!Platform.StartsWith(location, "ldap://"))
|
|
{
|
|
}
|
|
string text = location.Substring(7);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009F0A RID: 40714 RVA: 0x0020BD44 File Offset: 0x00209F44
|
|
[Token(Token = "0x6009F0A")]
|
|
[Address(RVA = "0x650160", Offset = "0x64F160", VA = "0x180650160")]
|
|
private static BigInteger GetSerialNumber(object cert)
|
|
{
|
|
while ((cert == 0 && (cert == 0 || cert == 0)) || cert == 0 || cert == 0)
|
|
{
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F0B RID: 40715 RVA: 0x0020BD78 File Offset: 0x00209F78
|
|
[Token(Token = "0x6009F0B")]
|
|
[Address(RVA = "0x64FF60", Offset = "0x64EF60", VA = "0x18064FF60")]
|
|
internal static ISet GetQualifierSet(Asn1Sequence qualifiers)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
HashSet hashSet = new HashSet();
|
|
if (qualifiers == 0)
|
|
{
|
|
break;
|
|
}
|
|
IEnumerator enumerator = qualifiers.GetEnumerator();
|
|
if (enumerator != 0)
|
|
{
|
|
if (enumerator == 0)
|
|
{
|
|
}
|
|
if (enumerator == 0)
|
|
{
|
|
goto IL_36;
|
|
}
|
|
}
|
|
PolicyQualifierInfo policyQualifierInfo;
|
|
if (policyQualifierInfo != 0)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
throw new NullReferenceException();
|
|
IL_36:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F0C RID: 40716 RVA: 0x0020BDC0 File Offset: 0x00209FC0
|
|
[Token(Token = "0x6009F0C")]
|
|
[Address(RVA = "0x651A80", Offset = "0x650A80", VA = "0x180651A80")]
|
|
internal static PkixPolicyNode RemovePolicyNode(PkixPolicyNode validPolicyTree, IList[] policyNodes, PkixPolicyNode _node)
|
|
{
|
|
if (validPolicyTree != 0)
|
|
{
|
|
PkixCertPathValidatorUtilities.RemovePolicyNodeRecurse(policyNodes, _node);
|
|
return validPolicyTree;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F0D RID: 40717 RVA: 0x0020BE08 File Offset: 0x0020A008
|
|
[Token(Token = "0x6009F0D")]
|
|
[Address(RVA = "0x651840", Offset = "0x650840", VA = "0x180651840")]
|
|
private static void RemovePolicyNodeRecurse(IList[] policyNodes, PkixPolicyNode _node)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
string text = _node.ToString();
|
|
IList list = policyNodes[text];
|
|
if (_node.ValidPolicy == 0)
|
|
{
|
|
break;
|
|
}
|
|
int depth = _node.Depth;
|
|
int num2;
|
|
if (depth != 0)
|
|
{
|
|
if (depth == 0)
|
|
{
|
|
}
|
|
num2 = 0;
|
|
if (depth == 0)
|
|
{
|
|
goto IL_40;
|
|
}
|
|
}
|
|
if (num2 != 0)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
return;
|
|
IL_40:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F0E RID: 40718 RVA: 0x0020BE5C File Offset: 0x0020A05C
|
|
[Token(Token = "0x6009F0E")]
|
|
[Address(RVA = "0x6507C0", Offset = "0x64F7C0", VA = "0x1806507C0")]
|
|
internal static void PrepareNextCertB1(int i, IList[] policyNodes, string id_p, IDictionary m_idp, X509Certificate cert)
|
|
{
|
|
IList list = policyNodes[i];
|
|
bool flag;
|
|
while (!flag)
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009F0F RID: 40719 RVA: 0x0020BF00 File Offset: 0x0020A100
|
|
[Token(Token = "0x6009F0F")]
|
|
[Address(RVA = "0x650F20", Offset = "0x64FF20", VA = "0x180650F20")]
|
|
internal static PkixPolicyNode PrepareNextCertB2(int i, IList[] policyNodes, string id_p, PkixPolicyNode validPolicyTree)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
IList list = Platform.CreateArrayList(policyNodes[i]);
|
|
if (list != 0)
|
|
{
|
|
if (list == 0)
|
|
{
|
|
continue;
|
|
}
|
|
bool flag;
|
|
if (!flag)
|
|
{
|
|
num++;
|
|
}
|
|
IList list2 = policyNodes[i];
|
|
int num2 = i - 1;
|
|
IList list3 = policyNodes[num2];
|
|
PkixPolicyNode pkixPolicyNode;
|
|
if (num < num2 && pkixPolicyNode != 0)
|
|
{
|
|
num++;
|
|
}
|
|
}
|
|
}
|
|
while (num != 0);
|
|
return validPolicyTree;
|
|
}
|
|
|
|
// Token: 0x06009F10 RID: 40720 RVA: 0x0020BF60 File Offset: 0x0020A160
|
|
[Token(Token = "0x6009F10")]
|
|
[Address(RVA = "0x64E670", Offset = "0x64D670", VA = "0x18064E670")]
|
|
internal static void GetCertStatus(DateTime validDate, X509Crl crl, object cert, CertStatus certStatus)
|
|
{
|
|
Asn1Object asn1Object;
|
|
do
|
|
{
|
|
if (asn1Object == 0)
|
|
{
|
|
}
|
|
}
|
|
while (asn1Object == 0);
|
|
X509Crl x509Crl = new X509Crl(CertificateList.GetInstance(asn1Object));
|
|
BigInteger serialNumber = PkixCertPathValidatorUtilities.GetSerialNumber(cert);
|
|
if (x509Crl.NextUpdate != 0)
|
|
{
|
|
int num = 0;
|
|
if (!PkixCertPathValidatorUtilities.GetIssuerPrincipal(cert).Equivalent(num, true))
|
|
{
|
|
int version = crl.Version;
|
|
bool flag;
|
|
if (!flag)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
bool flag2;
|
|
DerEnumerated instance;
|
|
if (flag2)
|
|
{
|
|
Asn1Object asn1Object2;
|
|
instance = DerEnumerated.GetInstance(asn1Object2);
|
|
}
|
|
DateTime dateTime;
|
|
if (instance < dateTime)
|
|
{
|
|
if (instance == 0)
|
|
{
|
|
goto IL_B7;
|
|
}
|
|
BigInteger value = instance.Value;
|
|
int num2 = 0;
|
|
if (!value.TestBit(num2) && !instance.Value.TestBit(1) && !instance.Value.TestBit(2) && !instance.Value.TestBit(8))
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
if (instance != 0)
|
|
{
|
|
goto IL_C0;
|
|
}
|
|
IL_B7:
|
|
certStatus.status = (int)((ulong)0L);
|
|
IL_C0:
|
|
int sign = instance.Value.sign;
|
|
certStatus.status = sign;
|
|
DateTime dateTime2;
|
|
DateTimeObject dateTimeObject = new DateTimeObject(dateTime2);
|
|
certStatus.revocationDate = dateTimeObject;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009F11 RID: 40721 RVA: 0x0020C068 File Offset: 0x0020A268
|
|
[Token(Token = "0x6009F11")]
|
|
[Address(RVA = "0x64FBE0", Offset = "0x64EBE0", VA = "0x18064FBE0")]
|
|
internal static AsymmetricKeyParameter GetNextWorkingKey(IList certs, int index)
|
|
{
|
|
int num;
|
|
int num2;
|
|
int num3;
|
|
for (;;)
|
|
{
|
|
num = 0;
|
|
if (num == 0 || num == 0)
|
|
{
|
|
goto IL_35;
|
|
}
|
|
num2 = 0;
|
|
if (num != 0)
|
|
{
|
|
num3 = index + 1;
|
|
if (num3 < num2 && num2 != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (num2 == 0)
|
|
{
|
|
num3++;
|
|
}
|
|
DsaPublicKeyParameters dsaPublicKeyParameters = new DsaPublicKeyParameters(num, num2);
|
|
IL_35:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F12 RID: 40722 RVA: 0x0020C0B0 File Offset: 0x0020A2B0
|
|
[Token(Token = "0x6009F12")]
|
|
[Address(RVA = "0x650300", Offset = "0x64F300", VA = "0x180650300")]
|
|
internal static DateTime GetValidCertDateFromValidityModel(PkixParameters paramsPkix, PkixCertPath certPath, int index)
|
|
{
|
|
if (index > 0 && index == 0)
|
|
{
|
|
DerGeneralizedTime instance = DerGeneralizedTime.GetInstance(IsisMttObjectIdentifiers.IdIsisMtt);
|
|
if (instance != 0)
|
|
{
|
|
return instance.ToDateTime();
|
|
}
|
|
}
|
|
return PkixCertPathValidatorUtilities.GetValidDate(paramsPkix);
|
|
}
|
|
|
|
// Token: 0x06009F13 RID: 40723 RVA: 0x0020C0E8 File Offset: 0x0020A2E8
|
|
[Token(Token = "0x6009F13")]
|
|
[Address(RVA = "0x64DD30", Offset = "0x64CD30", VA = "0x18064DD30")]
|
|
internal static ICollection FindCertificates(X509CertStoreSelector certSelect, IList certStores)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
HashSet hashSet = new HashSet();
|
|
if (hashSet != 0)
|
|
{
|
|
if (hashSet != 0 && hashSet == 0)
|
|
{
|
|
goto IL_4F;
|
|
}
|
|
if (hashSet != 0)
|
|
{
|
|
}
|
|
if ((uint)(-1) != 0U)
|
|
{
|
|
}
|
|
if (num != 0)
|
|
{
|
|
goto IL_43;
|
|
}
|
|
if ((ulong)((uint)(-1)) != (ulong)(-1L))
|
|
{
|
|
}
|
|
}
|
|
if ((uint)(-1) != 0U)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
throw new NullReferenceException();
|
|
IL_43:
|
|
throw new NullReferenceException();
|
|
IL_4F:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F14 RID: 40724 RVA: 0x0020C14C File Offset: 0x0020A34C
|
|
[Token(Token = "0x6009F14")]
|
|
[Address(RVA = "0x64F050", Offset = "0x64E050", VA = "0x18064F050")]
|
|
internal static void GetCrlIssuersFromDistributionPoint(DistributionPoint dp, ICollection issuerPrincipals, X509CrlStoreSelector selector, PkixParameters pkixParams)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009F14)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix.PkixCertPathValidatorUtilities::GetCrlIssuersFromDistributionPoint(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.DistributionPoint,System.Collections.ICollection,BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store.X509CrlStoreSelector,BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix.PkixParameters)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_AD:
|
|
stloc:Exception(var_8_B7, newobj:Exception(Exception::.ctor, ldstr:string("CRL issuer is omitted from distribution point but no distributionPoint field present.")))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x06009F15 RID: 40725 RVA: 0x0020C214 File Offset: 0x0020A414
|
|
[Token(Token = "0x6009F15")]
|
|
[Address(RVA = "0x64EAD0", Offset = "0x64DAD0", VA = "0x18064EAD0")]
|
|
internal static ISet GetCompleteCrls(DistributionPoint dp, object cert, DateTime currentDate, PkixParameters paramsPKIX)
|
|
{
|
|
for (;;)
|
|
{
|
|
X509CrlStoreSelector x509CrlStoreSelector = new X509CrlStoreSelector();
|
|
HashSet hashSet = new HashSet();
|
|
if (cert != 0)
|
|
{
|
|
if (cert != 0)
|
|
{
|
|
if (cert == 0 || cert == 0)
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
IL_29:
|
|
X509Name issuerPrincipal = PkixCertPathValidatorUtilities.GetIssuerPrincipal(cert);
|
|
PkixCertPathValidatorUtilities.GetCrlIssuersFromDistributionPoint(dp, hashSet, x509CrlStoreSelector, paramsPKIX);
|
|
if (cert == 0)
|
|
{
|
|
goto IL_59;
|
|
}
|
|
if (cert == 0)
|
|
{
|
|
int num = 0;
|
|
if (cert == 0)
|
|
{
|
|
goto IL_59;
|
|
}
|
|
if (num != 0)
|
|
{
|
|
x509CrlStoreSelector.attrCertChecking = num;
|
|
goto IL_59;
|
|
}
|
|
continue;
|
|
}
|
|
IL_6D:
|
|
int num2 = 0;
|
|
if (cert != 0)
|
|
{
|
|
x509CrlStoreSelector.certificateChecking = cert;
|
|
goto IL_7B;
|
|
}
|
|
continue;
|
|
IL_59:
|
|
x509CrlStoreSelector.completeCrlEnabled = true;
|
|
if (PkixCertPathValidatorUtilities.CrlUtilities.ToString() == 0)
|
|
{
|
|
goto IL_6D;
|
|
}
|
|
IL_7B:
|
|
if (num2 == 0)
|
|
{
|
|
break;
|
|
}
|
|
continue;
|
|
goto IL_29;
|
|
}
|
|
throw new IndexOutOfRangeException();
|
|
}
|
|
|
|
// Token: 0x06009F16 RID: 40726 RVA: 0x0020C2BC File Offset: 0x0020A4BC
|
|
[Token(Token = "0x6009F16")]
|
|
[Address(RVA = "0x64F430", Offset = "0x64E430", VA = "0x18064F430")]
|
|
internal static ISet GetDeltaCrls(DateTime currentDate, PkixParameters paramsPKIX, X509Crl completeCRL)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
X509CrlStoreSelector x509CrlStoreSelector = new X509CrlStoreSelector();
|
|
IList list = Platform.CreateArrayList();
|
|
int version = completeCRL.Version;
|
|
x509CrlStoreSelector.Issuers = list;
|
|
DerObjectIdentifier crlNumber = X509Extensions.CrlNumber;
|
|
Asn1Object extensionValue = PkixCertPathValidatorUtilities.GetExtensionValue(completeCRL, crlNumber);
|
|
if (extensionValue != 0)
|
|
{
|
|
BigInteger positiveValue = DerInteger.GetInstance(extensionValue).PositiveValue;
|
|
}
|
|
DerObjectIdentifier issuingDistributionPoint = X509Extensions.IssuingDistributionPoint;
|
|
Asn1Object extensionValue2 = PkixCertPathValidatorUtilities.GetExtensionValue(completeCRL, issuingDistributionPoint);
|
|
byte[] derEncoded;
|
|
if (extensionValue2 != 0)
|
|
{
|
|
derEncoded = extensionValue2.GetDerEncoded();
|
|
}
|
|
if (num == 0)
|
|
{
|
|
}
|
|
BigInteger one = BigInteger.One;
|
|
BigInteger bigInteger;
|
|
x509CrlStoreSelector.minCrlNumber = bigInteger;
|
|
x509CrlStoreSelector.IssuingDistributionPoint = derEncoded;
|
|
x509CrlStoreSelector.issuingDistributionPointEnabled = true;
|
|
x509CrlStoreSelector.maxBaseCrlNumber = num;
|
|
string text = PkixCertPathValidatorUtilities.CrlUtilities.ToString();
|
|
HashSet hashSet = new HashSet();
|
|
bool flag;
|
|
if (hashSet != 0)
|
|
{
|
|
if (hashSet == 0)
|
|
{
|
|
}
|
|
if (hashSet == 0)
|
|
{
|
|
goto IL_CD;
|
|
}
|
|
while (!flag)
|
|
{
|
|
}
|
|
}
|
|
if (flag)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
throw new NullReferenceException();
|
|
IL_CD:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F17 RID: 40727 RVA: 0x0020C39C File Offset: 0x0020A59C
|
|
[Token(Token = "0x6009F17")]
|
|
[Address(RVA = "0x6520B0", Offset = "0x6510B0", VA = "0x1806520B0")]
|
|
private static bool isDeltaCrl(X509Crl crl)
|
|
{
|
|
ISet nonCriticalExtensionOids = crl.GetNonCriticalExtensionOids();
|
|
DerObjectIdentifier deltaCrlIndicator = X509Extensions.DeltaCrlIndicator;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F18 RID: 40728 RVA: 0x0020C3BC File Offset: 0x0020A5BC
|
|
[Token(Token = "0x6009F18")]
|
|
[Address(RVA = "0x64DA20", Offset = "0x64CA20", VA = "0x18064DA20")]
|
|
internal static ICollection FindCertificates(X509AttrCertStoreSelector certSelect, IList certStores)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
HashSet hashSet = new HashSet();
|
|
if (hashSet != 0)
|
|
{
|
|
if (hashSet != 0 && hashSet == 0)
|
|
{
|
|
goto IL_4F;
|
|
}
|
|
if (hashSet != 0)
|
|
{
|
|
}
|
|
if ((uint)(-1) != 0U)
|
|
{
|
|
}
|
|
if (num != 0)
|
|
{
|
|
goto IL_43;
|
|
}
|
|
if ((ulong)((uint)(-1)) != (ulong)(-1L))
|
|
{
|
|
}
|
|
}
|
|
if ((uint)(-1) != 0U)
|
|
{
|
|
}
|
|
}
|
|
while (num != 0);
|
|
throw new NullReferenceException();
|
|
IL_43:
|
|
throw new NullReferenceException();
|
|
IL_4F:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F19 RID: 40729 RVA: 0x0020C420 File Offset: 0x0020A620
|
|
[Token(Token = "0x6009F19")]
|
|
[Address(RVA = "0x64D810", Offset = "0x64C810", VA = "0x18064D810")]
|
|
internal static void AddAdditionalStoresFromCrlDistributionPoint(CrlDistPoint crldp, PkixParameters pkixParams)
|
|
{
|
|
if (crldp != 0)
|
|
{
|
|
DistributionPoint[] distributionPoints = crldp.GetDistributionPoints();
|
|
int num = 0;
|
|
int num2 = 0;
|
|
int length = distributionPoints.Length;
|
|
if (num2 < length)
|
|
{
|
|
DistributionPointName distributionPoint = distributionPoints[num].distributionPoint;
|
|
if (distributionPoint != 0 && distributionPoint.type == 0)
|
|
{
|
|
GeneralName[] names = GeneralNames.GetInstance(distributionPoint.name).GetNames();
|
|
int num3 = 0;
|
|
if (num3 < names.Length)
|
|
{
|
|
GeneralName generalName = names[num3];
|
|
if (generalName.tag == 6)
|
|
{
|
|
PkixCertPathValidatorUtilities.AddAdditionalStoreFromLocation(DerIA5String.GetInstance(generalName.obj).GetString(), pkixParams);
|
|
}
|
|
num3++;
|
|
}
|
|
}
|
|
num++;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009F1A RID: 40730 RVA: 0x0020C4C8 File Offset: 0x0020A6C8
|
|
[Token(Token = "0x6009F1A")]
|
|
[Address(RVA = "0x6512F0", Offset = "0x6502F0", VA = "0x1806512F0")]
|
|
internal static bool ProcessCertD1i(int index, IList[] policyNodes, DerObjectIdentifier pOid, ISet pq)
|
|
{
|
|
int num;
|
|
int num2;
|
|
do
|
|
{
|
|
num = index - 1;
|
|
IList list = policyNodes[num];
|
|
num2 = 0;
|
|
if (0 >= num)
|
|
{
|
|
goto IL_40;
|
|
}
|
|
}
|
|
while (num == 0);
|
|
num2++;
|
|
HashSet hashSet = new HashSet();
|
|
IList list2 = Platform.CreateArrayList();
|
|
string identifier = pOid.identifier;
|
|
IList list3 = policyNodes[index];
|
|
return true;
|
|
IL_40:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F1B RID: 40731 RVA: 0x0020C51C File Offset: 0x0020A71C
|
|
[Token(Token = "0x6009F1B")]
|
|
[Address(RVA = "0x651580", Offset = "0x650580", VA = "0x180651580")]
|
|
internal static void ProcessCertD1ii(int index, IList[] policyNodes, DerObjectIdentifier _poid, ISet _pq)
|
|
{
|
|
int num;
|
|
int num2;
|
|
do
|
|
{
|
|
num = index - 1;
|
|
IList list = policyNodes[num];
|
|
num2 = 0;
|
|
if (0 >= num)
|
|
{
|
|
return;
|
|
}
|
|
if (num == 0)
|
|
{
|
|
}
|
|
}
|
|
while (num == 0);
|
|
string any_POLICY = PkixCertPathValidatorUtilities.ANY_POLICY;
|
|
bool flag;
|
|
if (!flag)
|
|
{
|
|
num2++;
|
|
}
|
|
HashSet hashSet = new HashSet();
|
|
IList list2 = Platform.CreateArrayList();
|
|
string identifier = _poid.identifier;
|
|
IList list3 = policyNodes[index];
|
|
}
|
|
|
|
// Token: 0x06009F1C RID: 40732 RVA: 0x0020C580 File Offset: 0x0020A780
|
|
[Token(Token = "0x6009F1C")]
|
|
[Address(RVA = "0x64E040", Offset = "0x64D040", VA = "0x18064E040")]
|
|
internal static ICollection FindIssuerCerts(X509Certificate cert, PkixBuilderParameters pkixParams)
|
|
{
|
|
X509CertStoreSelector x509CertStoreSelector = new X509CertStoreSelector();
|
|
HashSet hashSet = new HashSet();
|
|
BigInteger serialNumber = cert.SerialNumber;
|
|
x509CertStoreSelector.subject = serialNumber;
|
|
IList additionalStores = pkixParams.GetAdditionalStores();
|
|
ICollection collection = PkixCertPathValidatorUtilities.FindCertificates(x509CertStoreSelector, additionalStores);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009F1D RID: 40733 RVA: 0x0020C5D0 File Offset: 0x0020A7D0
|
|
[Token(Token = "0x6009F1D")]
|
|
[Address(RVA = "0x64F950", Offset = "0x64E950", VA = "0x18064F950")]
|
|
internal static Asn1Object GetExtensionValue(IX509Extension ext, DerObjectIdentifier oid)
|
|
{
|
|
int num = 0;
|
|
num += num;
|
|
num++;
|
|
Asn1Object asn1Object;
|
|
return asn1Object;
|
|
}
|
|
|
|
// Token: 0x06009F1E RID: 40734 RVA: 0x0020C5F8 File Offset: 0x0020A7F8
|
|
[Token(Token = "0x6009F1E")]
|
|
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
|
|
public PkixCertPathValidatorUtilities()
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009F1F RID: 40735 RVA: 0x0020C60C File Offset: 0x0020A80C
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x6009F1F")]
|
|
[Address(RVA = "0x651BC0", Offset = "0x650BC0", VA = "0x180651BC0")]
|
|
static PkixCertPathValidatorUtilities()
|
|
{
|
|
string[] array = new string[11];
|
|
if ("unspecified" != 0)
|
|
{
|
|
}
|
|
array[0] = "unspecified";
|
|
if ("keyCompromise" != 0)
|
|
{
|
|
}
|
|
array[1] = "keyCompromise";
|
|
if ("cACompromise" != 0)
|
|
{
|
|
}
|
|
array[2] = "cACompromise";
|
|
if ("affiliationChanged" != 0)
|
|
{
|
|
}
|
|
array[3] = "affiliationChanged";
|
|
if ("superseded" != 0)
|
|
{
|
|
}
|
|
array[4] = "superseded";
|
|
if ("cessationOfOperation" != 0)
|
|
{
|
|
}
|
|
array[5] = "cessationOfOperation";
|
|
if ("certificateHold" != 0)
|
|
{
|
|
}
|
|
array[6] = "certificateHold";
|
|
if ("unknown" != 0)
|
|
{
|
|
}
|
|
array[7] = "unknown";
|
|
if ("removeFromCRL" != 0)
|
|
{
|
|
}
|
|
array[8] = "removeFromCRL";
|
|
if ("privilegeWithdrawn" != 0)
|
|
{
|
|
}
|
|
array[9] = "privilegeWithdrawn";
|
|
if ("aACompromise" != 0)
|
|
{
|
|
}
|
|
array[10] = "aACompromise";
|
|
PkixCertPathValidatorUtilities.crlReasons = array;
|
|
}
|
|
|
|
// Token: 0x04006A9D RID: 27293
|
|
[Token(Token = "0x4006A9D")]
|
|
private static readonly PkixCrlUtilities CrlUtilities = new PkixCrlUtilities();
|
|
|
|
// Token: 0x04006A9E RID: 27294
|
|
[Token(Token = "0x4006A9E")]
|
|
internal static readonly string ANY_POLICY = "2.5.29.32.0";
|
|
|
|
// Token: 0x04006A9F RID: 27295
|
|
[Token(Token = "0x4006A9F")]
|
|
internal static readonly string CRL_NUMBER = X509Extensions.CrlNumber.identifier;
|
|
|
|
// Token: 0x04006AA0 RID: 27296
|
|
[Token(Token = "0x4006AA0")]
|
|
internal static readonly int KEY_CERT_SIGN;
|
|
|
|
// Token: 0x04006AA1 RID: 27297
|
|
[Token(Token = "0x4006AA1")]
|
|
internal static readonly int CRL_SIGN;
|
|
|
|
// Token: 0x04006AA2 RID: 27298
|
|
[Token(Token = "0x4006AA2")]
|
|
internal static readonly string[] crlReasons;
|
|
}
|
|
}
|