163 lines
7.0 KiB
C#
163 lines
7.0 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
|
|
{
|
|
// Token: 0x0200138E RID: 5006
|
|
[Token(Token = "0x200138E")]
|
|
[StructLayout(3)]
|
|
public class TimeStampResponse
|
|
{
|
|
// Token: 0x06007ED8 RID: 32472 RVA: 0x001A91DC File Offset: 0x001A73DC
|
|
[Token(Token = "0x6007ED8")]
|
|
[Address(RVA = "0x1C6B400", Offset = "0x1C69E00", VA = "0x181C6B400")]
|
|
public TimeStampResponse(TimeStampResp resp)
|
|
{
|
|
this.resp = resp;
|
|
ContentInfo contentInfo = resp.timeStampToken;
|
|
if (contentInfo != 0)
|
|
{
|
|
TimeStampToken timeStampToken = new TimeStampToken(contentInfo);
|
|
this.timeStampToken = timeStampToken;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06007ED9 RID: 32473 RVA: 0x001A9218 File Offset: 0x001A7418
|
|
[Token(Token = "0x6007ED9")]
|
|
[Address(RVA = "0x1C6B300", Offset = "0x1C69D00", VA = "0x181C6B300")]
|
|
public TimeStampResponse(byte[] resp)
|
|
{
|
|
TimeStampResp timeStampResp = TimeStampResponse.readTimeStampResp(new Asn1InputStream(resp));
|
|
}
|
|
|
|
// Token: 0x06007EDA RID: 32474 RVA: 0x001A9234 File Offset: 0x001A7434
|
|
[Token(Token = "0x6007EDA")]
|
|
[Address(RVA = "0x1C6B380", Offset = "0x1C69D80", VA = "0x181C6B380")]
|
|
public TimeStampResponse(Stream input)
|
|
{
|
|
TimeStampResp timeStampResp = TimeStampResponse.readTimeStampResp(new Asn1InputStream(input));
|
|
}
|
|
|
|
// Token: 0x06007EDB RID: 32475 RVA: 0x001A9250 File Offset: 0x001A7450
|
|
[Token(Token = "0x6007EDB")]
|
|
[Address(RVA = "0x1C6B4D0", Offset = "0x1C69ED0", VA = "0x181C6B4D0")]
|
|
private static TimeStampResp readTimeStampResp(Asn1InputStream input)
|
|
{
|
|
Asn1Object asn1Object = input.ReadObject();
|
|
return TimeStampResp.GetInstance(asn1Object);
|
|
}
|
|
|
|
// Token: 0x170014BF RID: 5311
|
|
// (get) Token: 0x06007EDC RID: 32476 RVA: 0x001A9294 File Offset: 0x001A7494
|
|
[Token(Token = "0x170014BF")]
|
|
public int Status
|
|
{
|
|
[Token(Token = "0x6007EDC")]
|
|
[Address(RVA = "0x1C6B490", Offset = "0x1C69E90", VA = "0x181C6B490")]
|
|
get
|
|
{
|
|
return this.resp.pkiStatusInfo.Status.IntValue;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06007EDD RID: 32477 RVA: 0x001A92BC File Offset: 0x001A74BC
|
|
[Token(Token = "0x6007EDD")]
|
|
[Address(RVA = "0x1C6AC30", Offset = "0x1C69630", VA = "0x181C6AC30")]
|
|
public string GetStatusString()
|
|
{
|
|
if (this.resp.pkiStatusInfo.statusString != (ulong)0L)
|
|
{
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
PkiFreeText statusString = this.resp.pkiStatusInfo.statusString;
|
|
int num = 0;
|
|
int size = statusString.Size;
|
|
if (num != size)
|
|
{
|
|
string @string = statusString[num].GetString();
|
|
StringBuilder stringBuilder2 = stringBuilder.Append(@string);
|
|
num++;
|
|
}
|
|
int hashCode = stringBuilder.GetHashCode();
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06007EDE RID: 32478 RVA: 0x001A932C File Offset: 0x001A752C
|
|
[Token(Token = "0x6007EDE")]
|
|
[Address(RVA = "0x1C6ABA0", Offset = "0x1C695A0", VA = "0x181C6ABA0")]
|
|
public PkiFailureInfo GetFailInfo()
|
|
{
|
|
DerBitString failInfo = this.resp.pkiStatusInfo.failInfo;
|
|
if (failInfo != 0)
|
|
{
|
|
return new PkiFailureInfo(failInfo);
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x170014C0 RID: 5312
|
|
// (get) Token: 0x06007EDF RID: 32479 RVA: 0x001A935C File Offset: 0x001A755C
|
|
[Token(Token = "0x170014C0")]
|
|
public TimeStampToken TimeStampToken
|
|
{
|
|
[Token(Token = "0x6007EDF")]
|
|
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
|
|
get
|
|
{
|
|
return this.timeStampToken;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06007EE0 RID: 32480 RVA: 0x001A9370 File Offset: 0x001A7570
|
|
[Token(Token = "0x6007EE0")]
|
|
[Address(RVA = "0x1C6AD60", Offset = "0x1C69760", VA = "0x181C6AD60")]
|
|
public void Validate(TimeStampRequest request)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06007EE0)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampResponse::Validate(BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampRequest)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_1EE:
|
|
stloc:TspValidationException(var_24_1F8, newobj:TspValidationException(TspValidationException::.ctor, ldstr:string("TSA policy wrong for request.")))
|
|
}
|
|
|
|
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: 0x06007EE1 RID: 32481 RVA: 0x001A9578 File Offset: 0x001A7778
|
|
[Token(Token = "0x6007EE1")]
|
|
[Address(RVA = "0x53BEA0", Offset = "0x53A8A0", VA = "0x18053BEA0")]
|
|
public byte[] GetEncoded()
|
|
{
|
|
return this.resp.GetEncoded();
|
|
}
|
|
|
|
// Token: 0x04005A72 RID: 23154
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4005A72")]
|
|
private TimeStampResp resp;
|
|
|
|
// Token: 0x04005A73 RID: 23155
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4005A73")]
|
|
private TimeStampToken timeStampToken;
|
|
}
|
|
}
|