279 lines
10 KiB
C#
279 lines
10 KiB
C#
using System;
|
|
using System.IO;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs
|
|
{
|
|
// Token: 0x02001F73 RID: 8051
|
|
[Token(Token = "0x2001F73")]
|
|
public class Pbkdf2Params : Asn1Encodable
|
|
{
|
|
// Token: 0x0600C990 RID: 51600 RVA: 0x002DAD64 File Offset: 0x002D8F64
|
|
[Token(Token = "0x600C990")]
|
|
[Address(RVA = "0x2F871C0", Offset = "0x2F861C0", VA = "0x182F871C0")]
|
|
public static Pbkdf2Params GetInstance(object obj)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600C990)
|
|
|
|
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: 0x0600C991 RID: 51601 RVA: 0x002DADB8 File Offset: 0x002D8FB8
|
|
[Token(Token = "0x600C991")]
|
|
[Address(RVA = "0x2F87830", Offset = "0x2F86830", VA = "0x182F87830")]
|
|
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: 0x0600C992 RID: 51602 RVA: 0x002DAE50 File Offset: 0x002D9050
|
|
[Token(Token = "0x600C992")]
|
|
[Address(RVA = "0x2F87B60", Offset = "0x2F86B60", VA = "0x182F87B60")]
|
|
public Pbkdf2Params(byte[] salt, int iterationCount)
|
|
{
|
|
DerOctetString derOctetString = new DerOctetString(salt);
|
|
this.octStr = derOctetString;
|
|
DerInteger derInteger = new DerInteger(iterationCount);
|
|
this.iterationCount = derInteger;
|
|
}
|
|
|
|
// Token: 0x0600C993 RID: 51603 RVA: 0x002DAE80 File Offset: 0x002D9080
|
|
[Token(Token = "0x600C993")]
|
|
[Address(RVA = "0x2F87AD0", Offset = "0x2F86AD0", VA = "0x182F87AD0")]
|
|
public Pbkdf2Params(byte[] salt, int iterationCount, int keyLength)
|
|
{
|
|
DerInteger derInteger = new DerInteger(keyLength);
|
|
this.keyLength = derInteger;
|
|
}
|
|
|
|
// Token: 0x0600C994 RID: 51604 RVA: 0x002DAE9C File Offset: 0x002D909C
|
|
[Token(Token = "0x600C994")]
|
|
[Address(RVA = "0x2F877A0", Offset = "0x2F867A0", VA = "0x182F877A0")]
|
|
public Pbkdf2Params(byte[] salt, int iterationCount, int keyLength, AlgorithmIdentifier prf)
|
|
{
|
|
DerInteger derInteger = new DerInteger(keyLength);
|
|
this.keyLength = derInteger;
|
|
this.prf = 0;
|
|
}
|
|
|
|
// Token: 0x0600C995 RID: 51605 RVA: 0x002DAEC0 File Offset: 0x002D90C0
|
|
[Token(Token = "0x600C995")]
|
|
[Address(RVA = "0x2F87770", Offset = "0x2F86770", VA = "0x182F87770")]
|
|
public Pbkdf2Params(byte[] salt, int iterationCount, AlgorithmIdentifier prf)
|
|
{
|
|
this.prf = prf;
|
|
}
|
|
|
|
// Token: 0x0600C996 RID: 51606 RVA: 0x002DAED4 File Offset: 0x002D90D4
|
|
[Token(Token = "0x600C996")]
|
|
[Address(RVA = "0x4DB0F0", Offset = "0x4DA0F0", VA = "0x1804DB0F0")]
|
|
public byte[] GetSalt()
|
|
{
|
|
Stream octetStream = ((Asn1OctetStringParser)this.octStr).GetOctetStream();
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x17001F4E RID: 8014
|
|
// (get) Token: 0x0600C997 RID: 51607 RVA: 0x002DAEF4 File Offset: 0x002D90F4
|
|
[Token(Token = "0x17001F4E")]
|
|
public BigInteger IterationCount
|
|
{
|
|
[Token(Token = "0x600C997")]
|
|
[Address(RVA = "0x2E80530", Offset = "0x2E7F530", VA = "0x182E80530")]
|
|
get
|
|
{
|
|
return this.iterationCount.Value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001F4F RID: 8015
|
|
// (get) Token: 0x0600C998 RID: 51608 RVA: 0x002DAF14 File Offset: 0x002D9114
|
|
[Token(Token = "0x17001F4F")]
|
|
public BigInteger KeyLength
|
|
{
|
|
[Token(Token = "0x600C998")]
|
|
[Address(RVA = "0x2D85730", Offset = "0x2D84730", VA = "0x182D85730")]
|
|
get
|
|
{
|
|
DerInteger derInteger = this.keyLength;
|
|
if (derInteger == 0)
|
|
{
|
|
}
|
|
return derInteger.Value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001F50 RID: 8016
|
|
// (get) Token: 0x0600C999 RID: 51609 RVA: 0x002DAF34 File Offset: 0x002D9134
|
|
[Token(Token = "0x17001F50")]
|
|
public bool IsDefaultPrf
|
|
{
|
|
[Token(Token = "0x600C999")]
|
|
[Address(RVA = "0x2F87C00", Offset = "0x2F86C00", VA = "0x182F87C00")]
|
|
get
|
|
{
|
|
AlgorithmIdentifier algorithmIdentifier = this.prf;
|
|
if (algorithmIdentifier == 0)
|
|
{
|
|
return true;
|
|
}
|
|
Asn1Object asn1Object = algorithmIdentifier.ToAsn1Object();
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001F51 RID: 8017
|
|
// (get) Token: 0x0600C99A RID: 51610 RVA: 0x002DAF5C File Offset: 0x002D915C
|
|
[Token(Token = "0x17001F51")]
|
|
public AlgorithmIdentifier Prf
|
|
{
|
|
[Token(Token = "0x600C99A")]
|
|
[Address(RVA = "0x2F87C90", Offset = "0x2F86C90", VA = "0x182F87C90")]
|
|
get
|
|
{
|
|
AlgorithmIdentifier algorithmIdentifier = this.prf;
|
|
if (algorithmIdentifier == 0)
|
|
{
|
|
}
|
|
return algorithmIdentifier;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C99B RID: 51611 RVA: 0x002DAF78 File Offset: 0x002D9178
|
|
[Token(Token = "0x600C99B")]
|
|
[Address(RVA = "0x2F873C0", Offset = "0x2F863C0", VA = "0x182F873C0", 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: 0x0600C99C RID: 51612 RVA: 0x002DB028 File Offset: 0x002D9228
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600C99C")]
|
|
[Address(RVA = "0x2F87690", Offset = "0x2F86690", VA = "0x182F87690")]
|
|
static Pbkdf2Params()
|
|
{
|
|
DerObjectIdentifier idHmacWithSha = PkcsObjectIdentifiers.IdHmacWithSha1;
|
|
DerNull instance = DerNull.Instance;
|
|
Pbkdf2Params.algid_hmacWithSHA1 = new AlgorithmIdentifier(idHmacWithSha, instance);
|
|
}
|
|
|
|
// Token: 0x04007ECE RID: 32462
|
|
[Token(Token = "0x4007ECE")]
|
|
private static AlgorithmIdentifier algid_hmacWithSHA1;
|
|
|
|
// Token: 0x04007ECF RID: 32463
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4007ECF")]
|
|
private readonly Asn1OctetString octStr;
|
|
|
|
// Token: 0x04007ED0 RID: 32464
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007ED0")]
|
|
private readonly DerInteger iterationCount;
|
|
|
|
// Token: 0x04007ED1 RID: 32465
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4007ED1")]
|
|
private readonly DerInteger keyLength;
|
|
|
|
// Token: 0x04007ED2 RID: 32466
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007ED2")]
|
|
private readonly AlgorithmIdentifier prf;
|
|
}
|
|
}
|