281 lines
10 KiB
C#
281 lines
10 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs
|
|
{
|
|
// Token: 0x020018B6 RID: 6326
|
|
[Token(Token = "0x20018B6")]
|
|
[StructLayout(3)]
|
|
public class Pbkdf2Params : Asn1Encodable
|
|
{
|
|
// Token: 0x0600A9E8 RID: 43496 RVA: 0x00279FE4 File Offset: 0x002781E4
|
|
[Token(Token = "0x600A9E8")]
|
|
[Address(RVA = "0x27D58C0", Offset = "0x27D42C0", VA = "0x1827D58C0")]
|
|
public static Pbkdf2Params GetInstance(object obj)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600A9E8)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs.Pbkdf2Params BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs.Pbkdf2Params::GetInstance(System.Object)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_26:
|
|
stloc:string(var_6_2C, call:string(Platform::GetTypeName, ldloc:object(obj)))
|
|
stloc:ArgumentException(var_7_44, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("Unknown object in factory: "), ldloc:string(var_6_2C)), ldstr:string("obj")))
|
|
}
|
|
|
|
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: 0x0600A9E9 RID: 43497 RVA: 0x0027A038 File Offset: 0x00278238
|
|
[Token(Token = "0x600A9E9")]
|
|
[Address(RVA = "0x27D5F30", Offset = "0x27D4930", VA = "0x1827D5F30")]
|
|
public Pbkdf2Params(Asn1Sequence seq)
|
|
{
|
|
Asn1SequenceParser parser2;
|
|
for (;;)
|
|
{
|
|
base..ctor();
|
|
Asn1SequenceParser parser = seq.Parser;
|
|
if (parser == 0)
|
|
{
|
|
}
|
|
if (parser != 0)
|
|
{
|
|
this.octStr = parser;
|
|
parser2 = seq.Parser;
|
|
if (parser2 == 0)
|
|
{
|
|
}
|
|
if (parser2 != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
this.iterationCount = parser2;
|
|
Asn1Encodable asn1Encodable;
|
|
if (asn1Encodable > (ulong)2L)
|
|
{
|
|
if (seq.Parser == 0)
|
|
{
|
|
Asn1SequenceParser parser3 = seq.Parser;
|
|
}
|
|
Asn1SequenceParser parser4 = seq.Parser;
|
|
Asn1SequenceParser parser5 = seq.Parser;
|
|
Asn1SequenceParser parser6 = seq.Parser;
|
|
if (parser5 != 0)
|
|
{
|
|
this.keyLength = parser6;
|
|
}
|
|
if (parser6 != 0)
|
|
{
|
|
AlgorithmIdentifier algorithmIdentifier;
|
|
this.prf = algorithmIdentifier;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600A9EA RID: 43498 RVA: 0x0027A0D0 File Offset: 0x002782D0
|
|
[Token(Token = "0x600A9EA")]
|
|
[Address(RVA = "0x27D6260", Offset = "0x27D4C60", VA = "0x1827D6260")]
|
|
public Pbkdf2Params(byte[] salt, int iterationCount)
|
|
{
|
|
DerOctetString derOctetString = new DerOctetString(salt);
|
|
this.octStr = derOctetString;
|
|
DerInteger derInteger = new DerInteger(iterationCount);
|
|
this.iterationCount = derInteger;
|
|
}
|
|
|
|
// Token: 0x0600A9EB RID: 43499 RVA: 0x0027A100 File Offset: 0x00278300
|
|
[Token(Token = "0x600A9EB")]
|
|
[Address(RVA = "0x27D61D0", Offset = "0x27D4BD0", VA = "0x1827D61D0")]
|
|
public Pbkdf2Params(byte[] salt, int iterationCount, int keyLength)
|
|
{
|
|
DerInteger derInteger = new DerInteger(keyLength);
|
|
this.keyLength = derInteger;
|
|
}
|
|
|
|
// Token: 0x0600A9EC RID: 43500 RVA: 0x0027A11C File Offset: 0x0027831C
|
|
[Token(Token = "0x600A9EC")]
|
|
[Address(RVA = "0x27D5EA0", Offset = "0x27D48A0", VA = "0x1827D5EA0")]
|
|
public Pbkdf2Params(byte[] salt, int iterationCount, int keyLength, AlgorithmIdentifier prf)
|
|
{
|
|
DerInteger derInteger = new DerInteger(keyLength);
|
|
this.keyLength = derInteger;
|
|
this.prf = 0;
|
|
}
|
|
|
|
// Token: 0x0600A9ED RID: 43501 RVA: 0x0027A140 File Offset: 0x00278340
|
|
[Token(Token = "0x600A9ED")]
|
|
[Address(RVA = "0x27D5E70", Offset = "0x27D4870", VA = "0x1827D5E70")]
|
|
public Pbkdf2Params(byte[] salt, int iterationCount, AlgorithmIdentifier prf)
|
|
{
|
|
this.prf = prf;
|
|
}
|
|
|
|
// Token: 0x0600A9EE RID: 43502 RVA: 0x0027A154 File Offset: 0x00278354
|
|
[Token(Token = "0x600A9EE")]
|
|
[Address(RVA = "0x78FE10", Offset = "0x78E810", VA = "0x18078FE10")]
|
|
public byte[] GetSalt()
|
|
{
|
|
Stream octetStream = ((Asn1OctetStringParser)this.octStr).GetOctetStream();
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x17001AB0 RID: 6832
|
|
// (get) Token: 0x0600A9EF RID: 43503 RVA: 0x0027A174 File Offset: 0x00278374
|
|
[Token(Token = "0x17001AB0")]
|
|
public BigInteger IterationCount
|
|
{
|
|
[Token(Token = "0x600A9EF")]
|
|
[Address(RVA = "0x27D16D0", Offset = "0x27D00D0", VA = "0x1827D16D0")]
|
|
get
|
|
{
|
|
return this.iterationCount.Value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001AB1 RID: 6833
|
|
// (get) Token: 0x0600A9F0 RID: 43504 RVA: 0x0027A194 File Offset: 0x00278394
|
|
[Token(Token = "0x17001AB1")]
|
|
public BigInteger KeyLength
|
|
{
|
|
[Token(Token = "0x600A9F0")]
|
|
[Address(RVA = "0x1DE71C0", Offset = "0x1DE5BC0", VA = "0x181DE71C0")]
|
|
get
|
|
{
|
|
DerInteger derInteger = this.keyLength;
|
|
if (derInteger == 0)
|
|
{
|
|
}
|
|
return derInteger.Value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001AB2 RID: 6834
|
|
// (get) Token: 0x0600A9F1 RID: 43505 RVA: 0x0027A1B4 File Offset: 0x002783B4
|
|
[Token(Token = "0x17001AB2")]
|
|
public bool IsDefaultPrf
|
|
{
|
|
[Token(Token = "0x600A9F1")]
|
|
[Address(RVA = "0x27D6300", Offset = "0x27D4D00", VA = "0x1827D6300")]
|
|
get
|
|
{
|
|
AlgorithmIdentifier algorithmIdentifier = this.prf;
|
|
if (algorithmIdentifier == 0)
|
|
{
|
|
return true;
|
|
}
|
|
Asn1Object asn1Object = algorithmIdentifier.ToAsn1Object();
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001AB3 RID: 6835
|
|
// (get) Token: 0x0600A9F2 RID: 43506 RVA: 0x0027A1DC File Offset: 0x002783DC
|
|
[Token(Token = "0x17001AB3")]
|
|
public AlgorithmIdentifier Prf
|
|
{
|
|
[Token(Token = "0x600A9F2")]
|
|
[Address(RVA = "0x27D6390", Offset = "0x27D4D90", VA = "0x1827D6390")]
|
|
get
|
|
{
|
|
AlgorithmIdentifier algorithmIdentifier = this.prf;
|
|
if (algorithmIdentifier == 0)
|
|
{
|
|
}
|
|
return algorithmIdentifier;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600A9F3 RID: 43507 RVA: 0x0027A1F8 File Offset: 0x002783F8
|
|
[Token(Token = "0x600A9F3")]
|
|
[Address(RVA = "0x27D5AC0", Offset = "0x27D44C0", VA = "0x1827D5AC0", Slot = "5")]
|
|
public override Asn1Object ToAsn1Object()
|
|
{
|
|
Asn1Encodable[] array = new Asn1Encodable[2];
|
|
Asn1OctetString asn1OctetString = this.octStr;
|
|
if (asn1OctetString != 0)
|
|
{
|
|
}
|
|
array[0] = asn1OctetString;
|
|
DerInteger derInteger = this.iterationCount;
|
|
if (derInteger != 0)
|
|
{
|
|
}
|
|
array[1] = derInteger;
|
|
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(array);
|
|
if (this.keyLength != (ulong)0L)
|
|
{
|
|
Asn1Encodable[] array2 = new Asn1Encodable[1];
|
|
DerInteger derInteger2 = this.keyLength;
|
|
if (derInteger2 != 0)
|
|
{
|
|
}
|
|
array2[0] = derInteger2;
|
|
asn1EncodableVector.Add(array2);
|
|
}
|
|
if (this.prf != 0)
|
|
{
|
|
Asn1Encodable[] array3 = new Asn1Encodable[1];
|
|
AlgorithmIdentifier algorithmIdentifier = this.prf;
|
|
if (algorithmIdentifier != 0)
|
|
{
|
|
}
|
|
array3[0] = algorithmIdentifier;
|
|
asn1EncodableVector.Add(array3);
|
|
}
|
|
DerSequence derSequence = new DerSequence(asn1EncodableVector);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600A9F4 RID: 43508 RVA: 0x0027A2A8 File Offset: 0x002784A8
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600A9F4")]
|
|
[Address(RVA = "0x27D5D90", Offset = "0x27D4790", VA = "0x1827D5D90")]
|
|
static Pbkdf2Params()
|
|
{
|
|
DerObjectIdentifier idHmacWithSha = PkcsObjectIdentifiers.IdHmacWithSha1;
|
|
DerNull instance = DerNull.Instance;
|
|
Pbkdf2Params.algid_hmacWithSHA1 = new AlgorithmIdentifier(idHmacWithSha, instance);
|
|
}
|
|
|
|
// Token: 0x04006ED2 RID: 28370
|
|
[Token(Token = "0x4006ED2")]
|
|
private static AlgorithmIdentifier algid_hmacWithSHA1;
|
|
|
|
// Token: 0x04006ED3 RID: 28371
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006ED3")]
|
|
private readonly Asn1OctetString octStr;
|
|
|
|
// Token: 0x04006ED4 RID: 28372
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006ED4")]
|
|
private readonly DerInteger iterationCount;
|
|
|
|
// Token: 0x04006ED5 RID: 28373
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006ED5")]
|
|
private readonly DerInteger keyLength;
|
|
|
|
// Token: 0x04006ED6 RID: 28374
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4006ED6")]
|
|
private readonly AlgorithmIdentifier prf;
|
|
}
|
|
}
|