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: 0x02001A4C RID: 6732
|
|
[Token(Token = "0x2001A4C")]
|
|
public class TimeStampResponseGenerator
|
|
{
|
|
// Token: 0x06009E8A RID: 40586 RVA: 0x00209C48 File Offset: 0x00207E48
|
|
[Token(Token = "0x6009E8A")]
|
|
[Address(RVA = "0x5F0750", Offset = "0x5EF750", VA = "0x1805F0750")]
|
|
public TimeStampResponseGenerator(TimeStampTokenGenerator tokenGenerator, IList acceptedAlgorithms)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009E8B RID: 40587 RVA: 0x00209C5C File Offset: 0x00207E5C
|
|
[Token(Token = "0x6009E8B")]
|
|
[Address(RVA = "0x5F0770", Offset = "0x5EF770", VA = "0x1805F0770")]
|
|
public TimeStampResponseGenerator(TimeStampTokenGenerator tokenGenerator, IList acceptedAlgorithms, IList acceptedPolicy)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009E8C RID: 40588 RVA: 0x00209C6C File Offset: 0x00207E6C
|
|
[Token(Token = "0x6009E8C")]
|
|
[Address(RVA = "0x5F0790", Offset = "0x5EF790", VA = "0x1805F0790")]
|
|
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: 0x06009E8D RID: 40589 RVA: 0x00209CB0 File Offset: 0x00207EB0
|
|
[Token(Token = "0x6009E8D")]
|
|
[Address(RVA = "0x5EFF40", Offset = "0x5EEF40", VA = "0x1805EFF40")]
|
|
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: 0x06009E8E RID: 40590 RVA: 0x00209CEC File Offset: 0x00207EEC
|
|
[Token(Token = "0x6009E8E")]
|
|
[Address(RVA = "0x5F0740", Offset = "0x5EF740", VA = "0x1805F0740")]
|
|
private void SetFailInfoField(int field)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009E8F RID: 40591 RVA: 0x00209CFC File Offset: 0x00207EFC
|
|
[Token(Token = "0x6009E8F")]
|
|
[Address(RVA = "0x5F0450", Offset = "0x5EF450", VA = "0x1805F0450")]
|
|
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: 0x06009E90 RID: 40592 RVA: 0x00209DBC File Offset: 0x00207FBC
|
|
[Token(Token = "0x6009E90")]
|
|
[Address(RVA = "0x5F0120", Offset = "0x5EF120", VA = "0x1805F0120")]
|
|
public TimeStampResponse Generate(TimeStampRequest request, BigInteger serialNumber, DateTime genTime)
|
|
{
|
|
DateTimeObject dateTimeObject = new DateTimeObject(genTime);
|
|
return this.Generate(request, serialNumber, dateTimeObject);
|
|
}
|
|
|
|
// Token: 0x06009E91 RID: 40593 RVA: 0x00209DDC File Offset: 0x00207FDC
|
|
[Token(Token = "0x6009E91")]
|
|
[Address(RVA = "0x5F01C0", Offset = "0x5EF1C0", VA = "0x1805F01C0")]
|
|
public TimeStampResponse Generate(TimeStampRequest request, BigInteger serialNumber, DateTimeObject genTime)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009E91)
|
|
|
|
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 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x06009E92 RID: 40594 RVA: 0x00209ED4 File Offset: 0x002080D4
|
|
[Token(Token = "0x6009E92")]
|
|
[Address(RVA = "0x5F0020", Offset = "0x5EF020", VA = "0x1805F0020")]
|
|
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: 0x04006A70 RID: 27248
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006A70")]
|
|
private PkiStatus status;
|
|
|
|
// Token: 0x04006A71 RID: 27249
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006A71")]
|
|
private Asn1EncodableVector statusStrings;
|
|
|
|
// Token: 0x04006A72 RID: 27250
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006A72")]
|
|
private int failInfo;
|
|
|
|
// Token: 0x04006A73 RID: 27251
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4006A73")]
|
|
private TimeStampTokenGenerator tokenGenerator;
|
|
|
|
// Token: 0x04006A74 RID: 27252
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4006A74")]
|
|
private IList acceptedAlgorithms;
|
|
|
|
// Token: 0x04006A75 RID: 27253
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4006A75")]
|
|
private IList acceptedPolicies;
|
|
|
|
// Token: 0x04006A76 RID: 27254
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4006A76")]
|
|
private IList acceptedExtensions;
|
|
|
|
// Token: 0x02001A4D RID: 6733
|
|
[Token(Token = "0x2001A4D")]
|
|
private class FailInfo : DerBitString
|
|
{
|
|
// Token: 0x06009E93 RID: 40595 RVA: 0x00209F20 File Offset: 0x00208120
|
|
[Token(Token = "0x6009E93")]
|
|
[Address(RVA = "0x5DACE0", Offset = "0x5D9CE0", VA = "0x1805DACE0")]
|
|
internal FailInfo(int failInfoValue)
|
|
: base(failInfoValue)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
}
|