Files
27Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Tls/TlsSrpUtilities.cs
T
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

128 lines
6.6 KiB
C#

using System;
using System.Collections;
using System.IO;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
{
// Token: 0x02001C79 RID: 7289
[Token(Token = "0x2001C79")]
public abstract class TlsSrpUtilities
{
// Token: 0x0600B3DA RID: 46042 RVA: 0x0026D66C File Offset: 0x0026B86C
[Token(Token = "0x600B3DA")]
[Address(RVA = "0x466050", Offset = "0x465050", VA = "0x180466050")]
public static void AddSrpExtension(IDictionary extensions, byte[] identity)
{
while (identity == 0)
{
}
TlsUtilities.CheckUint8(identity.Length);
int length = identity.Length;
byte[] array = Arrays.Prepend(identity, (byte)length);
}
// Token: 0x0600B3DB RID: 46043 RVA: 0x0026D698 File Offset: 0x0026B898
[Token(Token = "0x600B3DB")]
[Address(RVA = "0x4662C0", Offset = "0x4652C0", VA = "0x1804662C0")]
public static byte[] GetSrpExtension(IDictionary extensions)
{
byte[] extensionData = TlsUtilities.GetExtensionData(extensions, 12);
if (extensionData == 0)
{
return extensionData;
}
int num;
MemoryStream memoryStream = new MemoryStream(extensionData, num != 0);
num = 0;
byte[] array = TlsUtilities.ReadOpaque8(memoryStream);
TlsProtocol.AssertEmpty(memoryStream);
return array;
}
// Token: 0x0600B3DC RID: 46044 RVA: 0x0026D6CC File Offset: 0x0026B8CC
[Token(Token = "0x600B3DC")]
[Address(RVA = "0x4661C0", Offset = "0x4651C0", VA = "0x1804661C0")]
public static byte[] CreateSrpExtension(byte[] identity)
{
while (identity == 0)
{
}
TlsUtilities.CheckUint8(identity.Length);
int length = identity.Length;
return Arrays.Prepend(identity, (byte)length);
}
// Token: 0x0600B3DD RID: 46045 RVA: 0x0026D6F8 File Offset: 0x0026B8F8
[Token(Token = "0x600B3DD")]
[Address(RVA = "0x4663C0", Offset = "0x4653C0", VA = "0x1804663C0")]
public static byte[] ReadSrpExtension(byte[] extensionData)
{
/*
An exception occurred when decompiling this method (0600B3DD)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsSrpUtilities::ReadSrpExtension(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1D:
stloc:ArgumentNullException(var_3_27, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("extensionData")))
}
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: 0x0600B3DE RID: 46046 RVA: 0x0026D72C File Offset: 0x0026B92C
[Token(Token = "0x600B3DE")]
[Address(RVA = "0x466490", Offset = "0x465490", VA = "0x180466490")]
public static BigInteger ReadSrpParameter(Stream input)
{
byte[] array = TlsUtilities.ReadOpaque16(input);
int length = array.Length;
BigInteger bigInteger;
bigInteger.nBits = (int)((ulong)(-1L));
int num = 0;
int[] array2 = BigInteger.MakeMagnitude(array, num, length);
bigInteger.magnitude = array2;
bool flag = array2.Length >= 1;
bigInteger.sign = (flag ? 1 : 0);
return bigInteger;
}
// Token: 0x0600B3DF RID: 46047 RVA: 0x0026D784 File Offset: 0x0026B984
[Token(Token = "0x600B3DF")]
[Address(RVA = "0x466590", Offset = "0x465590", VA = "0x180466590")]
public static void WriteSrpParameter(BigInteger x, Stream output)
{
TlsUtilities.WriteOpaque16(BigIntegers.AsUnsignedByteArray(x), output);
}
// Token: 0x0600B3E0 RID: 46048 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600B3E0")]
[Address(RVA = "0x4663B0", Offset = "0x4653B0", VA = "0x1804663B0")]
public static bool IsSrpCipherSuite(int cipherSuite)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600B3E1 RID: 46049 RVA: 0x0026D7A0 File Offset: 0x0026B9A0
[Token(Token = "0x600B3E1")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
protected TlsSrpUtilities()
{
}
}
}