238 lines
9.1 KiB
C#
238 lines
9.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.IO;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
|
|
{
|
|
// Token: 0x02001969 RID: 6505
|
|
[Token(Token = "0x2001969")]
|
|
public class TimeStampRequest : X509ExtensionBase
|
|
{
|
|
// Token: 0x06009A96 RID: 39574 RVA: 0x00200264 File Offset: 0x001FE464
|
|
[Token(Token = "0x6009A96")]
|
|
[Address(RVA = "0x1B2A2E0", Offset = "0x1B290E0", VA = "0x181B2A2E0")]
|
|
public TimeStampRequest(TimeStampReq req)
|
|
{
|
|
this.req = req;
|
|
X509Extensions x509Extensions = req.extensions;
|
|
this.extensions = x509Extensions;
|
|
}
|
|
|
|
// Token: 0x06009A97 RID: 39575 RVA: 0x00200294 File Offset: 0x001FE494
|
|
[Token(Token = "0x6009A97")]
|
|
[Address(RVA = "0x1B2A270", Offset = "0x1B29070", VA = "0x181B2A270")]
|
|
public TimeStampRequest(byte[] req)
|
|
{
|
|
Asn1InputStream asn1InputStream = new Asn1InputStream(req);
|
|
}
|
|
|
|
// Token: 0x06009A98 RID: 39576 RVA: 0x002002A8 File Offset: 0x001FE4A8
|
|
[Token(Token = "0x6009A98")]
|
|
[Address(RVA = "0x1B2A200", Offset = "0x1B29000", VA = "0x181B2A200")]
|
|
public TimeStampRequest(Stream input)
|
|
{
|
|
Asn1InputStream asn1InputStream = new Asn1InputStream(input);
|
|
}
|
|
|
|
// Token: 0x06009A99 RID: 39577 RVA: 0x002002BC File Offset: 0x001FE4BC
|
|
[Token(Token = "0x6009A99")]
|
|
[Address(RVA = "0x1B2A0F0", Offset = "0x1B28EF0", VA = "0x181B2A0F0")]
|
|
private TimeStampRequest(Asn1InputStream str)
|
|
{
|
|
Asn1Object asn1Object = str.ReadObject();
|
|
TimeStampReq instance = TimeStampReq.GetInstance(asn1Object);
|
|
this.req = instance;
|
|
}
|
|
|
|
// Token: 0x170018B9 RID: 6329
|
|
// (get) Token: 0x06009A9A RID: 39578 RVA: 0x00200300 File Offset: 0x001FE500
|
|
[Token(Token = "0x170018B9")]
|
|
public int Version
|
|
{
|
|
[Token(Token = "0x6009A9A")]
|
|
[Address(RVA = "0x1B2A430", Offset = "0x1B29230", VA = "0x181B2A430")]
|
|
get
|
|
{
|
|
return this.req.version.Value.IntValue;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018BA RID: 6330
|
|
// (get) Token: 0x06009A9B RID: 39579 RVA: 0x00200328 File Offset: 0x001FE528
|
|
[Token(Token = "0x170018BA")]
|
|
public string MessageImprintAlgOid
|
|
{
|
|
[Token(Token = "0x6009A9B")]
|
|
[Address(RVA = "0x1B2A360", Offset = "0x1B29160", VA = "0x181B2A360")]
|
|
get
|
|
{
|
|
Asn1Object asn1Object = this.req.messageImprint.hashAlgorithm.ToAsn1Object();
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009A9C RID: 39580 RVA: 0x00200350 File Offset: 0x001FE550
|
|
[Token(Token = "0x6009A9C")]
|
|
[Address(RVA = "0x1898620", Offset = "0x1897420", VA = "0x181898620")]
|
|
public byte[] GetMessageImprintDigest()
|
|
{
|
|
return this.req.messageImprint.hashedMessage;
|
|
}
|
|
|
|
// Token: 0x170018BB RID: 6331
|
|
// (get) Token: 0x06009A9D RID: 39581 RVA: 0x00200374 File Offset: 0x001FE574
|
|
[Token(Token = "0x170018BB")]
|
|
public string ReqPolicy
|
|
{
|
|
[Token(Token = "0x6009A9D")]
|
|
[Address(RVA = "0x1B2A3F0", Offset = "0x1B291F0", VA = "0x181B2A3F0")]
|
|
get
|
|
{
|
|
DerObjectIdentifier tsaPolicy = this.req.tsaPolicy;
|
|
if (tsaPolicy == 0)
|
|
{
|
|
}
|
|
return tsaPolicy.identifier;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018BC RID: 6332
|
|
// (get) Token: 0x06009A9E RID: 39582 RVA: 0x002003A0 File Offset: 0x001FE5A0
|
|
[Token(Token = "0x170018BC")]
|
|
public BigInteger Nonce
|
|
{
|
|
[Token(Token = "0x6009A9E")]
|
|
[Address(RVA = "0x1B2A3B0", Offset = "0x1B291B0", VA = "0x181B2A3B0")]
|
|
get
|
|
{
|
|
DerInteger nonce = this.req.nonce;
|
|
if (nonce == 0)
|
|
{
|
|
}
|
|
return nonce.Value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018BD RID: 6333
|
|
// (get) Token: 0x06009A9F RID: 39583 RVA: 0x002003CC File Offset: 0x001FE5CC
|
|
[Token(Token = "0x170018BD")]
|
|
public bool CertReq
|
|
{
|
|
[Token(Token = "0x6009A9F")]
|
|
[Address(RVA = "0x1B2A320", Offset = "0x1B29120", VA = "0x181B2A320")]
|
|
get
|
|
{
|
|
DerBoolean certReq = this.req.certReq;
|
|
if (certReq == 0)
|
|
{
|
|
}
|
|
return certReq.IsTrue;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009AA0 RID: 39584 RVA: 0x002003F8 File Offset: 0x001FE5F8
|
|
[Token(Token = "0x6009AA0")]
|
|
[Address(RVA = "0x1B29C70", Offset = "0x1B28A70", VA = "0x181B29C70")]
|
|
public void Validate(IList algorithms, IList policies, IList extensions)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009AA0)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampRequest::Validate(System.Collections.IList,System.Collections.IList,System.Collections.IList)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_FF:
|
|
stloc:TspValidationException(var_13_10A, newobj:TspValidationException(TspValidationException::.ctor, ldstr:string("imprint digest the wrong length"), ldc.i4:int32(4)))
|
|
}
|
|
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x06009AA1 RID: 39585 RVA: 0x00200510 File Offset: 0x001FE710
|
|
[Token(Token = "0x6009AA1")]
|
|
[Address(RVA = "0x16362F0", Offset = "0x16350F0", VA = "0x1816362F0")]
|
|
public byte[] GetEncoded()
|
|
{
|
|
return this.req.GetEncoded();
|
|
}
|
|
|
|
// Token: 0x170018BE RID: 6334
|
|
// (get) Token: 0x06009AA2 RID: 39586 RVA: 0x00200530 File Offset: 0x001FE730
|
|
[Token(Token = "0x170018BE")]
|
|
internal X509Extensions Extensions
|
|
{
|
|
[Token(Token = "0x6009AA2")]
|
|
[Address(RVA = "0x532820", Offset = "0x531620", VA = "0x180532820")]
|
|
get
|
|
{
|
|
return this.req.extensions;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018BF RID: 6335
|
|
// (get) Token: 0x06009AA3 RID: 39587 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x170018BF")]
|
|
public virtual bool HasExtensions
|
|
{
|
|
[Token(Token = "0x6009AA3")]
|
|
[Address(RVA = "0x1227D50", Offset = "0x1226B50", VA = "0x181227D50", Slot = "13")]
|
|
get
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009AA4 RID: 39588 RVA: 0x00200550 File Offset: 0x001FE750
|
|
[Token(Token = "0x6009AA4")]
|
|
[Address(RVA = "0x1B29C50", Offset = "0x1B28A50", VA = "0x181B29C50", Slot = "14")]
|
|
public virtual X509Extension GetExtension(DerObjectIdentifier oid)
|
|
{
|
|
X509Extensions x509Extensions = this.extensions;
|
|
if (x509Extensions == 0)
|
|
{
|
|
}
|
|
return x509Extensions.GetExtension(oid);
|
|
}
|
|
|
|
// Token: 0x06009AA5 RID: 39589 RVA: 0x00200574 File Offset: 0x001FE774
|
|
[Token(Token = "0x6009AA5")]
|
|
[Address(RVA = "0x1B29BF0", Offset = "0x1B289F0", VA = "0x181B29BF0", Slot = "15")]
|
|
public virtual IList GetExtensionOids()
|
|
{
|
|
return TspUtil.GetExtensionOids(this.extensions);
|
|
}
|
|
|
|
// Token: 0x06009AA6 RID: 39590 RVA: 0x0020058C File Offset: 0x001FE78C
|
|
[Token(Token = "0x6009AA6")]
|
|
[Address(RVA = "0x532820", Offset = "0x531620", VA = "0x180532820", Slot = "8")]
|
|
protected override X509Extensions GetX509Extensions()
|
|
{
|
|
return this.req.extensions;
|
|
}
|
|
|
|
// Token: 0x040068AF RID: 26799
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40068AF")]
|
|
private TimeStampReq req;
|
|
|
|
// Token: 0x040068B0 RID: 26800
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40068B0")]
|
|
private X509Extensions extensions;
|
|
}
|
|
}
|