206 lines
9.5 KiB
C#
206 lines
9.5 KiB
C#
using System;
|
|
using System.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
|
|
{
|
|
// Token: 0x0200196C RID: 6508
|
|
[Token(Token = "0x200196C")]
|
|
public class TimeStampResponseGenerator
|
|
{
|
|
// Token: 0x06009ABC RID: 39612 RVA: 0x00200BB0 File Offset: 0x001FEDB0
|
|
[Token(Token = "0x6009ABC")]
|
|
[Address(RVA = "0x1B2AC80", Offset = "0x1B29A80", VA = "0x181B2AC80")]
|
|
public TimeStampResponseGenerator(TimeStampTokenGenerator tokenGenerator, IList acceptedAlgorithms)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009ABD RID: 39613 RVA: 0x00200BC4 File Offset: 0x001FEDC4
|
|
[Token(Token = "0x6009ABD")]
|
|
[Address(RVA = "0x1B2ACA0", Offset = "0x1B29AA0", VA = "0x181B2ACA0")]
|
|
public TimeStampResponseGenerator(TimeStampTokenGenerator tokenGenerator, IList acceptedAlgorithms, IList acceptedPolicy)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009ABE RID: 39614 RVA: 0x00200BD4 File Offset: 0x001FEDD4
|
|
[Token(Token = "0x6009ABE")]
|
|
[Address(RVA = "0x1B2ACC0", Offset = "0x1B29AC0", VA = "0x181B2ACC0")]
|
|
public TimeStampResponseGenerator(TimeStampTokenGenerator tokenGenerator, IList acceptedAlgorithms, IList acceptedPolicies, IList acceptedExtensions)
|
|
{
|
|
this.acceptedExtensions = 0;
|
|
this.tokenGenerator = tokenGenerator;
|
|
this.acceptedAlgorithms = acceptedAlgorithms;
|
|
this.acceptedPolicies = acceptedPolicies;
|
|
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(Array.Empty<Asn1Encodable>());
|
|
this.statusStrings = asn1EncodableVector;
|
|
}
|
|
|
|
// Token: 0x06009ABF RID: 39615 RVA: 0x00200C18 File Offset: 0x001FEE18
|
|
[Token(Token = "0x6009ABF")]
|
|
[Address(RVA = "0x1B2A470", Offset = "0x1B29270", VA = "0x181B2A470")]
|
|
private void AddStatusString(string statusString)
|
|
{
|
|
Asn1EncodableVector asn1EncodableVector = this.statusStrings;
|
|
Asn1Encodable[] array = new Asn1Encodable[1];
|
|
DerUtf8String derUtf8String = new DerUtf8String(statusString);
|
|
if (derUtf8String != 0)
|
|
{
|
|
}
|
|
array[0] = derUtf8String;
|
|
asn1EncodableVector.Add(array);
|
|
}
|
|
|
|
// Token: 0x06009AC0 RID: 39616 RVA: 0x00200C54 File Offset: 0x001FEE54
|
|
[Token(Token = "0x6009AC0")]
|
|
[Address(RVA = "0x1B2AC70", Offset = "0x1B29A70", VA = "0x181B2AC70")]
|
|
private void SetFailInfoField(int field)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009AC1 RID: 39617 RVA: 0x00200C64 File Offset: 0x001FEE64
|
|
[Token(Token = "0x6009AC1")]
|
|
[Address(RVA = "0x1B2A980", Offset = "0x1B29780", VA = "0x181B2A980")]
|
|
private PkiStatusInfo GetPkiStatusInfo()
|
|
{
|
|
Asn1Encodable[] array = new Asn1Encodable[1];
|
|
PkiStatus pkiStatus = this.status;
|
|
int num;
|
|
DerInteger derInteger = new DerInteger(num);
|
|
num = (int)pkiStatus;
|
|
if (derInteger != 0)
|
|
{
|
|
}
|
|
array[0] = derInteger;
|
|
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(array);
|
|
if (this.statusStrings.Count > 0)
|
|
{
|
|
Asn1Encodable[] array2 = new Asn1Encodable[1];
|
|
PkiFreeText pkiFreeText = new PkiFreeText(new DerSequence(this.statusStrings));
|
|
if (pkiFreeText != 0)
|
|
{
|
|
}
|
|
array2[0] = pkiFreeText;
|
|
asn1EncodableVector.Add(array2);
|
|
}
|
|
if (this.failInfo != 0)
|
|
{
|
|
Asn1Encodable[] array3 = new Asn1Encodable[1];
|
|
TimeStampResponseGenerator.FailInfo failInfo = new TimeStampResponseGenerator.FailInfo(this.failInfo);
|
|
if (failInfo != 0)
|
|
{
|
|
}
|
|
array3[0] = failInfo;
|
|
asn1EncodableVector.Add(array3);
|
|
}
|
|
return new PkiStatusInfo(new DerSequence(asn1EncodableVector));
|
|
}
|
|
|
|
// Token: 0x06009AC2 RID: 39618 RVA: 0x00200D24 File Offset: 0x001FEF24
|
|
[Token(Token = "0x6009AC2")]
|
|
[Address(RVA = "0x1B2A650", Offset = "0x1B29450", VA = "0x181B2A650")]
|
|
public TimeStampResponse Generate(TimeStampRequest request, BigInteger serialNumber, DateTime genTime)
|
|
{
|
|
DateTimeObject dateTimeObject = new DateTimeObject(genTime);
|
|
return this.Generate(request, serialNumber, dateTimeObject);
|
|
}
|
|
|
|
// Token: 0x06009AC3 RID: 39619 RVA: 0x00200D44 File Offset: 0x001FEF44
|
|
[Token(Token = "0x6009AC3")]
|
|
[Address(RVA = "0x1B2A6F0", Offset = "0x1B294F0", VA = "0x181B2A6F0")]
|
|
public TimeStampResponse Generate(TimeStampRequest request, BigInteger serialNumber, DateTimeObject genTime)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009AC3)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampResponse BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampResponseGenerator::Generate(BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp.TimeStampRequest,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date.DateTimeObject)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_D9:
|
|
stloc:TspValidationException(var_17_E8, newobj:TspValidationException(TspValidationException::.ctor, ldstr:string("The time source is not available."), ldc.i4:int32(512)))
|
|
}
|
|
|
|
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
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: 0x06009AC4 RID: 39620 RVA: 0x00200E3C File Offset: 0x001FF03C
|
|
[Token(Token = "0x6009AC4")]
|
|
[Address(RVA = "0x1B2A550", Offset = "0x1B29350", VA = "0x181B2A550")]
|
|
public TimeStampResponse GenerateFailResponse(PkiStatus status, int failInfoField, string statusString)
|
|
{
|
|
this.status = status;
|
|
if (statusString != 0)
|
|
{
|
|
this.AddStatusString(statusString);
|
|
}
|
|
int num;
|
|
TimeStampResp timeStampResp = new TimeStampResp(this.GetPkiStatusInfo(), num);
|
|
num = 0;
|
|
return new TimeStampResponse(timeStampResp);
|
|
}
|
|
|
|
// Token: 0x040068B7 RID: 26807
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40068B7")]
|
|
private PkiStatus status;
|
|
|
|
// Token: 0x040068B8 RID: 26808
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40068B8")]
|
|
private Asn1EncodableVector statusStrings;
|
|
|
|
// Token: 0x040068B9 RID: 26809
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40068B9")]
|
|
private int failInfo;
|
|
|
|
// Token: 0x040068BA RID: 26810
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40068BA")]
|
|
private TimeStampTokenGenerator tokenGenerator;
|
|
|
|
// Token: 0x040068BB RID: 26811
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40068BB")]
|
|
private IList acceptedAlgorithms;
|
|
|
|
// Token: 0x040068BC RID: 26812
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x40068BC")]
|
|
private IList acceptedPolicies;
|
|
|
|
// Token: 0x040068BD RID: 26813
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x40068BD")]
|
|
private IList acceptedExtensions;
|
|
|
|
// Token: 0x0200196D RID: 6509
|
|
[Token(Token = "0x200196D")]
|
|
private class FailInfo : DerBitString
|
|
{
|
|
// Token: 0x06009AC5 RID: 39621 RVA: 0x00200E88 File Offset: 0x001FF088
|
|
[Token(Token = "0x6009AC5")]
|
|
[Address(RVA = "0x1B15270", Offset = "0x1B14070", VA = "0x181B15270")]
|
|
internal FailInfo(int failInfoValue)
|
|
: base(failInfoValue)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
}
|