scripts
This commit is contained in:
@@ -0,0 +1,212 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509
|
||||
{
|
||||
// Token: 0x02001322 RID: 4898
|
||||
[Token(Token = "0x2001322")]
|
||||
[StructLayout(3)]
|
||||
public class X509AttrCertParser
|
||||
{
|
||||
// Token: 0x06007ABD RID: 31421 RVA: 0x0000220F File Offset: 0x0000040F
|
||||
[Token(Token = "0x6007ABD")]
|
||||
[Address(RVA = "0x52C3C0", Offset = "0x52ADC0", VA = "0x18052C3C0")]
|
||||
private IX509AttributeCertificate ReadDerCertificate(Asn1InputStream dIn)
|
||||
{
|
||||
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
||||
}
|
||||
|
||||
// Token: 0x06007ABE RID: 31422 RVA: 0x00198210 File Offset: 0x00196410
|
||||
[Token(Token = "0x6007ABE")]
|
||||
[Address(RVA = "0x52BC50", Offset = "0x52A650", VA = "0x18052BC50")]
|
||||
private IX509AttributeCertificate GetCertificate()
|
||||
{
|
||||
while (this.sData != (ulong)0L)
|
||||
{
|
||||
Asn1Set asn1Set = this.sData;
|
||||
Asn1Encodable asn1Encodable;
|
||||
if (this.sDataObjectCount >= asn1Encodable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int num = this.sDataObjectCount;
|
||||
Asn1Set asn1Set2 = this.sData;
|
||||
int num2 = num + 1;
|
||||
this.sDataObjectCount = num2;
|
||||
IEnumerator enumerator = asn1Set2.GetEnumerator();
|
||||
while (enumerator == 0)
|
||||
{
|
||||
}
|
||||
while (enumerator == 0)
|
||||
{
|
||||
}
|
||||
if (enumerator != 0)
|
||||
{
|
||||
Asn1Sequence asn1Sequence;
|
||||
X509V2AttributeCertificate x509V2AttributeCertificate = new X509V2AttributeCertificate(AttributeCertificate.GetInstance(asn1Sequence));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06007ABF RID: 31423 RVA: 0x00198280 File Offset: 0x00196480
|
||||
[Token(Token = "0x6007ABF")]
|
||||
[Address(RVA = "0x52C5F0", Offset = "0x52AFF0", VA = "0x18052C5F0")]
|
||||
private IX509AttributeCertificate ReadPemCertificate(Stream inStream)
|
||||
{
|
||||
Asn1Sequence asn1Sequence = X509AttrCertParser.PemAttrCertParser.ReadPemObject(inStream);
|
||||
if (asn1Sequence == 0)
|
||||
{
|
||||
}
|
||||
X509V2AttributeCertificate x509V2AttributeCertificate = new X509V2AttributeCertificate(AttributeCertificate.GetInstance(asn1Sequence));
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06007AC0 RID: 31424 RVA: 0x001982B0 File Offset: 0x001964B0
|
||||
[Token(Token = "0x6007AC0")]
|
||||
[Address(RVA = "0x52C0A0", Offset = "0x52AAA0", VA = "0x18052C0A0")]
|
||||
public IX509AttributeCertificate ReadAttrCert(byte[] input)
|
||||
{
|
||||
int num;
|
||||
MemoryStream memoryStream = new MemoryStream(input, num != 0);
|
||||
num = 0;
|
||||
return this.ReadAttrCert(memoryStream);
|
||||
}
|
||||
|
||||
// Token: 0x06007AC1 RID: 31425 RVA: 0x001982D0 File Offset: 0x001964D0
|
||||
[Token(Token = "0x6007AC1")]
|
||||
[Address(RVA = "0x52C110", Offset = "0x52AB10", VA = "0x18052C110")]
|
||||
public ICollection ReadAttrCerts(byte[] input)
|
||||
{
|
||||
MemoryStream memoryStream;
|
||||
do
|
||||
{
|
||||
int num;
|
||||
memoryStream = new MemoryStream(input, num != 0);
|
||||
num = 0;
|
||||
IList list = Platform.CreateArrayList();
|
||||
int num2 = 0;
|
||||
if (this.ReadAttrCert(memoryStream) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
int num3 = 0;
|
||||
if (num3 < num2)
|
||||
{
|
||||
num3 += num3;
|
||||
num3++;
|
||||
}
|
||||
}
|
||||
while (this.ReadAttrCert(memoryStream) != 0);
|
||||
memoryStream += memoryStream;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06007AC2 RID: 31426 RVA: 0x00198328 File Offset: 0x00196528
|
||||
[Token(Token = "0x6007AC2")]
|
||||
[Address(RVA = "0x52BDE0", Offset = "0x52A7E0", VA = "0x18052BDE0")]
|
||||
public IX509AttributeCertificate ReadAttrCert(Stream inStream)
|
||||
{
|
||||
if (inStream != 0)
|
||||
{
|
||||
inStream.Dispose();
|
||||
Stream stream = this.currentStream;
|
||||
int num = 0;
|
||||
if (stream == 0 || stream != inStream)
|
||||
{
|
||||
this.sDataObjectCount = num;
|
||||
this.sData = num;
|
||||
this.currentStream = inStream;
|
||||
}
|
||||
AttributeCertificate instance;
|
||||
X509V2AttributeCertificate x509V2AttributeCertificate;
|
||||
if (this.sData == 0)
|
||||
{
|
||||
PushbackStream pushbackStream = new PushbackStream(inStream);
|
||||
int num2;
|
||||
pushbackStream.WriteByte((byte)num2);
|
||||
if (num2 == 48)
|
||||
{
|
||||
Asn1InputStream asn1InputStream = new Asn1InputStream(pushbackStream);
|
||||
IX509AttributeCertificate ix509AttributeCertificate = this.ReadDerCertificate(asn1InputStream);
|
||||
}
|
||||
Asn1Sequence asn1Sequence = X509AttrCertParser.PemAttrCertParser.ReadPemObject(pushbackStream);
|
||||
if (asn1Sequence != 0)
|
||||
{
|
||||
instance = AttributeCertificate.GetInstance(asn1Sequence);
|
||||
x509V2AttributeCertificate = new X509V2AttributeCertificate(instance);
|
||||
}
|
||||
}
|
||||
AlgorithmIdentifier signatureAlgorithm = instance.signatureAlgorithm;
|
||||
ISet criticalExtensionOids = x509V2AttributeCertificate.GetCriticalExtensionOids();
|
||||
if (signatureAlgorithm == criticalExtensionOids)
|
||||
{
|
||||
instance.acinfo = x509V2AttributeCertificate;
|
||||
instance.signatureAlgorithm = x509V2AttributeCertificate;
|
||||
}
|
||||
IX509AttributeCertificate ix509AttributeCertificate2;
|
||||
return ix509AttributeCertificate2;
|
||||
}
|
||||
ArgumentNullException ex = new ArgumentNullException("inStream");
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06007AC3 RID: 31427 RVA: 0x00198418 File Offset: 0x00196618
|
||||
[Token(Token = "0x6007AC3")]
|
||||
[Address(RVA = "0x52C280", Offset = "0x52AC80", VA = "0x18052C280")]
|
||||
public ICollection ReadAttrCerts(Stream inStream)
|
||||
{
|
||||
do
|
||||
{
|
||||
IList list = Platform.CreateArrayList();
|
||||
int num = 0;
|
||||
if (this.ReadAttrCert(inStream) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
int num2 = 0;
|
||||
if (num2 < num)
|
||||
{
|
||||
num2 += num2;
|
||||
num2++;
|
||||
}
|
||||
}
|
||||
while (this.ReadAttrCert(inStream) != 0);
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06007AC4 RID: 31428 RVA: 0x00198458 File Offset: 0x00196658
|
||||
[Token(Token = "0x6007AC4")]
|
||||
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
||||
public X509AttrCertParser()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04005839 RID: 22585
|
||||
[Token(Token = "0x4005839")]
|
||||
private static readonly PemParser PemAttrCertParser = new PemParser("ATTRIBUTE CERTIFICATE");
|
||||
|
||||
// Token: 0x0400583A RID: 22586
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400583A")]
|
||||
private Asn1Set sData;
|
||||
|
||||
// Token: 0x0400583B RID: 22587
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400583B")]
|
||||
private int sDataObjectCount;
|
||||
|
||||
// Token: 0x0400583C RID: 22588
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x400583C")]
|
||||
private Stream currentStream;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user