139 lines
5.4 KiB
C#
139 lines
5.4 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Runtime.InteropServices;
|
|
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: 0x0200139F RID: 5023
|
|
[Token(Token = "0x200139F")]
|
|
[StructLayout(3)]
|
|
public class PkixCertPathValidator
|
|
{
|
|
// Token: 0x06007F49 RID: 32585 RVA: 0x001AAFE4 File Offset: 0x001A91E4
|
|
[Token(Token = "0x6007F49")]
|
|
[Address(RVA = "0x4F0B60", Offset = "0x4EF560", VA = "0x1804F0B60", Slot = "4")]
|
|
public virtual PkixCertPathValidatorResult Validate(PkixCertPath certPath, PkixParameters paramsPkix)
|
|
{
|
|
int num;
|
|
for (;;)
|
|
{
|
|
byte[] array;
|
|
if (array != 0)
|
|
{
|
|
if (array == 0)
|
|
{
|
|
}
|
|
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();
|
|
bool isFixedSize = hashSet2.IsFixedSize;
|
|
if (any_POLICY == 0)
|
|
{
|
|
X509Name x509Name = new X509Name(any_POLICY);
|
|
}
|
|
IEnumerator enumerator = hashSet2.GetEnumerator();
|
|
if (enumerator != 0 && enumerator == 0)
|
|
{
|
|
goto IL_1AE;
|
|
}
|
|
PkixPolicyNode pkixPolicyNode2;
|
|
if (pkixPolicyNode2 == (ulong)1L && pkixPolicyNode2 == 0)
|
|
{
|
|
goto IL_1C1;
|
|
}
|
|
int num5;
|
|
if (num5 == 0)
|
|
{
|
|
HashSet hashSet4 = 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 hashSet5 = 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_1AE:
|
|
int num7;
|
|
PkixCertPathValidatorException ex = new PkixCertPathValidatorException("Target certificate in certification path does not match targetConstraints.", num7, certPath, num);
|
|
num7 = 0;
|
|
IL_1C1:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06007F4A RID: 32586 RVA: 0x001AB1BC File Offset: 0x001A93BC
|
|
[Token(Token = "0x6007F4A")]
|
|
[Address(RVA = "0x4F0AA0", Offset = "0x4EF4A0", VA = "0x1804F0AA0")]
|
|
internal static void CheckCertificate(X509Certificate cert)
|
|
{
|
|
Asn1OctetString asn1OctetString;
|
|
TbsCertificateStructure instance = TbsCertificateStructure.GetInstance(asn1OctetString.str);
|
|
}
|
|
|
|
// Token: 0x06007F4B RID: 32587 RVA: 0x001AB1E4 File Offset: 0x001A93E4
|
|
[Token(Token = "0x6007F4B")]
|
|
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
|
public PkixCertPathValidator()
|
|
{
|
|
}
|
|
}
|
|
}
|