This commit is contained in:
niko
2026-04-08 23:40:05 +02:00
parent d6894bcbc7
commit 18dc73f922
7750 changed files with 1795369 additions and 0 deletions
@@ -0,0 +1,225 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
{
// Token: 0x020016B0 RID: 5808
[Token(Token = "0x20016B0")]
[StructLayout(3)]
public class DesEdeWrapEngine : IWrapper
{
// Token: 0x06009B84 RID: 39812 RVA: 0x002313CC File Offset: 0x0022F5CC
[Token(Token = "0x6009B84")]
[Address(RVA = "0x22F0960", Offset = "0x22EF360", VA = "0x1822F0960", Slot = "8")]
public virtual void Init(bool forWrapping, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (06009B84)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.DesEdeWrapEngine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_E5:
stloc:ArgumentException(var_16_F4, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("IV is not 8 octets"), ldstr:string("parameters")))
}
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: 0x170018C6 RID: 6342
// (get) Token: 0x06009B85 RID: 39813 RVA: 0x002314D0 File Offset: 0x0022F6D0
[Token(Token = "0x170018C6")]
public virtual string AlgorithmName
{
[Token(Token = "0x6009B85")]
[Address(RVA = "0x22F1590", Offset = "0x22EFF90", VA = "0x1822F1590", Slot = "9")]
get
{
return "DESede";
}
}
// Token: 0x06009B86 RID: 39814 RVA: 0x002314E4 File Offset: 0x0022F6E4
[Token(Token = "0x6009B86")]
[Address(RVA = "0x22F1180", Offset = "0x22EFB80", VA = "0x1822F1180", Slot = "10")]
public virtual byte[] Wrap(byte[] input, int inOff, int length)
{
/*
An exception occurred when decompiling this method (06009B86)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.DesEdeWrapEngine::Wrap(System.Byte[],System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_19D:
stloc:InvalidOperationException(var_34_1A7, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Not multiple of block length")))
}
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: 0x06009B87 RID: 39815 RVA: 0x0023169C File Offset: 0x0022F89C
[Token(Token = "0x6009B87")]
[Address(RVA = "0x22F0D20", Offset = "0x22EF720", VA = "0x1822F0D20", Slot = "11")]
public virtual byte[] Unwrap(byte[] input, int inOff, int length)
{
/*
An exception occurred when decompiling this method (06009B87)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.DesEdeWrapEngine::Unwrap(System.Byte[],System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1C0:
stloc:InvalidCipherTextException(var_39_1D0, newobj:InvalidCipherTextException(InvalidCipherTextException::.ctor, call:string(string::Concat, ldstr:string[exp:object]("Ciphertext not multiple of "), ldloc:int32[exp:object](var_2))))
}
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.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: 0x06009B88 RID: 39816 RVA: 0x0023187C File Offset: 0x0022FA7C
[Token(Token = "0x6009B88")]
[Address(RVA = "0x22F0710", Offset = "0x22EF110", VA = "0x1822F0710")]
private byte[] CalculateCmsKeyChecksum(byte[] key)
{
IDigest digest = this.sha1;
int num = 0;
num += num;
num++;
int num2 = 0;
IDigest digest2 = this.sha1;
if (num < num2)
{
num += num;
num++;
}
byte[] array = new byte[8];
byte[] array2 = this.digest;
int num3 = 0;
int num4 = 0;
ulong num5;
Array.Copy(array2, num4, array, num3, (int)num5);
return array;
}
// Token: 0x06009B89 RID: 39817 RVA: 0x002318EC File Offset: 0x0022FAEC
[Token(Token = "0x6009B89")]
[Address(RVA = "0x22F08E0", Offset = "0x22EF2E0", VA = "0x1822F08E0")]
private bool CheckCmsKeyChecksum(byte[] key, byte[] checksum)
{
return Arrays.ConstantTimeAreEqual(this.CalculateCmsKeyChecksum(key), checksum);
}
// Token: 0x06009B8A RID: 39818 RVA: 0x00231908 File Offset: 0x0022FB08
[Token(Token = "0x6009B8A")]
[Address(RVA = "0x22F15C0", Offset = "0x22EFFC0", VA = "0x1822F15C0")]
private static byte[] reverse(byte[] bs)
{
byte[] array = new byte[bs.Length];
int num = 0;
int num2 = bs.Length;
if (num < num2)
{
num2 -= num;
num++;
}
return array;
}
// Token: 0x06009B8B RID: 39819 RVA: 0x00231940 File Offset: 0x0022FB40
[Token(Token = "0x6009B8B")]
[Address(RVA = "0x22F1520", Offset = "0x22EFF20", VA = "0x1822F1520")]
public DesEdeWrapEngine()
{
Sha1Digest sha1Digest = new Sha1Digest();
this.sha1 = sha1Digest;
byte[] array = new byte[20];
this.digest = array;
base..ctor();
}
// Token: 0x06009B8C RID: 39820 RVA: 0x00231970 File Offset: 0x0022FB70
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6009B8C")]
[Address(RVA = "0x22F14C0", Offset = "0x22EFEC0", VA = "0x1822F14C0")]
static DesEdeWrapEngine()
{
byte[] array = new byte[8];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.6DFD60679846B0E2064404E9EA3E1DDCE2C5709D).FieldHandle);
DesEdeWrapEngine.IV2 = array;
}
// Token: 0x04006600 RID: 26112
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006600")]
private CbcBlockCipher engine;
// Token: 0x04006601 RID: 26113
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006601")]
private KeyParameter param;
// Token: 0x04006602 RID: 26114
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006602")]
private ParametersWithIV paramPlusIV;
// Token: 0x04006603 RID: 26115
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006603")]
private byte[] iv;
// Token: 0x04006604 RID: 26116
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006604")]
private bool forWrapping;
// Token: 0x04006605 RID: 26117
[Token(Token = "0x4006605")]
private static readonly byte[] IV2;
// Token: 0x04006606 RID: 26118
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006606")]
private readonly IDigest sha1;
// Token: 0x04006607 RID: 26119
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006607")]
private readonly byte[] digest;
}
}