using System; using System.Collections; using System.IO; 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: 0x020019B0 RID: 6576 [Token(Token = "0x20019B0")] public sealed class PbeUtilities { // Token: 0x06009D0C RID: 40204 RVA: 0x0020E5CC File Offset: 0x0020C7CC [Token(Token = "0x6009D0C")] [Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")] private PbeUtilities() { } // Token: 0x06009D0D RID: 40205 RVA: 0x0020E5E0 File Offset: 0x0020C7E0 [Token(Token = "0x6009D0D")] [Address(RVA = "0x1B1C840", Offset = "0x1B1B640", VA = "0x181B1C840")] static PbeUtilities() { /* An exception occurred when decompiling this method (06009D0D) 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 1660 */; } // Token: 0x06009D0E RID: 40206 RVA: 0x0020E880 File Offset: 0x0020CA80 [Token(Token = "0x6009D0E")] [Address(RVA = "0x1B1C690", Offset = "0x1B1B490", VA = "0x181B1C690")] private static PbeParametersGenerator MakePbeGenerator(string type, IDigest digest, byte[] key, byte[] salt, int iterationCount) { /* An exception occurred when decompiling this method (06009D0E) 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 1660 */; } // Token: 0x06009D0F RID: 40207 RVA: 0x0020E8F8 File Offset: 0x0020CAF8 [Token(Token = "0x6009D0F")] [Address(RVA = "0x1B1BE90", Offset = "0x1B1AC90", VA = "0x181B1BE90")] 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: 0x17001906 RID: 6406 // (get) Token: 0x06009D10 RID: 40208 RVA: 0x0020E938 File Offset: 0x0020CB38 [Token(Token = "0x17001906")] public static ICollection Algorithms { [Token(Token = "0x6009D10")] [Address(RVA = "0x1B1F110", Offset = "0x1B1DF10", VA = "0x181B1F110")] get { IDictionary dictionary = PbeUtilities.oids; throw new NullReferenceException(); } } // Token: 0x06009D11 RID: 40209 RVA: 0x0020E950 File Offset: 0x0020CB50 [Token(Token = "0x6009D11")] [Address(RVA = "0x1B1C2A0", Offset = "0x1B1B0A0", VA = "0x181B1C2A0")] 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: 0x06009D12 RID: 40210 RVA: 0x0020E980 File Offset: 0x0020CB80 [Token(Token = "0x6009D12")] [Address(RVA = "0x1B1C3F0", Offset = "0x1B1B1F0", VA = "0x181B1C3F0")] 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: 0x06009D13 RID: 40211 RVA: 0x0020E9B0 File Offset: 0x0020CBB0 [Token(Token = "0x6009D13")] [Address(RVA = "0x1B1C540", Offset = "0x1B1B340", VA = "0x181B1C540")] 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: 0x06009D14 RID: 40212 RVA: 0x0020E9E0 File Offset: 0x0020CBE0 [Token(Token = "0x6009D14")] [Address(RVA = "0x1B1C020", Offset = "0x1B1AE20", VA = "0x181B1C020")] 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: 0x06009D15 RID: 40213 RVA: 0x0020EA10 File Offset: 0x0020CC10 [Token(Token = "0x6009D15")] [Address(RVA = "0x1B1C170", Offset = "0x1B1AF70", VA = "0x181B1C170")] 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: 0x06009D16 RID: 40214 RVA: 0x0020EA44 File Offset: 0x0020CC44 [Token(Token = "0x6009D16")] [Address(RVA = "0x1B1A990", Offset = "0x1B19790", VA = "0x181B1A990")] 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: 0x06009D17 RID: 40215 RVA: 0x0020EA88 File Offset: 0x0020CC88 [Token(Token = "0x6009D17")] [Address(RVA = "0x1B1AB10", Offset = "0x1B19910", VA = "0x181B1AB10")] public static Asn1Encodable GenerateAlgorithmParameters(string algorithm, byte[] salt, int iterationCount) { /* An exception occurred when decompiling this method (06009D17) 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 1660 */; } // Token: 0x06009D18 RID: 40216 RVA: 0x0020EAC0 File Offset: 0x0020CCC0 [Token(Token = "0x6009D18")] [Address(RVA = "0x1B1AEF0", Offset = "0x1B19CF0", VA = "0x181B1AEF0")] 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: 0x06009D19 RID: 40217 RVA: 0x0020EAE8 File Offset: 0x0020CCE8 [Token(Token = "0x6009D19")] [Address(RVA = "0x1B1AC40", Offset = "0x1B19A40", VA = "0x181B1AC40")] public static ICipherParameters GenerateCipherParameters(DerObjectIdentifier algorithmOid, char[] password, bool wrongPkcs12Zero, Asn1Encodable pbeParameters) { return PbeUtilities.GenerateCipherParameters(algorithmOid.identifier, password, wrongPkcs12Zero, pbeParameters); } // Token: 0x06009D1A RID: 40218 RVA: 0x0020EB0C File Offset: 0x0020CD0C [Token(Token = "0x6009D1A")] [Address(RVA = "0x1B1ACE0", Offset = "0x1B19AE0", VA = "0x181B1ACE0")] public static ICipherParameters GenerateCipherParameters(AlgorithmIdentifier algID, char[] password) { Asn1Object asn1Object = algID.ToAsn1Object(); DerObjectIdentifier objectID = algID.ObjectID; ICipherParameters cipherParameters; return cipherParameters; } // Token: 0x06009D1B RID: 40219 RVA: 0x0020EB30 File Offset: 0x0020CD30 [Token(Token = "0x6009D1B")] [Address(RVA = "0x1B1AE20", Offset = "0x1B19C20", VA = "0x181B1AE20")] public static ICipherParameters GenerateCipherParameters(AlgorithmIdentifier algID, char[] password, bool wrongPkcs12Zero) { Asn1Object asn1Object = algID.ToAsn1Object(); DerObjectIdentifier objectID = algID.ObjectID; ICipherParameters cipherParameters; return cipherParameters; } // Token: 0x06009D1C RID: 40220 RVA: 0x0020EB54 File Offset: 0x0020CD54 [Token(Token = "0x6009D1C")] [Address(RVA = "0x1B1ADA0", Offset = "0x1B19BA0", VA = "0x181B1ADA0")] public static ICipherParameters GenerateCipherParameters(string algorithm, char[] password, Asn1Encodable pbeParameters) { int num = 0; return PbeUtilities.GenerateCipherParameters(algorithm, password, num != 0, pbeParameters); } // Token: 0x06009D1D RID: 40221 RVA: 0x0020EB6C File Offset: 0x0020CD6C [Token(Token = "0x6009D1D")] [Address(RVA = "0x1B1AF80", Offset = "0x1B19D80", VA = "0x181B1AF80")] 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: 0x06009D1E RID: 40222 RVA: 0x0020EE38 File Offset: 0x0020D038 [Token(Token = "0x6009D1E")] [Address(RVA = "0x1B1A560", Offset = "0x1B19360", VA = "0x181B1A560")] public static object CreateEngine(DerObjectIdentifier algorithmOid) { return PbeUtilities.CreateEngine(algorithmOid.identifier); } // Token: 0x06009D1F RID: 40223 RVA: 0x0020EE58 File Offset: 0x0020D058 [Token(Token = "0x6009D1F")] [Address(RVA = "0x1B1A5C0", Offset = "0x1B193C0", VA = "0x181B1A5C0")] 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: 0x06009D20 RID: 40224 RVA: 0x0020EE94 File Offset: 0x0020D094 [Token(Token = "0x6009D20")] [Address(RVA = "0x1B1A0D0", Offset = "0x1B18ED0", VA = "0x181B1A0D0")] 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: 0x06009D21 RID: 40225 RVA: 0x0020EFB4 File Offset: 0x0020D1B4 [Token(Token = "0x6009D21")] [Address(RVA = "0x1B1BDE0", Offset = "0x1B1ABE0", VA = "0x181B1BDE0")] public static string GetEncodingName(DerObjectIdentifier oid) { IDictionary dictionary = PbeUtilities.algorithms; throw new NullReferenceException(); } // Token: 0x06009D22 RID: 40226 RVA: 0x0020EFCC File Offset: 0x0020D1CC [Token(Token = "0x6009D22")] [Address(RVA = "0x1B1A700", Offset = "0x1B19500", VA = "0x181B1A700")] 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: 0x040069E3 RID: 27107 [Token(Token = "0x40069E3")] private const string Pkcs5S1 = "Pkcs5S1"; // Token: 0x040069E4 RID: 27108 [Token(Token = "0x40069E4")] private const string Pkcs5S2 = "Pkcs5S2"; // Token: 0x040069E5 RID: 27109 [Token(Token = "0x40069E5")] private const string Pkcs12 = "Pkcs12"; // Token: 0x040069E6 RID: 27110 [Token(Token = "0x40069E6")] private const string OpenSsl = "OpenSsl"; // Token: 0x040069E7 RID: 27111 [Token(Token = "0x40069E7")] private static readonly IDictionary algorithms; // Token: 0x040069E8 RID: 27112 [Token(Token = "0x40069E8")] private static readonly IDictionary algorithmType; // Token: 0x040069E9 RID: 27113 [Token(Token = "0x40069E9")] private static readonly IDictionary oids; } }