a
This commit is contained in:
+386
@@ -0,0 +1,386 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
||||
{
|
||||
// Token: 0x02001B52 RID: 6994
|
||||
[Token(Token = "0x2001B52")]
|
||||
public sealed class SessionParameters
|
||||
{
|
||||
// Token: 0x0600ADCD RID: 44493 RVA: 0x0025D2AC File Offset: 0x0025B4AC
|
||||
[Token(Token = "0x600ADCD")]
|
||||
[Address(RVA = "0x197A610", Offset = "0x1979410", VA = "0x18197A610")]
|
||||
private SessionParameters(int cipherSuite, byte compressionAlgorithm, byte[] masterSecret, Certificate peerCertificate, byte[] pskIdentity, byte[] srpIdentity, byte[] encodedServerExtensions, bool extendedMasterSecret)
|
||||
{
|
||||
this.mCipherSuite = cipherSuite;
|
||||
this.mCompressionAlgorithm = compressionAlgorithm;
|
||||
byte[] array = Arrays.Clone(masterSecret);
|
||||
this.mMasterSecret = array;
|
||||
this.mPeerCertificate = 0;
|
||||
byte[] array2;
|
||||
this.mPskIdentity = array2;
|
||||
byte[] array3;
|
||||
this.mSrpIdentity = array3;
|
||||
this.mEncodedServerExtensions = 0;
|
||||
this.mExtendedMasterSecret = false;
|
||||
}
|
||||
|
||||
// Token: 0x0600ADCE RID: 44494 RVA: 0x0025D300 File Offset: 0x0025B500
|
||||
[Token(Token = "0x600ADCE")]
|
||||
[Address(RVA = "0x197A460", Offset = "0x1979260", VA = "0x18197A460")]
|
||||
public void Clear()
|
||||
{
|
||||
byte[] array = this.mMasterSecret;
|
||||
if (array != 0)
|
||||
{
|
||||
int num = 0;
|
||||
Arrays.Fill(array, (byte)num);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600ADCF RID: 44495 RVA: 0x0025D324 File Offset: 0x0025B524
|
||||
[Token(Token = "0x600ADCF")]
|
||||
[Address(RVA = "0x197A4D0", Offset = "0x19792D0", VA = "0x18197A4D0")]
|
||||
public SessionParameters Copy()
|
||||
{
|
||||
int num = this.mCipherSuite;
|
||||
byte b = this.mCompressionAlgorithm;
|
||||
byte[] array = this.mMasterSecret;
|
||||
Certificate certificate = this.mPeerCertificate;
|
||||
byte[] array2 = this.mPskIdentity;
|
||||
byte[] array3 = this.mSrpIdentity;
|
||||
byte[] array4 = this.mEncodedServerExtensions;
|
||||
bool flag = this.mExtendedMasterSecret;
|
||||
return new SessionParameters(num, b, array, certificate, array2, array3, array4, flag);
|
||||
}
|
||||
|
||||
// Token: 0x17001B8F RID: 7055
|
||||
// (get) Token: 0x0600ADD0 RID: 44496 RVA: 0x0025D380 File Offset: 0x0025B580
|
||||
[Token(Token = "0x17001B8F")]
|
||||
public int CipherSuite
|
||||
{
|
||||
[Token(Token = "0x600ADD0")]
|
||||
[Address(RVA = "0x3FA560", Offset = "0x3F9360", VA = "0x1803FA560")]
|
||||
get
|
||||
{
|
||||
return this.mCipherSuite;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17001B90 RID: 7056
|
||||
// (get) Token: 0x0600ADD1 RID: 44497 RVA: 0x0025D394 File Offset: 0x0025B594
|
||||
[Token(Token = "0x17001B90")]
|
||||
public byte CompressionAlgorithm
|
||||
{
|
||||
[Token(Token = "0x600ADD1")]
|
||||
[Address(RVA = "0x40B710", Offset = "0x40A510", VA = "0x18040B710")]
|
||||
get
|
||||
{
|
||||
return this.mCompressionAlgorithm;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17001B91 RID: 7057
|
||||
// (get) Token: 0x0600ADD2 RID: 44498 RVA: 0x0025D3A8 File Offset: 0x0025B5A8
|
||||
[Token(Token = "0x17001B91")]
|
||||
public bool IsExtendedMasterSecret
|
||||
{
|
||||
[Token(Token = "0x600ADD2")]
|
||||
[Address(RVA = "0x4363F0", Offset = "0x4351F0", VA = "0x1804363F0")]
|
||||
get
|
||||
{
|
||||
return this.mExtendedMasterSecret;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17001B92 RID: 7058
|
||||
// (get) Token: 0x0600ADD3 RID: 44499 RVA: 0x0025D3BC File Offset: 0x0025B5BC
|
||||
[Token(Token = "0x17001B92")]
|
||||
public byte[] MasterSecret
|
||||
{
|
||||
[Token(Token = "0x600ADD3")]
|
||||
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
|
||||
get
|
||||
{
|
||||
return this.mMasterSecret;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17001B93 RID: 7059
|
||||
// (get) Token: 0x0600ADD4 RID: 44500 RVA: 0x0025D3D0 File Offset: 0x0025B5D0
|
||||
[Token(Token = "0x17001B93")]
|
||||
public Certificate PeerCertificate
|
||||
{
|
||||
[Token(Token = "0x600ADD4")]
|
||||
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
|
||||
get
|
||||
{
|
||||
return this.mPeerCertificate;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17001B94 RID: 7060
|
||||
// (get) Token: 0x0600ADD5 RID: 44501 RVA: 0x0025D3E4 File Offset: 0x0025B5E4
|
||||
[Token(Token = "0x17001B94")]
|
||||
public byte[] PskIdentity
|
||||
{
|
||||
[Token(Token = "0x600ADD5")]
|
||||
[Address(RVA = "0x3F63E0", Offset = "0x3F51E0", VA = "0x1803F63E0")]
|
||||
get
|
||||
{
|
||||
return this.mPskIdentity;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17001B95 RID: 7061
|
||||
// (get) Token: 0x0600ADD6 RID: 44502 RVA: 0x0025D3F8 File Offset: 0x0025B5F8
|
||||
[Token(Token = "0x17001B95")]
|
||||
public byte[] SrpIdentity
|
||||
{
|
||||
[Token(Token = "0x600ADD6")]
|
||||
[Address(RVA = "0x3FA180", Offset = "0x3F8F80", VA = "0x1803FA180")]
|
||||
get
|
||||
{
|
||||
return this.mSrpIdentity;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600ADD7 RID: 44503 RVA: 0x0025D40C File Offset: 0x0025B60C
|
||||
[Token(Token = "0x600ADD7")]
|
||||
[Address(RVA = "0x197A5A0", Offset = "0x19793A0", VA = "0x18197A5A0")]
|
||||
public IDictionary ReadServerExtensions()
|
||||
{
|
||||
byte[] array = this.mEncodedServerExtensions;
|
||||
if (array != 0)
|
||||
{
|
||||
int num;
|
||||
MemoryStream memoryStream = new MemoryStream(array, num != 0);
|
||||
num = 0;
|
||||
return TlsProtocol.ReadExtensions(memoryStream);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04006FAC RID: 28588
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006FAC")]
|
||||
private int mCipherSuite;
|
||||
|
||||
// Token: 0x04006FAD RID: 28589
|
||||
[FieldOffset(Offset = "0x14")]
|
||||
[Token(Token = "0x4006FAD")]
|
||||
private byte mCompressionAlgorithm;
|
||||
|
||||
// Token: 0x04006FAE RID: 28590
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006FAE")]
|
||||
private byte[] mMasterSecret;
|
||||
|
||||
// Token: 0x04006FAF RID: 28591
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006FAF")]
|
||||
private Certificate mPeerCertificate;
|
||||
|
||||
// Token: 0x04006FB0 RID: 28592
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4006FB0")]
|
||||
private byte[] mPskIdentity;
|
||||
|
||||
// Token: 0x04006FB1 RID: 28593
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x4006FB1")]
|
||||
private byte[] mSrpIdentity;
|
||||
|
||||
// Token: 0x04006FB2 RID: 28594
|
||||
[FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x4006FB2")]
|
||||
private byte[] mEncodedServerExtensions;
|
||||
|
||||
// Token: 0x04006FB3 RID: 28595
|
||||
[FieldOffset(Offset = "0x40")]
|
||||
[Token(Token = "0x4006FB3")]
|
||||
private bool mExtendedMasterSecret;
|
||||
|
||||
// Token: 0x02001B53 RID: 6995
|
||||
[Token(Token = "0x2001B53")]
|
||||
public sealed class Builder
|
||||
{
|
||||
// Token: 0x0600ADD8 RID: 44504 RVA: 0x0025D438 File Offset: 0x0025B638
|
||||
[Token(Token = "0x600ADD8")]
|
||||
[Address(RVA = "0x1979170", Offset = "0x1977F70", VA = "0x181979170")]
|
||||
public Builder()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600ADD9 RID: 44505 RVA: 0x0025D45C File Offset: 0x0025B65C
|
||||
[Token(Token = "0x600ADD9")]
|
||||
[Address(RVA = "0x1978EF0", Offset = "0x1977CF0", VA = "0x181978EF0")]
|
||||
public SessionParameters Build()
|
||||
{
|
||||
int num = this.mCipherSuite;
|
||||
this.Validate(num != 0, "cipherSuite");
|
||||
short num2 = this.mCompressionAlgorithm;
|
||||
this.Validate(num2 != 0, "compressionAlgorithm");
|
||||
this.Validate(num2 != 0, "masterSecret");
|
||||
int num3 = this.mCipherSuite;
|
||||
short num4 = this.mCompressionAlgorithm;
|
||||
byte[] array = this.mMasterSecret;
|
||||
Certificate certificate = this.mPeerCertificate;
|
||||
byte[] array2 = this.mPskIdentity;
|
||||
byte[] array3 = this.mSrpIdentity;
|
||||
byte[] array4 = this.mEncodedServerExtensions;
|
||||
bool flag = this.mExtendedMasterSecret;
|
||||
return new SessionParameters(num3, (byte)num4, array, certificate, array2, array3, array4, flag);
|
||||
}
|
||||
|
||||
// Token: 0x0600ADDA RID: 44506 RVA: 0x0025D4EC File Offset: 0x0025B6EC
|
||||
[Token(Token = "0x600ADDA")]
|
||||
[Address(RVA = "0x1979010", Offset = "0x1977E10", VA = "0x181979010")]
|
||||
public SessionParameters.Builder SetCipherSuite(int cipherSuite)
|
||||
{
|
||||
this.mCipherSuite = cipherSuite;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600ADDB RID: 44507 RVA: 0x0025D504 File Offset: 0x0025B704
|
||||
[Token(Token = "0x600ADDB")]
|
||||
[Address(RVA = "0x1979020", Offset = "0x1977E20", VA = "0x181979020")]
|
||||
public SessionParameters.Builder SetCompressionAlgorithm(byte compressionAlgorithm)
|
||||
{
|
||||
this.mCompressionAlgorithm = (short)compressionAlgorithm;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600ADDC RID: 44508 RVA: 0x0025D51C File Offset: 0x0025B71C
|
||||
[Token(Token = "0x600ADDC")]
|
||||
[Address(RVA = "0x1979030", Offset = "0x1977E30", VA = "0x181979030")]
|
||||
public SessionParameters.Builder SetExtendedMasterSecret(bool extendedMasterSecret)
|
||||
{
|
||||
this.mExtendedMasterSecret = extendedMasterSecret;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600ADDD RID: 44509 RVA: 0x0025D534 File Offset: 0x0025B734
|
||||
[Token(Token = "0x600ADDD")]
|
||||
[Address(RVA = "0x1871FF0", Offset = "0x1870DF0", VA = "0x181871FF0")]
|
||||
public SessionParameters.Builder SetMasterSecret(byte[] masterSecret)
|
||||
{
|
||||
this.mMasterSecret = masterSecret;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600ADDE RID: 44510 RVA: 0x0025D54C File Offset: 0x0025B74C
|
||||
[Token(Token = "0x600ADDE")]
|
||||
[Address(RVA = "0x1872000", Offset = "0x1870E00", VA = "0x181872000")]
|
||||
public SessionParameters.Builder SetPeerCertificate(Certificate peerCertificate)
|
||||
{
|
||||
this.mPeerCertificate = peerCertificate;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600ADDF RID: 44511 RVA: 0x0025D564 File Offset: 0x0025B764
|
||||
[Token(Token = "0x600ADDF")]
|
||||
[Address(RVA = "0x1871FD0", Offset = "0x1870DD0", VA = "0x181871FD0")]
|
||||
public SessionParameters.Builder SetPskIdentity(byte[] pskIdentity)
|
||||
{
|
||||
this.mPskIdentity = pskIdentity;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600ADE0 RID: 44512 RVA: 0x0025D57C File Offset: 0x0025B77C
|
||||
[Token(Token = "0x600ADE0")]
|
||||
[Address(RVA = "0xBED9A0", Offset = "0xBEC7A0", VA = "0x180BED9A0")]
|
||||
public SessionParameters.Builder SetSrpIdentity(byte[] srpIdentity)
|
||||
{
|
||||
this.mSrpIdentity = srpIdentity;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600ADE1 RID: 44513 RVA: 0x0025D594 File Offset: 0x0025B794
|
||||
[Token(Token = "0x600ADE1")]
|
||||
[Address(RVA = "0x1979040", Offset = "0x1977E40", VA = "0x181979040")]
|
||||
public SessionParameters.Builder SetServerExtensions(IDictionary serverExtensions)
|
||||
{
|
||||
if (serverExtensions != 0)
|
||||
{
|
||||
TlsProtocol.WriteExtensions(new MemoryStream(), serverExtensions);
|
||||
}
|
||||
int num = 0;
|
||||
this.mEncodedServerExtensions = num;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600ADE2 RID: 44514 RVA: 0x0025D5C0 File Offset: 0x0025B7C0
|
||||
[Token(Token = "0x600ADE2")]
|
||||
[Address(RVA = "0x19790E0", Offset = "0x1977EE0", VA = "0x1819790E0")]
|
||||
private void Validate(bool condition, string parameter)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600ADE2)
|
||||
|
||||
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.SessionParameters/Builder::Validate(System.Boolean,System.String)
|
||||
|
||||
---> System.Exception: Basic block has to end with unconditional control flow.
|
||||
{
|
||||
IL_05:
|
||||
stloc:InvalidOperationException(var_0_1A, newobj:InvalidOperationException(InvalidOperationException::.ctor, call:string(string::Concat, ldstr:string("Required session parameter '"), ldloc:string(parameter), ldstr:string("' not configured"))))
|
||||
}
|
||||
|
||||
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: 0x04006FB4 RID: 28596
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006FB4")]
|
||||
private int mCipherSuite = (int)((uint)(-1));
|
||||
|
||||
// Token: 0x04006FB5 RID: 28597
|
||||
[FieldOffset(Offset = "0x14")]
|
||||
[Token(Token = "0x4006FB5")]
|
||||
private short mCompressionAlgorithm = (short)((uint)(-1));
|
||||
|
||||
// Token: 0x04006FB6 RID: 28598
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006FB6")]
|
||||
private byte[] mMasterSecret;
|
||||
|
||||
// Token: 0x04006FB7 RID: 28599
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006FB7")]
|
||||
private Certificate mPeerCertificate;
|
||||
|
||||
// Token: 0x04006FB8 RID: 28600
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4006FB8")]
|
||||
private byte[] mPskIdentity;
|
||||
|
||||
// Token: 0x04006FB9 RID: 28601
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x4006FB9")]
|
||||
private byte[] mSrpIdentity;
|
||||
|
||||
// Token: 0x04006FBA RID: 28602
|
||||
[FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x4006FBA")]
|
||||
private byte[] mEncodedServerExtensions;
|
||||
|
||||
// Token: 0x04006FBB RID: 28603
|
||||
[FieldOffset(Offset = "0x40")]
|
||||
[Token(Token = "0x4006FBB")]
|
||||
private bool mExtendedMasterSecret;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user