144 lines
9.1 KiB
C#
144 lines
9.1 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x02001C29 RID: 7209
|
|
[Token(Token = "0x2001C29")]
|
|
public class PskTlsServer : AbstractTlsServer
|
|
{
|
|
// Token: 0x0600B152 RID: 45394 RVA: 0x00265698 File Offset: 0x00263898
|
|
[Token(Token = "0x600B152")]
|
|
[Address(RVA = "0x496250", Offset = "0x495250", VA = "0x180496250")]
|
|
public PskTlsServer(TlsPskIdentityManager pskIdentityManager)
|
|
{
|
|
DefaultTlsCipherFactory defaultTlsCipherFactory = new DefaultTlsCipherFactory();
|
|
base..ctor(defaultTlsCipherFactory);
|
|
this.mPskIdentityManager = pskIdentityManager;
|
|
}
|
|
|
|
// Token: 0x0600B153 RID: 45395 RVA: 0x002656BC File Offset: 0x002638BC
|
|
[Token(Token = "0x600B153")]
|
|
[Address(RVA = "0x4962C0", Offset = "0x4952C0", VA = "0x1804962C0")]
|
|
public PskTlsServer(TlsCipherFactory cipherFactory, TlsPskIdentityManager pskIdentityManager)
|
|
: base(cipherFactory)
|
|
{
|
|
this.mPskIdentityManager = pskIdentityManager;
|
|
}
|
|
|
|
// Token: 0x0600B154 RID: 45396 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600B154")]
|
|
[Address(RVA = "0x496200", Offset = "0x495200", VA = "0x180496200", Slot = "63")]
|
|
protected virtual TlsEncryptionCredentials GetRsaEncryptionCredentials()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600B155 RID: 45397 RVA: 0x002656D8 File Offset: 0x002638D8
|
|
[Token(Token = "0x600B155")]
|
|
[Address(RVA = "0x4960F0", Offset = "0x4950F0", VA = "0x1804960F0", Slot = "64")]
|
|
protected virtual DHParameters GetDHParameters()
|
|
{
|
|
return DHStandardGroups.rfc7919_ffdhe2048;
|
|
}
|
|
|
|
// Token: 0x0600B156 RID: 45398 RVA: 0x002656EC File Offset: 0x002638EC
|
|
[Token(Token = "0x600B156")]
|
|
[Address(RVA = "0x495FE0", Offset = "0x494FE0", VA = "0x180495FE0", Slot = "41")]
|
|
protected override int[] GetCipherSuites()
|
|
{
|
|
int[] array = new int[4];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.00A4ED0900CBF010B3628AA473D0D1477DB67FFF).FieldHandle);
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600B157 RID: 45399 RVA: 0x0026570C File Offset: 0x0026390C
|
|
[Token(Token = "0x600B157")]
|
|
[Address(RVA = "0x496030", Offset = "0x495030", VA = "0x180496030", Slot = "56")]
|
|
public override TlsCredentials GetCredentials()
|
|
{
|
|
for (;;)
|
|
{
|
|
int mSelectedCipherSuite = this.mSelectedCipherSuite;
|
|
int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite);
|
|
if (mSelectedCipherSuite <= 1)
|
|
{
|
|
return;
|
|
}
|
|
if (keyExchangeAlgorithm == 15)
|
|
{
|
|
TlsCompression compression = base.GetCompression();
|
|
}
|
|
if (keyExchangeAlgorithm == 24)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B158 RID: 45400 RVA: 0x00265740 File Offset: 0x00263940
|
|
[Token(Token = "0x600B158")]
|
|
[Address(RVA = "0x496150", Offset = "0x495150", VA = "0x180496150", Slot = "58")]
|
|
public override TlsKeyExchange GetKeyExchange()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B158)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsKeyExchange BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.PskTlsServer::GetKeyExchange()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_17:
|
|
stloc:TlsCompression(var_2_1D, call:TlsCompression(AbstractTlsPeer::GetCompression, ldloc:PskTlsServer[exp:AbstractTlsPeer](this)))
|
|
}
|
|
|
|
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: 0x0600B159 RID: 45401 RVA: 0x0026576C File Offset: 0x0026396C
|
|
[Token(Token = "0x600B159")]
|
|
[Address(RVA = "0x495F10", Offset = "0x494F10", VA = "0x180495F10", Slot = "65")]
|
|
protected virtual TlsKeyExchange CreatePskKeyExchange(int keyExchange)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B159)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsKeyExchange BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.PskTlsServer::CreatePskKeyExchange(System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:TlsPskIdentityManager(var_0_06, ldfld:TlsPskIdentityManager(PskTlsServer::mPskIdentityManager, ldloc:PskTlsServer(this)))
|
|
stloc:TlsEncryptionCredentials(var_1_0D, callvirt:TlsEncryptionCredentials(PskTlsServer::GetRsaEncryptionCredentials, ldloc:PskTlsServer(this)))
|
|
stloc:int32[](var_2_14, ldfld:int32[](AbstractTlsServer::mNamedCurves, ldloc:PskTlsServer[exp:AbstractTlsServer](this)))
|
|
stloc:uint8[](var_3_1B, ldfld:uint8[](AbstractTlsServer::mClientECPointFormats, ldloc:PskTlsServer[exp:AbstractTlsServer](this)))
|
|
stloc:uint8[](var_4_22, ldfld:uint8[](AbstractTlsServer::mServerECPointFormats, ldloc:PskTlsServer[exp:AbstractTlsServer](this)))
|
|
}
|
|
|
|
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: 0x04007132 RID: 28978
|
|
[FieldOffset(Offset = "0x88")]
|
|
[Token(Token = "0x4007132")]
|
|
protected TlsPskIdentityManager mPskIdentityManager;
|
|
}
|
|
}
|