oh dear
This commit is contained in:
+69
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
||||
{
|
||||
// Token: 0x02001B8C RID: 7052
|
||||
[Token(Token = "0x2001B8C")]
|
||||
public abstract class TlsRsaUtilities
|
||||
{
|
||||
// Token: 0x0600AFB3 RID: 44979 RVA: 0x00262FFC File Offset: 0x002611FC
|
||||
[Token(Token = "0x600AFB3")]
|
||||
[Address(RVA = "0x18267C0", Offset = "0x18255C0", VA = "0x1818267C0")]
|
||||
public static byte[] GenerateEncryptedPreMasterSecret(TlsContext context, RsaKeyParameters rsaServerPublicKey, Stream output)
|
||||
{
|
||||
byte[] array = new byte[48];
|
||||
int num;
|
||||
array[0] = (byte)num;
|
||||
char c;
|
||||
bool bindable = c.Bindable;
|
||||
array[0] = (bindable ? 1 : 0);
|
||||
Pkcs1Encoding pkcs1Encoding = new Pkcs1Encoding(new RsaBlindedEngine());
|
||||
ParametersWithRandom parametersWithRandom;
|
||||
pkcs1Encoding.Init(true, parametersWithRandom);
|
||||
int length = array.Length;
|
||||
int num2 = 0;
|
||||
byte[] array2 = pkcs1Encoding.ProcessBlock(array, num2, length);
|
||||
bool flag;
|
||||
if (!flag)
|
||||
{
|
||||
TlsUtilities.WriteOpaque16(array2, output);
|
||||
}
|
||||
int num3 = output.ReadByte();
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x0600AFB4 RID: 44980 RVA: 0x00263074 File Offset: 0x00261274
|
||||
[Token(Token = "0x600AFB4")]
|
||||
[Address(RVA = "0x1826AE0", Offset = "0x18258E0", VA = "0x181826AE0")]
|
||||
public static byte[] SafeDecryptPreMasterSecret(TlsContext context, RsaKeyParameters rsaServerPrivateKey, byte[] encryptedPreMasterSecret)
|
||||
{
|
||||
byte[] array = new byte[48];
|
||||
byte[] array2 = Arrays.Clone(array);
|
||||
Pkcs1Encoding pkcs1Encoding = new Pkcs1Encoding(new RsaBlindedEngine(), array);
|
||||
int num = 0;
|
||||
ParametersWithRandom parametersWithRandom;
|
||||
pkcs1Encoding.Init(num != 0, parametersWithRandom);
|
||||
int length = encryptedPreMasterSecret.Length;
|
||||
int num2 = 0;
|
||||
byte[] array3 = pkcs1Encoding.ProcessBlock(encryptedPreMasterSecret, num2, length);
|
||||
int num3 = 0;
|
||||
byte b;
|
||||
array3[0] = b;
|
||||
num3++;
|
||||
return array3;
|
||||
}
|
||||
|
||||
// Token: 0x0600AFB5 RID: 44981 RVA: 0x002630F4 File Offset: 0x002612F4
|
||||
[Token(Token = "0x600AFB5")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
protected TlsRsaUtilities()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user