229 lines
8.8 KiB
C#
229 lines
8.8 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto
|
|
{
|
|
// Token: 0x02001510 RID: 5392
|
|
[Token(Token = "0x2001510")]
|
|
[StructLayout(3)]
|
|
public abstract class PbeParametersGenerator
|
|
{
|
|
// Token: 0x06008F3E RID: 36670 RVA: 0x001FD944 File Offset: 0x001FBB44
|
|
[Token(Token = "0x6008F3E")]
|
|
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
|
protected PbeParametersGenerator()
|
|
{
|
|
}
|
|
|
|
// Token: 0x06008F3F RID: 36671 RVA: 0x001FD958 File Offset: 0x001FBB58
|
|
[Token(Token = "0x6008F3F")]
|
|
[Address(RVA = "0x1DDDA90", Offset = "0x1DDC490", VA = "0x181DDDA90", Slot = "4")]
|
|
public virtual void Init(byte[] password, byte[] salt, int iterationCount)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06008F3F)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.PbeParametersGenerator::Init(System.Byte[],System.Byte[],System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_37:
|
|
stloc:ArgumentNullException(var_3_41, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("salt")))
|
|
}
|
|
|
|
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: 0x1700172C RID: 5932
|
|
// (get) Token: 0x06008F40 RID: 36672 RVA: 0x001FD9A8 File Offset: 0x001FBBA8
|
|
[Token(Token = "0x1700172C")]
|
|
public virtual byte[] Password
|
|
{
|
|
[Token(Token = "0x6008F40")]
|
|
[Address(RVA = "0x1DDDE90", Offset = "0x1DDC890", VA = "0x181DDDE90", Slot = "5")]
|
|
get
|
|
{
|
|
return Arrays.Clone(this.mPassword);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06008F41 RID: 36673 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x6008F41")]
|
|
[Address(RVA = "0x8F27B0", Offset = "0x8F11B0", VA = "0x1808F27B0")]
|
|
[Obsolete]
|
|
public byte[] GetPassword()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x1700172D RID: 5933
|
|
// (get) Token: 0x06008F42 RID: 36674 RVA: 0x001FD9C0 File Offset: 0x001FBBC0
|
|
[Token(Token = "0x1700172D")]
|
|
public virtual byte[] Salt
|
|
{
|
|
[Token(Token = "0x6008F42")]
|
|
[Address(RVA = "0x1DDDEF0", Offset = "0x1DDC8F0", VA = "0x181DDDEF0", Slot = "6")]
|
|
get
|
|
{
|
|
return Arrays.Clone(this.mSalt);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06008F43 RID: 36675 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x6008F43")]
|
|
[Address(RVA = "0x4F7DC0", Offset = "0x4F67C0", VA = "0x1804F7DC0")]
|
|
[Obsolete]
|
|
public byte[] GetSalt()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x1700172E RID: 5934
|
|
// (get) Token: 0x06008F44 RID: 36676 RVA: 0x001FD9D8 File Offset: 0x001FBBD8
|
|
[Token(Token = "0x1700172E")]
|
|
public virtual int IterationCount
|
|
{
|
|
[Token(Token = "0x6008F44")]
|
|
[Address(RVA = "0x4FBD40", Offset = "0x4FA740", VA = "0x1804FBD40", Slot = "7")]
|
|
get
|
|
{
|
|
return this.mIterationCount;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06008F45 RID: 36677
|
|
[Token(Token = "0x6008F45")]
|
|
[Address(Slot = "8")]
|
|
[Obsolete]
|
|
public abstract ICipherParameters GenerateDerivedParameters(int keySize);
|
|
|
|
// Token: 0x06008F46 RID: 36678
|
|
[Token(Token = "0x6008F46")]
|
|
[Address(Slot = "9")]
|
|
public abstract ICipherParameters GenerateDerivedParameters(string algorithm, int keySize);
|
|
|
|
// Token: 0x06008F47 RID: 36679
|
|
[Token(Token = "0x6008F47")]
|
|
[Address(Slot = "10")]
|
|
[Obsolete]
|
|
public abstract ICipherParameters GenerateDerivedParameters(int keySize, int ivSize);
|
|
|
|
// Token: 0x06008F48 RID: 36680
|
|
[Token(Token = "0x6008F48")]
|
|
[Address(Slot = "11")]
|
|
public abstract ICipherParameters GenerateDerivedParameters(string algorithm, int keySize, int ivSize);
|
|
|
|
// Token: 0x06008F49 RID: 36681
|
|
[Token(Token = "0x6008F49")]
|
|
[Address(Slot = "12")]
|
|
public abstract ICipherParameters GenerateDerivedMacParameters(int keySize);
|
|
|
|
// Token: 0x06008F4A RID: 36682 RVA: 0x001FD9EC File Offset: 0x001FBBEC
|
|
[Token(Token = "0x6008F4A")]
|
|
[Address(RVA = "0x1DDDD60", Offset = "0x1DDC760", VA = "0x181DDDD60")]
|
|
public static byte[] Pkcs5PasswordToBytes(char[] password)
|
|
{
|
|
while (password == 0)
|
|
{
|
|
}
|
|
return Strings.ToByteArray(password);
|
|
}
|
|
|
|
// Token: 0x06008F4B RID: 36683 RVA: 0x001FDA04 File Offset: 0x001FBC04
|
|
[Token(Token = "0x6008F4B")]
|
|
[Address(RVA = "0x1DDDD10", Offset = "0x1DDC710", VA = "0x181DDDD10")]
|
|
[Obsolete]
|
|
public static byte[] Pkcs5PasswordToBytes(string password)
|
|
{
|
|
while (password == 0)
|
|
{
|
|
}
|
|
return Strings.ToByteArray(password);
|
|
}
|
|
|
|
// Token: 0x06008F4C RID: 36684 RVA: 0x001FDA1C File Offset: 0x001FBC1C
|
|
[Token(Token = "0x6008F4C")]
|
|
[Address(RVA = "0x1DDDDB0", Offset = "0x1DDC7B0", VA = "0x181DDDDB0")]
|
|
public static byte[] Pkcs5PasswordToUtf8Bytes(char[] password)
|
|
{
|
|
if (password != 0)
|
|
{
|
|
Encoding utf = Encoding.UTF8;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06008F4D RID: 36685 RVA: 0x001FDA3C File Offset: 0x001FBC3C
|
|
[Token(Token = "0x6008F4D")]
|
|
[Address(RVA = "0x1DDDE20", Offset = "0x1DDC820", VA = "0x181DDDE20")]
|
|
[Obsolete]
|
|
public static byte[] Pkcs5PasswordToUtf8Bytes(string password)
|
|
{
|
|
if (password != 0)
|
|
{
|
|
Encoding utf = Encoding.UTF8;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06008F4E RID: 36686 RVA: 0x001FDA5C File Offset: 0x001FBC5C
|
|
[Token(Token = "0x6008F4E")]
|
|
[Address(RVA = "0x1DDDB90", Offset = "0x1DDC590", VA = "0x181DDDB90")]
|
|
public static byte[] Pkcs12PasswordToBytes(char[] password)
|
|
{
|
|
if (password != 0)
|
|
{
|
|
byte[] array = new byte[password.Length];
|
|
Encoding bigEndianUnicode = Encoding.BigEndianUnicode;
|
|
int num = 0;
|
|
int length = password.Length;
|
|
byte[] bytes = bigEndianUnicode.GetBytes(password, num, length);
|
|
return array;
|
|
}
|
|
return new byte[0];
|
|
}
|
|
|
|
// Token: 0x06008F4F RID: 36687 RVA: 0x001FDAA8 File Offset: 0x001FBCA8
|
|
[Token(Token = "0x6008F4F")]
|
|
[Address(RVA = "0x1DDDC50", Offset = "0x1DDC650", VA = "0x181DDDC50")]
|
|
public static byte[] Pkcs12PasswordToBytes(char[] password, bool wrongPkcs12Zero)
|
|
{
|
|
if (password != 0)
|
|
{
|
|
byte[] array = new byte[password.Length];
|
|
Encoding bigEndianUnicode = Encoding.BigEndianUnicode;
|
|
int num = 0;
|
|
int length = password.Length;
|
|
byte[] bytes = bigEndianUnicode.GetBytes(password, num, length);
|
|
return array;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x04005E66 RID: 24166
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4005E66")]
|
|
protected byte[] mPassword;
|
|
|
|
// Token: 0x04005E67 RID: 24167
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4005E67")]
|
|
protected byte[] mSalt;
|
|
|
|
// Token: 0x04005E68 RID: 24168
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4005E68")]
|
|
protected int mIterationCount;
|
|
}
|
|
}
|