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: 0x02001A90 RID: 6800 [Token(Token = "0x2001A90")] public sealed class PbeUtilities { // Token: 0x0600A0DA RID: 41178 RVA: 0x00217664 File Offset: 0x00215864 [Token(Token = "0x600A0DA")] [Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")] private PbeUtilities() { } // Token: 0x0600A0DB RID: 41179 RVA: 0x00217678 File Offset: 0x00215878 [Token(Token = "0x600A0DB")] [Address(RVA = "0x5E22B0", Offset = "0x5E12B0", VA = "0x1805E22B0")] static PbeUtilities() { /* An exception occurred when decompiling this method (0600A0DB) 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: 0x0600A0DC RID: 41180 RVA: 0x00217918 File Offset: 0x00215B18 [Token(Token = "0x600A0DC")] [Address(RVA = "0x5E2100", Offset = "0x5E1100", VA = "0x1805E2100")] private static PbeParametersGenerator MakePbeGenerator(string type, IDigest digest, byte[] key, byte[] salt, int iterationCount) { /* An exception occurred when decompiling this method (0600A0DC) 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: 0x0600A0DD RID: 41181 RVA: 0x00217990 File Offset: 0x00215B90 [Token(Token = "0x600A0DD")] [Address(RVA = "0x5E1900", Offset = "0x5E0900", VA = "0x1805E1900")] 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: 0x170019A3 RID: 6563 // (get) Token: 0x0600A0DE RID: 41182 RVA: 0x002179D0 File Offset: 0x00215BD0 [Token(Token = "0x170019A3")] public static ICollection Algorithms { [Token(Token = "0x600A0DE")] [Address(RVA = "0x5E4B80", Offset = "0x5E3B80", VA = "0x1805E4B80")] get { IDictionary dictionary = PbeUtilities.oids; throw new NullReferenceException(); } } // Token: 0x0600A0DF RID: 41183 RVA: 0x002179E8 File Offset: 0x00215BE8 [Token(Token = "0x600A0DF")] [Address(RVA = "0x5E1D10", Offset = "0x5E0D10", VA = "0x1805E1D10")] 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: 0x0600A0E0 RID: 41184 RVA: 0x00217A18 File Offset: 0x00215C18 [Token(Token = "0x600A0E0")] [Address(RVA = "0x5E1E60", Offset = "0x5E0E60", VA = "0x1805E1E60")] 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: 0x0600A0E1 RID: 41185 RVA: 0x00217A48 File Offset: 0x00215C48 [Token(Token = "0x600A0E1")] [Address(RVA = "0x5E1FB0", Offset = "0x5E0FB0", VA = "0x1805E1FB0")] 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: 0x0600A0E2 RID: 41186 RVA: 0x00217A78 File Offset: 0x00215C78 [Token(Token = "0x600A0E2")] [Address(RVA = "0x5E1A90", Offset = "0x5E0A90", VA = "0x1805E1A90")] 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: 0x0600A0E3 RID: 41187 RVA: 0x00217AA8 File Offset: 0x00215CA8 [Token(Token = "0x600A0E3")] [Address(RVA = "0x5E1BE0", Offset = "0x5E0BE0", VA = "0x1805E1BE0")] 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: 0x0600A0E4 RID: 41188 RVA: 0x00217ADC File Offset: 0x00215CDC [Token(Token = "0x600A0E4")] [Address(RVA = "0x5E0400", Offset = "0x5DF400", VA = "0x1805E0400")] 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: 0x0600A0E5 RID: 41189 RVA: 0x00217B20 File Offset: 0x00215D20 [Token(Token = "0x600A0E5")] [Address(RVA = "0x5E0580", Offset = "0x5DF580", VA = "0x1805E0580")] public static Asn1Encodable GenerateAlgorithmParameters(string algorithm, byte[] salt, int iterationCount) { /* An exception occurred when decompiling this method (0600A0E5) 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: 0x0600A0E6 RID: 41190 RVA: 0x00217B58 File Offset: 0x00215D58 [Token(Token = "0x600A0E6")] [Address(RVA = "0x5E0960", Offset = "0x5DF960", VA = "0x1805E0960")] 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: 0x0600A0E7 RID: 41191 RVA: 0x00217B80 File Offset: 0x00215D80 [Token(Token = "0x600A0E7")] [Address(RVA = "0x5E06B0", Offset = "0x5DF6B0", VA = "0x1805E06B0")] public static ICipherParameters GenerateCipherParameters(DerObjectIdentifier algorithmOid, char[] password, bool wrongPkcs12Zero, Asn1Encodable pbeParameters) { return PbeUtilities.GenerateCipherParameters(algorithmOid.identifier, password, wrongPkcs12Zero, pbeParameters); } // Token: 0x0600A0E8 RID: 41192 RVA: 0x00217BA4 File Offset: 0x00215DA4 [Token(Token = "0x600A0E8")] [Address(RVA = "0x5E0750", Offset = "0x5DF750", VA = "0x1805E0750")] public static ICipherParameters GenerateCipherParameters(AlgorithmIdentifier algID, char[] password) { Asn1Object asn1Object = algID.ToAsn1Object(); DerObjectIdentifier objectID = algID.ObjectID; ICipherParameters cipherParameters; return cipherParameters; } // Token: 0x0600A0E9 RID: 41193 RVA: 0x00217BC8 File Offset: 0x00215DC8 [Token(Token = "0x600A0E9")] [Address(RVA = "0x5E0890", Offset = "0x5DF890", VA = "0x1805E0890")] public static ICipherParameters GenerateCipherParameters(AlgorithmIdentifier algID, char[] password, bool wrongPkcs12Zero) { Asn1Object asn1Object = algID.ToAsn1Object(); DerObjectIdentifier objectID = algID.ObjectID; ICipherParameters cipherParameters; return cipherParameters; } // Token: 0x0600A0EA RID: 41194 RVA: 0x00217BEC File Offset: 0x00215DEC [Token(Token = "0x600A0EA")] [Address(RVA = "0x5E0810", Offset = "0x5DF810", VA = "0x1805E0810")] public static ICipherParameters GenerateCipherParameters(string algorithm, char[] password, Asn1Encodable pbeParameters) { int num = 0; return PbeUtilities.GenerateCipherParameters(algorithm, password, num != 0, pbeParameters); } // Token: 0x0600A0EB RID: 41195 RVA: 0x00217C04 File Offset: 0x00215E04 [Token(Token = "0x600A0EB")] [Address(RVA = "0x5E09F0", Offset = "0x5DF9F0", VA = "0x1805E09F0")] 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: 0x0600A0EC RID: 41196 RVA: 0x00217ED0 File Offset: 0x002160D0 [Token(Token = "0x600A0EC")] [Address(RVA = "0x5DFFD0", Offset = "0x5DEFD0", VA = "0x1805DFFD0")] public static object CreateEngine(DerObjectIdentifier algorithmOid) { return PbeUtilities.CreateEngine(algorithmOid.identifier); } // Token: 0x0600A0ED RID: 41197 RVA: 0x00217EF0 File Offset: 0x002160F0 [Token(Token = "0x600A0ED")] [Address(RVA = "0x5E0030", Offset = "0x5DF030", VA = "0x1805E0030")] 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: 0x0600A0EE RID: 41198 RVA: 0x00217F2C File Offset: 0x0021612C [Token(Token = "0x600A0EE")] [Address(RVA = "0x5DFB40", Offset = "0x5DEB40", VA = "0x1805DFB40")] 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: 0x0600A0EF RID: 41199 RVA: 0x0021804C File Offset: 0x0021624C [Token(Token = "0x600A0EF")] [Address(RVA = "0x5E1850", Offset = "0x5E0850", VA = "0x1805E1850")] public static string GetEncodingName(DerObjectIdentifier oid) { IDictionary dictionary = PbeUtilities.algorithms; throw new NullReferenceException(); } // Token: 0x0600A0F0 RID: 41200 RVA: 0x00218064 File Offset: 0x00216264 [Token(Token = "0x600A0F0")] [Address(RVA = "0x5E0170", Offset = "0x5DF170", VA = "0x1805E0170")] 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: 0x04006B9C RID: 27548 [Token(Token = "0x4006B9C")] private const string Pkcs5S1 = "Pkcs5S1"; // Token: 0x04006B9D RID: 27549 [Token(Token = "0x4006B9D")] private const string Pkcs5S2 = "Pkcs5S2"; // Token: 0x04006B9E RID: 27550 [Token(Token = "0x4006B9E")] private const string Pkcs12 = "Pkcs12"; // Token: 0x04006B9F RID: 27551 [Token(Token = "0x4006B9F")] private const string OpenSsl = "OpenSsl"; // Token: 0x04006BA0 RID: 27552 [Token(Token = "0x4006BA0")] private static readonly IDictionary algorithms; // Token: 0x04006BA1 RID: 27553 [Token(Token = "0x4006BA1")] private static readonly IDictionary algorithmType; // Token: 0x04006BA2 RID: 27554 [Token(Token = "0x4006BA2")] private static readonly IDictionary oids; } }