136 lines
5.4 KiB
C#
136 lines
5.4 KiB
C#
using System;
|
|
using System.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix
|
|
{
|
|
// Token: 0x0200197C RID: 6524
|
|
[Token(Token = "0x200197C")]
|
|
public class PkixCertPathValidator
|
|
{
|
|
// Token: 0x06009B23 RID: 39715 RVA: 0x002025FC File Offset: 0x002007FC
|
|
[Token(Token = "0x6009B23")]
|
|
[Address(RVA = "0x1CCFD20", Offset = "0x1CCEB20", VA = "0x181CCFD20", Slot = "4")]
|
|
public virtual PkixCertPathValidatorResult Validate(PkixCertPath certPath, PkixParameters paramsPkix)
|
|
{
|
|
for (;;)
|
|
{
|
|
byte[] array;
|
|
if (array != 0)
|
|
{
|
|
if (array == 0)
|
|
{
|
|
}
|
|
int num = 0;
|
|
TrustAnchor trustAnchor;
|
|
if (array != 0 && trustAnchor != 0)
|
|
{
|
|
int num2 = 0;
|
|
PkixCertPathValidator.CheckCertificate(trustAnchor.trustedCert);
|
|
IList[] array2 = new IList[num2];
|
|
if (num < array2.Length)
|
|
{
|
|
break;
|
|
}
|
|
HashSet hashSet = new HashSet();
|
|
IList list = Platform.CreateArrayList();
|
|
HashSet hashSet2 = new HashSet();
|
|
string any_POLICY = Rfc3280CertPathUtilities.ANY_POLICY;
|
|
int num3;
|
|
ulong num4;
|
|
PkixPolicyNode pkixPolicyNode = new PkixPolicyNode(list, num3, hashSet, num, hashSet2, any_POLICY, num4 != 0UL);
|
|
num3 = 0;
|
|
IList list2 = array2[0];
|
|
PkixNameConstraintValidator pkixNameConstraintValidator = new PkixNameConstraintValidator();
|
|
HashSet hashSet3 = new HashSet();
|
|
pkixNameConstraintValidator.excludedSubtreesDN = hashSet3;
|
|
HashSet hashSet4 = new HashSet();
|
|
pkixNameConstraintValidator.excludedSubtreesDNS = hashSet4;
|
|
HashSet hashSet5 = new HashSet();
|
|
pkixNameConstraintValidator.excludedSubtreesEmail = hashSet5;
|
|
HashSet hashSet6 = new HashSet();
|
|
pkixNameConstraintValidator.excludedSubtreesURI = hashSet6;
|
|
HashSet hashSet7 = new HashSet();
|
|
pkixNameConstraintValidator.excludedSubtreesIP = hashSet7;
|
|
HashSet hashSet8 = new HashSet();
|
|
if (hashSet7 == 0)
|
|
{
|
|
}
|
|
hashSet7.Clear();
|
|
PkixPolicyNode pkixPolicyNode2;
|
|
if (pkixPolicyNode2 == (ulong)1L && pkixPolicyNode2 == 0)
|
|
{
|
|
goto IL_1F3;
|
|
}
|
|
int num5;
|
|
if (num5 == 0)
|
|
{
|
|
HashSet hashSet9 = new HashSet();
|
|
}
|
|
DerObjectIdentifier keyUsage = X509Extensions.KeyUsage;
|
|
DerObjectIdentifier certificatePolicies = X509Extensions.CertificatePolicies;
|
|
DerObjectIdentifier policyMappings = X509Extensions.PolicyMappings;
|
|
DerObjectIdentifier inhibitAnyPolicy = X509Extensions.InhibitAnyPolicy;
|
|
DerObjectIdentifier issuingDistributionPoint = X509Extensions.IssuingDistributionPoint;
|
|
DerObjectIdentifier deltaCrlIndicator = X509Extensions.DeltaCrlIndicator;
|
|
DerObjectIdentifier policyConstraints = X509Extensions.PolicyConstraints;
|
|
DerObjectIdentifier basicConstraints = X509Extensions.BasicConstraints;
|
|
DerObjectIdentifier subjectAlternativeName = X509Extensions.SubjectAlternativeName;
|
|
DerObjectIdentifier nameConstraints = X509Extensions.NameConstraints;
|
|
AsymmetricKeyParameter asymmetricKeyParameter;
|
|
AlgorithmIdentifier algorithmIdentifier = PkixCertPathValidatorUtilities.GetAlgorithmIdentifier(asymmetricKeyParameter);
|
|
int num6;
|
|
if (num6 == 0)
|
|
{
|
|
HashSet hashSet10 = new HashSet();
|
|
}
|
|
DerObjectIdentifier keyUsage2 = X509Extensions.KeyUsage;
|
|
DerObjectIdentifier certificatePolicies2 = X509Extensions.CertificatePolicies;
|
|
DerObjectIdentifier policyMappings2 = X509Extensions.PolicyMappings;
|
|
DerObjectIdentifier inhibitAnyPolicy2 = X509Extensions.InhibitAnyPolicy;
|
|
DerObjectIdentifier issuingDistributionPoint2 = X509Extensions.IssuingDistributionPoint;
|
|
DerObjectIdentifier deltaCrlIndicator2 = X509Extensions.DeltaCrlIndicator;
|
|
DerObjectIdentifier policyConstraints2 = X509Extensions.PolicyConstraints;
|
|
DerObjectIdentifier basicConstraints2 = X509Extensions.BasicConstraints;
|
|
DerObjectIdentifier subjectAlternativeName2 = X509Extensions.SubjectAlternativeName;
|
|
DerObjectIdentifier nameConstraints2 = X509Extensions.NameConstraints;
|
|
DerObjectIdentifier crlDistributionPoints = X509Extensions.CrlDistributionPoints;
|
|
PkixPolicyNode pkixPolicyNode3;
|
|
if (pkixPolicyNode3 != 0)
|
|
{
|
|
PkixCertPathValidatorResult pkixCertPathValidatorResult;
|
|
return pkixCertPathValidatorResult;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
IList list3 = Platform.CreateArrayList();
|
|
throw new ArrayTypeMismatchException();
|
|
IL_1F3:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009B24 RID: 39716 RVA: 0x00202804 File Offset: 0x00200A04
|
|
[Token(Token = "0x6009B24")]
|
|
[Address(RVA = "0x1CCFC60", Offset = "0x1CCEA60", VA = "0x181CCFC60")]
|
|
internal static void CheckCertificate(X509Certificate cert)
|
|
{
|
|
Asn1OctetString asn1OctetString;
|
|
TbsCertificateStructure instance = TbsCertificateStructure.GetInstance(asn1OctetString.str);
|
|
}
|
|
|
|
// Token: 0x06009B25 RID: 39717 RVA: 0x0020282C File Offset: 0x00200A2C
|
|
[Token(Token = "0x6009B25")]
|
|
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
|
public PkixCertPathValidator()
|
|
{
|
|
}
|
|
}
|
|
}
|