121 lines
7.6 KiB
C#
121 lines
7.6 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.IO;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x02001C51 RID: 7249
|
|
[Token(Token = "0x2001C51")]
|
|
public class TlsDheKeyExchange : TlsDHKeyExchange
|
|
{
|
|
// Token: 0x0600B25B RID: 45659 RVA: 0x00268D48 File Offset: 0x00266F48
|
|
[Token(Token = "0x600B25B")]
|
|
[Address(RVA = "0x4A2770", Offset = "0x4A1770", VA = "0x1804A2770")]
|
|
[Obsolete]
|
|
public TlsDheKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, DHParameters dhParameters)
|
|
{
|
|
DefaultTlsDHVerifier defaultTlsDHVerifier = new DefaultTlsDHVerifier();
|
|
base..ctor(keyExchange, supportedSignatureAlgorithms, defaultTlsDHVerifier, dhParameters);
|
|
}
|
|
|
|
// Token: 0x0600B25C RID: 45660 RVA: 0x00268D68 File Offset: 0x00266F68
|
|
[Token(Token = "0x600B25C")]
|
|
[Address(RVA = "0x4A2810", Offset = "0x4A1810", VA = "0x1804A2810")]
|
|
public TlsDheKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, TlsDHVerifier dhVerifier, DHParameters dhParameters)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B25D RID: 45661 RVA: 0x00268D78 File Offset: 0x00266F78
|
|
[Token(Token = "0x600B25D")]
|
|
[Address(RVA = "0x4A2450", Offset = "0x4A1450", VA = "0x1804A2450", Slot = "23")]
|
|
public override void ProcessServerCredentials(TlsCredentials serverCredentials)
|
|
{
|
|
this.SkipServerCredentials();
|
|
}
|
|
|
|
// Token: 0x0600B25E RID: 45662 RVA: 0x00268D8C File Offset: 0x00266F8C
|
|
[Token(Token = "0x600B25E")]
|
|
[Address(RVA = "0x4A20E0", Offset = "0x4A10E0", VA = "0x1804A20E0", Slot = "25")]
|
|
public override byte[] GenerateServerKeyExchange()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B25E)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsDheKeyExchange::GenerateServerKeyExchange()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:DigestInputBuffer(var_0_05, newobj:DigestInputBuffer(DigestInputBuffer::.ctor))
|
|
stloc:TlsContext(var_1_0C, ldfld:TlsContext(AbstractTlsKeyExchange::mContext, ldloc:TlsDheKeyExchange[exp:AbstractTlsKeyExchange](this)))
|
|
stloc:TlsContext(var_4_15, ldfld:TlsContext(AbstractTlsKeyExchange::mContext, ldloc:TlsDheKeyExchange[exp:AbstractTlsKeyExchange](this)))
|
|
stloc:TlsSignerCredentials(var_5_1D, ldfld:TlsSignerCredentials(TlsDheKeyExchange::mServerCredentials, ldloc:TlsDheKeyExchange(this)))
|
|
stfld:DHPrivateKeyParameters(TlsDHKeyExchange::mDHAgreePrivateKey, ldloc:TlsDheKeyExchange[exp:TlsDHKeyExchange](this), ldloc:DHPrivateKeyParameters(var_3))
|
|
stloc:SignatureAndHashAlgorithm(var_6_2F, call:SignatureAndHashAlgorithm(TlsUtilities::GetSignatureAndHashAlgorithm, ldloc:TlsContext(var_4_15), ldloc:TlsSignerCredentials(var_5_1D)))
|
|
stloc:IDigest(var_7_38, call:IDigest(TlsUtilities::CreateHash, ldloc:SignatureAndHashAlgorithm(var_6_2F)))
|
|
stloc:TlsContext(var_8_40, ldfld:TlsContext(AbstractTlsKeyExchange::mContext, ldloc:TlsDheKeyExchange[exp:AbstractTlsKeyExchange](this)))
|
|
call:void(DigestInputBuffer::UpdateDigest, ldloc:DigestInputBuffer(var_0_05), ldloc:IDigest(var_7_38))
|
|
stloc:uint8[](var_12_51, call:uint8[](DigestUtilities::DoFinal, ldloc:IDigest(var_7_38)))
|
|
stloc:TlsSignerCredentials(var_13_59, ldfld:TlsSignerCredentials(TlsDheKeyExchange::mServerCredentials, ldloc:TlsDheKeyExchange(this)))
|
|
stloc:uint8[](var_14_69, callvirtgetter:uint8[](DigitallySigned::get_Signature, newobj:DigitallySigned(DigitallySigned::.ctor, ldloc:SignatureAndHashAlgorithm(var_6_2F), ldloc:uint8[](var_12_51))))
|
|
call:void(IDisposable::Dispose, ldloc:DigestInputBuffer[exp:IDisposable](var_0_05))
|
|
}
|
|
|
|
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: 0x0600B25F RID: 45663 RVA: 0x00268E0C File Offset: 0x0026700C
|
|
[Token(Token = "0x600B25F")]
|
|
[Address(RVA = "0x4A2530", Offset = "0x4A1530", VA = "0x1804A2530", Slot = "27")]
|
|
public override void ProcessServerKeyExchange(Stream input)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
TlsContext mContext = this.mContext;
|
|
SignerInputBuffer signerInputBuffer = new SignerInputBuffer();
|
|
TeeInputStream teeInputStream = new TeeInputStream(input, signerInputBuffer);
|
|
DHParameters dhparameters = TlsDHUtilities.ReceiveDHParameters(this.mDHVerifier, teeInputStream);
|
|
this.mDHParameters = dhparameters;
|
|
BigInteger bigInteger = TlsDHUtilities.ReadDHParameter(teeInputStream);
|
|
DHParameters mDHParameters = this.mDHParameters;
|
|
DHPublicKeyParameters dhpublicKeyParameters = new DHPublicKeyParameters(bigInteger, mDHParameters);
|
|
this.mDHAgreePublicKey = dhpublicKeyParameters;
|
|
string text = this.GeneratePremasterSecret().ToString();
|
|
byte[] array = this.GeneratePremasterSecret();
|
|
SignerInputBuffer.SigStream sigStream;
|
|
sigStream.s = array;
|
|
Streams.WriteBufTo(signerInputBuffer, sigStream);
|
|
}
|
|
while (num == 0);
|
|
}
|
|
|
|
// Token: 0x0600B260 RID: 45664 RVA: 0x00268E90 File Offset: 0x00267090
|
|
[Token(Token = "0x600B260")]
|
|
[Address(RVA = "0x4A2370", Offset = "0x4A1370", VA = "0x1804A2370", Slot = "35")]
|
|
protected virtual ISigner InitVerifyer(TlsSigner tlsSigner, SignatureAndHashAlgorithm algorithm, SecurityParameters securityParameters)
|
|
{
|
|
AsymmetricKeyParameter mServerPublicKey = this.mServerPublicKey;
|
|
int length = securityParameters.clientRandom.Length;
|
|
int length2 = securityParameters.serverRandom.Length;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x040071C9 RID: 29129
|
|
[FieldOffset(Offset = "0x60")]
|
|
[Token(Token = "0x40071C9")]
|
|
protected TlsSignerCredentials mServerCredentials;
|
|
}
|
|
}
|