Files
2026-04-08 23:40:05 +02:00

745 lines
35 KiB
C#

using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security
{
// Token: 0x020013D3 RID: 5075
[Token(Token = "0x20013D3")]
[StructLayout(3)]
public sealed class PbeUtilities
{
// Token: 0x06008132 RID: 33074 RVA: 0x001B700C File Offset: 0x001B520C
[Token(Token = "0x6008132")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
private PbeUtilities()
{
}
// Token: 0x06008133 RID: 33075 RVA: 0x001B7020 File Offset: 0x001B5220
[Token(Token = "0x6008133")]
[Address(RVA = "0x486CD0", Offset = "0x4856D0", VA = "0x180486CD0")]
static PbeUtilities()
{
/*
An exception occurred when decompiling this method (06008133)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Security.PbeUtilities::.cctor()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IDictionary(var_1_07, call:IDictionary(Platform::CreateHashtable))
stsfld:IDictionary(PbeUtilities::algorithms, ldloc:IDictionary(var_1_07))
stloc:IDictionary(var_3_15, call:IDictionary(Platform::CreateHashtable))
stsfld:IDictionary(PbeUtilities::algorithmType, ldloc:IDictionary(var_3_15))
stsfld:IDictionary(PbeUtilities::oids, call:IDictionary(Platform::CreateHashtable))
stloc:IDictionary(var_5_2E, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_7_35, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_9_3C, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_10_43, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::IdPbeS2))
stloc:IDictionary(var_12_4A, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_14_51, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_15_58, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithMD2AndDesCbc))
stloc:IDictionary(var_17_5F, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_19_66, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_20_6D, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithMD2AndRC2Cbc))
stloc:IDictionary(var_22_74, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_24_7B, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_25_82, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithMD5AndDesCbc))
stloc:IDictionary(var_27_89, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_29_90, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_30_97, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithMD5AndRC2Cbc))
stloc:IDictionary(var_32_9E, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_34_A5, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_36_AC, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_38_B3, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_40_BA, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_41_C1, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithSha1AndDesCbc))
stloc:IDictionary(var_43_C8, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_45_CF, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_47_D6, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_49_DD, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_51_E4, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_52_EB, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithSha1AndRC2Cbc))
stloc:IDictionary(var_54_F2, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_56_F9, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_57_100, ldsfld:DerObjectIdentifier(BCObjectIdentifiers::bc_pbe_sha1_pkcs12_aes128_cbc))
stloc:IDictionary(var_59_107, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_60_10E, ldsfld:DerObjectIdentifier(BCObjectIdentifiers::bc_pbe_sha1_pkcs12_aes192_cbc))
stloc:IDictionary(var_62_115, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_63_11C, ldsfld:DerObjectIdentifier(BCObjectIdentifiers::bc_pbe_sha1_pkcs12_aes256_cbc))
stloc:IDictionary(var_65_123, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_66_12A, ldsfld:DerObjectIdentifier(BCObjectIdentifiers::bc_pbe_sha256_pkcs12_aes128_cbc))
stloc:IDictionary(var_68_131, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_69_138, ldsfld:DerObjectIdentifier(BCObjectIdentifiers::bc_pbe_sha256_pkcs12_aes192_cbc))
stloc:IDictionary(var_71_13F, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_72_146, ldsfld:DerObjectIdentifier(BCObjectIdentifiers::bc_pbe_sha256_pkcs12_aes256_cbc))
stloc:IDictionary(var_74_14D, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_76_154, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_78_15B, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_80_162, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_81_169, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithShaAnd128BitRC4))
stloc:IDictionary(var_83_170, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_85_177, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_87_17E, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_89_185, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_90_18C, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithShaAnd40BitRC4))
stloc:IDictionary(var_92_193, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_94_19A, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_96_1A1, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_98_1A8, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_100_1AF, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_102_1B6, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_104_1BD, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_105_1C4, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithShaAnd3KeyTripleDesCbc))
stloc:IDictionary(var_107_1CB, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_109_1D2, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_111_1D9, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_113_1E0, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_115_1E7, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_117_1EE, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_119_1F5, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_120_1FC, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithShaAnd2KeyTripleDesCbc))
stloc:IDictionary(var_122_203, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_124_20A, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_126_211, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_128_218, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_129_21F, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbeWithShaAnd128BitRC2Cbc))
stloc:IDictionary(var_131_226, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_133_22D, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_135_234, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_137_23B, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:DerObjectIdentifier(var_138_242, ldsfld:DerObjectIdentifier(PkcsObjectIdentifiers::PbewithShaAnd40BitRC2Cbc))
stloc:IDictionary(var_140_249, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_142_250, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_144_257, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_146_25E, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_148_265, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_150_26C, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_152_273, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_154_27A, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_156_281, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_158_288, ldsfld:IDictionary(PbeUtilities::algorithms))
stloc:IDictionary(var_160_28F, ldsfld:IDictionary(PbeUtilities::algorithms))
}
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: 0x06008134 RID: 33076 RVA: 0x001B72C0 File Offset: 0x001B54C0
[Token(Token = "0x6008134")]
[Address(RVA = "0x486B20", Offset = "0x485520", VA = "0x180486B20")]
private static PbeParametersGenerator MakePbeGenerator(string type, IDigest digest, byte[] key, byte[] salt, int iterationCount)
{
/*
An exception occurred when decompiling this method (06008134)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.PbeParametersGenerator BestHTTP.SecureProtocol.Org.BouncyCastle.Security.PbeUtilities::MakePbeGenerator(System.String,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDigest,System.Byte[],System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_5D:
stloc:ArgumentException(var_5_69, newobj:ArgumentException(ArgumentException::.ctor, ldloc:string(var_4), ldstr:string("type")))
}
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.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: 0x06008135 RID: 33077 RVA: 0x001B7338 File Offset: 0x001B5538
[Token(Token = "0x6008135")]
[Address(RVA = "0x486320", Offset = "0x484D20", VA = "0x180486320")]
public static DerObjectIdentifier GetObjectIdentifier(string mechanism)
{
string text;
do
{
IDictionary dictionary = PbeUtilities.algorithms;
text = Platform.ToUpperInvariant(mechanism);
if (text == 0)
{
goto IL_2A;
}
}
while (text == 0);
IDictionary dictionary2 = PbeUtilities.oids;
IDictionary dictionary3 = PbeUtilities.algorithms;
IL_2A:
throw new NullReferenceException();
}
// Token: 0x17001505 RID: 5381
// (get) Token: 0x06008136 RID: 33078 RVA: 0x001B7378 File Offset: 0x001B5578
[Token(Token = "0x17001505")]
public static ICollection Algorithms
{
[Token(Token = "0x6008136")]
[Address(RVA = "0x4895A0", Offset = "0x487FA0", VA = "0x1804895A0")]
get
{
IDictionary dictionary = PbeUtilities.oids;
throw new NullReferenceException();
}
}
// Token: 0x06008137 RID: 33079 RVA: 0x001B7390 File Offset: 0x001B5590
[Token(Token = "0x6008137")]
[Address(RVA = "0x486730", Offset = "0x485130", VA = "0x180486730")]
public static bool IsPkcs12(string algorithm)
{
string text;
do
{
IDictionary dictionary = PbeUtilities.algorithms;
text = Platform.ToUpperInvariant(algorithm);
if (text == 0)
{
goto IL_1B;
}
}
while (text == 0);
IDictionary dictionary2 = PbeUtilities.algorithmType;
IL_1B:
throw new NullReferenceException();
}
// Token: 0x06008138 RID: 33080 RVA: 0x001B73C0 File Offset: 0x001B55C0
[Token(Token = "0x6008138")]
[Address(RVA = "0x486880", Offset = "0x485280", VA = "0x180486880")]
public static bool IsPkcs5Scheme1(string algorithm)
{
string text;
do
{
IDictionary dictionary = PbeUtilities.algorithms;
text = Platform.ToUpperInvariant(algorithm);
if (text == 0)
{
goto IL_1B;
}
}
while (text == 0);
IDictionary dictionary2 = PbeUtilities.algorithmType;
IL_1B:
throw new NullReferenceException();
}
// Token: 0x06008139 RID: 33081 RVA: 0x001B73F0 File Offset: 0x001B55F0
[Token(Token = "0x6008139")]
[Address(RVA = "0x4869D0", Offset = "0x4853D0", VA = "0x1804869D0")]
public static bool IsPkcs5Scheme2(string algorithm)
{
string text;
do
{
IDictionary dictionary = PbeUtilities.algorithms;
text = Platform.ToUpperInvariant(algorithm);
if (text == 0)
{
goto IL_1B;
}
}
while (text == 0);
IDictionary dictionary2 = PbeUtilities.algorithmType;
IL_1B:
throw new NullReferenceException();
}
// Token: 0x0600813A RID: 33082 RVA: 0x001B7420 File Offset: 0x001B5620
[Token(Token = "0x600813A")]
[Address(RVA = "0x4864B0", Offset = "0x484EB0", VA = "0x1804864B0")]
public static bool IsOpenSsl(string algorithm)
{
string text;
do
{
IDictionary dictionary = PbeUtilities.algorithms;
text = Platform.ToUpperInvariant(algorithm);
if (text == 0)
{
goto IL_1B;
}
}
while (text == 0);
IDictionary dictionary2 = PbeUtilities.algorithmType;
IL_1B:
throw new NullReferenceException();
}
// Token: 0x0600813B RID: 33083 RVA: 0x001B7450 File Offset: 0x001B5650
[Token(Token = "0x600813B")]
[Address(RVA = "0x486600", Offset = "0x485000", VA = "0x180486600")]
public static bool IsPbeAlgorithm(string algorithm)
{
string text;
do
{
IDictionary dictionary = PbeUtilities.algorithms;
text = Platform.ToUpperInvariant(algorithm);
if (text == 0)
{
goto IL_1D;
}
}
while (text == 0);
IDictionary dictionary2 = PbeUtilities.algorithmType;
bool flag;
return flag;
IL_1D:
throw new NullReferenceException();
}
// Token: 0x0600813C RID: 33084 RVA: 0x001B7484 File Offset: 0x001B5684
[Token(Token = "0x600813C")]
[Address(RVA = "0x484DE0", Offset = "0x4837E0", VA = "0x180484DE0")]
public static Asn1Encodable GenerateAlgorithmParameters(DerObjectIdentifier algorithmOid, byte[] salt, int iterationCount)
{
string identifier = algorithmOid.identifier;
if (!PbeUtilities.IsPkcs12(identifier))
{
if (!PbeUtilities.IsPkcs5Scheme2(identifier))
{
PbeParameter pbeParameter = new PbeParameter(salt, iterationCount);
}
Pbkdf2Params pbkdf2Params = new Pbkdf2Params(salt, iterationCount);
}
Pkcs12PbeParams pkcs12PbeParams = new Pkcs12PbeParams(salt, iterationCount);
throw new NullReferenceException();
}
// Token: 0x0600813D RID: 33085 RVA: 0x001B74C8 File Offset: 0x001B56C8
[Token(Token = "0x600813D")]
[Address(RVA = "0x484F60", Offset = "0x483960", VA = "0x180484F60")]
public static Asn1Encodable GenerateAlgorithmParameters(string algorithm, byte[] salt, int iterationCount)
{
/*
An exception occurred when decompiling this method (0600813D)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Encodable BestHTTP.SecureProtocol.Org.BouncyCastle.Security.PbeUtilities::GenerateAlgorithmParameters(System.String,System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_22:
stloc:Pkcs12PbeParams(var_2_29, newobj:Pkcs12PbeParams(Pkcs12PbeParams::.ctor, ldloc:uint8[](salt), ldloc:int32(iterationCount)))
}
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: 0x0600813E RID: 33086 RVA: 0x001B7500 File Offset: 0x001B5700
[Token(Token = "0x600813E")]
[Address(RVA = "0x485340", Offset = "0x483D40", VA = "0x180485340")]
public static ICipherParameters GenerateCipherParameters(DerObjectIdentifier algorithmOid, char[] password, Asn1Encodable pbeParameters)
{
string identifier = algorithmOid.identifier;
int num = 0;
return PbeUtilities.GenerateCipherParameters(identifier, password, num != 0, pbeParameters);
}
// Token: 0x0600813F RID: 33087 RVA: 0x001B7528 File Offset: 0x001B5728
[Token(Token = "0x600813F")]
[Address(RVA = "0x485090", Offset = "0x483A90", VA = "0x180485090")]
public static ICipherParameters GenerateCipherParameters(DerObjectIdentifier algorithmOid, char[] password, bool wrongPkcs12Zero, Asn1Encodable pbeParameters)
{
return PbeUtilities.GenerateCipherParameters(algorithmOid.identifier, password, wrongPkcs12Zero, pbeParameters);
}
// Token: 0x06008140 RID: 33088 RVA: 0x001B754C File Offset: 0x001B574C
[Token(Token = "0x6008140")]
[Address(RVA = "0x485130", Offset = "0x483B30", VA = "0x180485130")]
public static ICipherParameters GenerateCipherParameters(AlgorithmIdentifier algID, char[] password)
{
Asn1Object asn1Object = algID.ToAsn1Object();
DerObjectIdentifier objectID = algID.ObjectID;
ICipherParameters cipherParameters;
return cipherParameters;
}
// Token: 0x06008141 RID: 33089 RVA: 0x001B7570 File Offset: 0x001B5770
[Token(Token = "0x6008141")]
[Address(RVA = "0x485270", Offset = "0x483C70", VA = "0x180485270")]
public static ICipherParameters GenerateCipherParameters(AlgorithmIdentifier algID, char[] password, bool wrongPkcs12Zero)
{
Asn1Object asn1Object = algID.ToAsn1Object();
DerObjectIdentifier objectID = algID.ObjectID;
ICipherParameters cipherParameters;
return cipherParameters;
}
// Token: 0x06008142 RID: 33090 RVA: 0x001B7594 File Offset: 0x001B5794
[Token(Token = "0x6008142")]
[Address(RVA = "0x4851F0", Offset = "0x483BF0", VA = "0x1804851F0")]
public static ICipherParameters GenerateCipherParameters(string algorithm, char[] password, Asn1Encodable pbeParameters)
{
int num = 0;
return PbeUtilities.GenerateCipherParameters(algorithm, password, num != 0, pbeParameters);
}
// Token: 0x06008143 RID: 33091 RVA: 0x001B75AC File Offset: 0x001B57AC
[Token(Token = "0x6008143")]
[Address(RVA = "0x4853D0", Offset = "0x483DD0", VA = "0x1804853D0")]
public static ICipherParameters GenerateCipherParameters(string algorithm, char[] password, bool wrongPkcs12Zero, Asn1Encodable pbeParameters)
{
int num;
for (;;)
{
IDictionary dictionary = PbeUtilities.algorithms;
string text = Platform.ToUpperInvariant(algorithm);
num = 0;
if (text == 0 || text != 0)
{
if (PbeUtilities.IsPkcs12(num))
{
goto IL_4D;
}
int num2;
if (!PbeUtilities.IsPkcs5Scheme2(num))
{
PbeParameter instance = PbeParameter.GetInstance(pbeParameters);
byte[] salt = instance.GetSalt();
num2 = instance.IterationCount.IntValue;
byte[] array = PbeParametersGenerator.Pkcs5PasswordToBytes(password);
goto IL_4D;
}
IL_6C:
if (PbeUtilities.IsPkcs5Scheme2(num))
{
goto IL_1D3;
}
if (Platform.StartsWith(num, "PBEwithSHA-1"))
{
goto IL_14E;
}
if (Platform.StartsWith(num, "PBEwithSHA-256"))
{
goto IL_128;
}
if (Platform.StartsWith(num, "PBEwithMD5"))
{
goto IL_FA;
}
if (Platform.StartsWith(num, "PBEwithMD2"))
{
break;
}
if (!Platform.StartsWith(num, "PBEwithHmac"))
{
goto IL_29A;
}
string text2;
IDigest digest = DigestUtilities.GetDigest(text2);
IDictionary dictionary2 = PbeUtilities.algorithmType;
if (digest == 0 || digest != 0)
{
break;
}
continue;
IL_4D:
Pkcs12PbeParams instance2 = Pkcs12PbeParams.GetInstance(pbeParameters);
byte[] iv = instance2.GetIV();
num2 = instance2.Iterations.IntValue;
goto IL_6C;
}
}
IDictionary dictionary3 = PbeUtilities.algorithmType;
MD2Digest md2Digest = new MD2Digest();
bool flag;
if (flag)
{
goto IL_19A;
}
IL_FA:
IDictionary dictionary4 = PbeUtilities.algorithmType;
MD5Digest md5Digest = new MD5Digest();
bool flag2;
bool flag3;
if (flag2 || flag3)
{
goto IL_19A;
}
bool flag4;
if (flag4)
{
goto IL_1C0;
}
bool flag5;
if (flag5)
{
goto IL_1AD;
}
IL_128:
IDictionary dictionary5 = PbeUtilities.algorithmType;
Sha256Digest sha256Digest = new Sha256Digest();
bool flag6;
if (flag6)
{
goto IL_1C0;
}
bool flag7;
if (flag7)
{
goto IL_1AD;
}
bool flag8;
if (!flag8)
{
goto IL_29A;
}
IL_14E:
IDictionary dictionary6 = PbeUtilities.algorithmType;
Sha1Digest sha1Digest = new Sha1Digest();
bool flag9;
if (flag9)
{
goto IL_1C0;
}
bool flag10;
if (flag10)
{
goto IL_1AD;
}
bool flag11;
while (flag11)
{
}
bool flag12;
bool flag13;
if (flag12 || flag13)
{
goto IL_1AD;
}
bool flag14;
bool flag15;
bool flag16;
bool flag17;
bool flag18;
bool flag19;
if (!flag14 && !flag15 && !flag16 && !flag17 && !flag18 && !flag19)
{
goto IL_29A;
}
IL_19A:
PbeParametersGenerator pbeParametersGenerator;
ICipherParameters cipherParameters = pbeParametersGenerator.GenerateDerivedParameters("DESEDE", 192);
IL_1AD:
ICipherParameters cipherParameters2 = pbeParametersGenerator.GenerateDerivedParameters("AES", 128);
IL_1C0:
ICipherParameters cipherParameters3 = pbeParametersGenerator.GenerateDerivedParameters("AES", 128);
IL_1D3:
PbeS2Parameters pbeS2Parameters;
EncryptionScheme scheme = pbeS2Parameters.scheme;
Asn1Object asn1Object = scheme.ToAsn1Object();
Asn1Object asn1Object2 = scheme.ObjectID.ToAsn1Object();
Pbkdf2Params instance3 = Pbkdf2Params.GetInstance(pbeS2Parameters.func.ObjectID.ToAsn1Object());
Asn1OctetString instance4 = Asn1OctetString.GetInstance(asn1Object2);
Stream octetStream = instance4.GetOctetStream();
byte[] iv2 = RC2CbcParameter.GetInstance(instance4).GetIV();
byte[] salt2 = instance3.GetSalt();
int intValue = instance3.IterationCount.IntValue;
byte[] array2 = PbeParametersGenerator.Pkcs5PasswordToBytes(password);
if (instance3.KeyLength != 0)
{
int intValue2 = instance3.KeyLength.IntValue;
}
IDictionary dictionary7 = PbeUtilities.algorithmType;
ParametersWithIV parametersWithIV;
if (iv2 != 0)
{
byte[] array3 = new byte[iv2.Length];
if (!Arrays.AreEqual(iv2, array3))
{
ICipherParameters cipherParameters4;
parametersWithIV = new ParametersWithIV(cipherParameters4, iv2);
}
}
IL_29A:
int length = array2.Length;
int num3 = 0;
Array.Clear(array2, num3, length);
return PbeUtilities.FixDesParity(num, parametersWithIV);
}
// Token: 0x06008144 RID: 33092 RVA: 0x001B7878 File Offset: 0x001B5A78
[Token(Token = "0x6008144")]
[Address(RVA = "0x484950", Offset = "0x483350", VA = "0x180484950")]
public static object CreateEngine(DerObjectIdentifier algorithmOid)
{
return PbeUtilities.CreateEngine(algorithmOid.identifier);
}
// Token: 0x06008145 RID: 33093 RVA: 0x001B7898 File Offset: 0x001B5A98
[Token(Token = "0x6008145")]
[Address(RVA = "0x4849B0", Offset = "0x4833B0", VA = "0x1804849B0")]
public static object CreateEngine(AlgorithmIdentifier algID)
{
Asn1Object asn1Object = algID.ToAsn1Object();
bool flag;
if (!flag)
{
object obj;
return obj;
}
Asn1Object asn1Object2 = PbeS2Parameters.GetInstance(algID.ObjectID.ToAsn1Object()).scheme.ToAsn1Object();
throw new NullReferenceException();
}
// Token: 0x06008146 RID: 33094 RVA: 0x001B78D4 File Offset: 0x001B5AD4
[Token(Token = "0x6008146")]
[Address(RVA = "0x4844C0", Offset = "0x482EC0", VA = "0x1804844C0")]
public static object CreateEngine(string algorithm)
{
string text;
int num;
do
{
IDictionary dictionary = PbeUtilities.algorithms;
text = Platform.ToUpperInvariant(algorithm);
num = 0;
}
while (text != 0 && text == 0);
if (!Platform.StartsWith(num, "PBEwithHmac"))
{
if (Platform.StartsWith(num, "PBEwithMD2") || Platform.StartsWith(num, "PBEwithMD5") || Platform.StartsWith(num, "PBEwithSHA-1") || Platform.StartsWith(num, "PBEwithSHA-256"))
{
if (Platform.EndsWith(num, "AES-CBC-BC") || Platform.EndsWith(num, "AES-CBC-OPENSSL"))
{
goto IL_E9;
}
if (Platform.EndsWith(num, "DES-CBC"))
{
goto IL_DD;
}
if (Platform.EndsWith(num, "DESEDE-CBC"))
{
goto IL_D1;
}
if (Platform.EndsWith(num, "RC2-CBC"))
{
goto IL_C5;
}
if (!Platform.EndsWith(num, "RC4"))
{
}
}
IBufferedCipher cipher = CipherUtilities.GetCipher("RC4");
IL_C5:
IBufferedCipher cipher2 = CipherUtilities.GetCipher("RC2/CBC");
IL_D1:
IBufferedCipher cipher3 = CipherUtilities.GetCipher("DESEDE/CBC");
IL_DD:
IBufferedCipher cipher4 = CipherUtilities.GetCipher("DES/CBC");
IL_E9:
IBufferedCipher cipher5 = CipherUtilities.GetCipher("AES/CBC");
}
string text2;
IMac mac = MacUtilities.GetMac("HMAC/" + text2);
throw new NullReferenceException();
}
// Token: 0x06008147 RID: 33095 RVA: 0x001B79F4 File Offset: 0x001B5BF4
[Token(Token = "0x6008147")]
[Address(RVA = "0x486270", Offset = "0x484C70", VA = "0x180486270")]
public static string GetEncodingName(DerObjectIdentifier oid)
{
IDictionary dictionary = PbeUtilities.algorithms;
throw new NullReferenceException();
}
// Token: 0x06008148 RID: 33096 RVA: 0x001B7A0C File Offset: 0x001B5C0C
[Token(Token = "0x6008148")]
[Address(RVA = "0x484B50", Offset = "0x483550", VA = "0x180484B50")]
private static ICipherParameters FixDesParity(string mechanism, ICipherParameters parameters)
{
while (Platform.EndsWith(mechanism, "DES-CBC") || Platform.EndsWith(mechanism, "DESEDE-CBC"))
{
byte[] array;
if (parameters == 0)
{
if (parameters == 0 || parameters == 0)
{
continue;
}
DesParameters.SetOddParity(array);
KeyParameter keyParameter = new KeyParameter(array);
}
byte b = array[33];
ICipherParameters cipherParameters;
byte[] array2;
ParametersWithIV parametersWithIV = new ParametersWithIV(cipherParameters, array2);
throw new NullReferenceException();
}
return parameters;
}
// Token: 0x04005BA0 RID: 23456
[Token(Token = "0x4005BA0")]
private const string Pkcs5S1 = "Pkcs5S1";
// Token: 0x04005BA1 RID: 23457
[Token(Token = "0x4005BA1")]
private const string Pkcs5S2 = "Pkcs5S2";
// Token: 0x04005BA2 RID: 23458
[Token(Token = "0x4005BA2")]
private const string Pkcs12 = "Pkcs12";
// Token: 0x04005BA3 RID: 23459
[Token(Token = "0x4005BA3")]
private const string OpenSsl = "OpenSsl";
// Token: 0x04005BA4 RID: 23460
[Token(Token = "0x4005BA4")]
private static readonly IDictionary algorithms;
// Token: 0x04005BA5 RID: 23461
[Token(Token = "0x4005BA5")]
private static readonly IDictionary algorithmType;
// Token: 0x04005BA6 RID: 23462
[Token(Token = "0x4005BA6")]
private static readonly IDictionary oids;
}
}