124 lines
5.8 KiB
C#
124 lines
5.8 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
|
|
{
|
|
// Token: 0x02001604 RID: 5636
|
|
[Token(Token = "0x2001604")]
|
|
[StructLayout(3)]
|
|
public class DesEdeParameters : DesParameters
|
|
{
|
|
// Token: 0x0600969F RID: 38559 RVA: 0x00216E2C File Offset: 0x0021502C
|
|
[Token(Token = "0x600969F")]
|
|
[Address(RVA = "0x1DD2DD0", Offset = "0x1DD17D0", VA = "0x181DD2DD0")]
|
|
private static byte[] FixKey(byte[] key, int keyOff, int keyLen)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600969F)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.DesEdeParameters::FixKey(System.Byte[],System.Int32,System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_5C:
|
|
stloc:ArgumentException(var_9_66, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("attempt to create weak DESede key")))
|
|
}
|
|
|
|
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: 0x060096A0 RID: 38560 RVA: 0x00216EA0 File Offset: 0x002150A0
|
|
[Token(Token = "0x60096A0")]
|
|
[Address(RVA = "0x1DD3300", Offset = "0x1DD1D00", VA = "0x181DD3300")]
|
|
public DesEdeParameters(byte[] key)
|
|
{
|
|
int length = key.Length;
|
|
int num = 0;
|
|
byte[] array = DesEdeParameters.FixKey(key, num, length);
|
|
base..ctor(array);
|
|
}
|
|
|
|
// Token: 0x060096A1 RID: 38561 RVA: 0x00216ECC File Offset: 0x002150CC
|
|
[Token(Token = "0x60096A1")]
|
|
[Address(RVA = "0x1DD3380", Offset = "0x1DD1D80", VA = "0x181DD3380")]
|
|
public DesEdeParameters(byte[] key, int keyOff, int keyLen)
|
|
{
|
|
byte[] array = DesEdeParameters.FixKey(key, keyOff, keyOff);
|
|
base..ctor(array);
|
|
}
|
|
|
|
// Token: 0x060096A2 RID: 38562 RVA: 0x00216EEC File Offset: 0x002150EC
|
|
[Token(Token = "0x60096A2")]
|
|
[Address(RVA = "0x1DD3230", Offset = "0x1DD1C30", VA = "0x181DD3230")]
|
|
public static bool IsWeakKey(byte[] key, int offset, int length)
|
|
{
|
|
while (offset < length && DesParameters.IsWeakKey(key, offset))
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x060096A3 RID: 38563 RVA: 0x00216F08 File Offset: 0x00215108
|
|
[Token(Token = "0x60096A3")]
|
|
[Address(RVA = "0x1DD3200", Offset = "0x1DD1C00", VA = "0x181DD3200")]
|
|
public new static bool IsWeakKey(byte[] key, int offset)
|
|
{
|
|
int num = key.Length;
|
|
num -= offset;
|
|
return DesEdeParameters.IsWeakKey(key, offset, num);
|
|
}
|
|
|
|
// Token: 0x060096A4 RID: 38564 RVA: 0x00216F30 File Offset: 0x00215130
|
|
[Token(Token = "0x60096A4")]
|
|
[Address(RVA = "0x1DD32D0", Offset = "0x1DD1CD0", VA = "0x181DD32D0")]
|
|
public new static bool IsWeakKey(byte[] key)
|
|
{
|
|
int length = key.Length;
|
|
int num = 0;
|
|
return DesEdeParameters.IsWeakKey(key, num, length);
|
|
}
|
|
|
|
// Token: 0x060096A5 RID: 38565 RVA: 0x00216F54 File Offset: 0x00215154
|
|
[Token(Token = "0x60096A5")]
|
|
[Address(RVA = "0x1DD3090", Offset = "0x1DD1A90", VA = "0x181DD3090")]
|
|
public static bool IsRealEdeKey(byte[] key, int offset)
|
|
{
|
|
int length = key.Length;
|
|
if (length == 16)
|
|
{
|
|
}
|
|
byte b = key[offset];
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x060096A6 RID: 38566 RVA: 0x00216F80 File Offset: 0x00215180
|
|
[Token(Token = "0x60096A6")]
|
|
[Address(RVA = "0x1DD2F30", Offset = "0x1DD1930", VA = "0x181DD2F30")]
|
|
public static bool IsReal2Key(byte[] key, int offset)
|
|
{
|
|
int length = key.Length;
|
|
return true;
|
|
}
|
|
|
|
// Token: 0x060096A7 RID: 38567 RVA: 0x00216F9C File Offset: 0x0021519C
|
|
[Token(Token = "0x60096A7")]
|
|
[Address(RVA = "0x1DD2FB0", Offset = "0x1DD19B0", VA = "0x181DD2FB0")]
|
|
public static bool IsReal3Key(byte[] key, int offset)
|
|
{
|
|
int length = key.Length;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0400636C RID: 25452
|
|
[Token(Token = "0x400636C")]
|
|
public const int DesEdeKeyLength = 24;
|
|
}
|
|
}
|