m
This commit is contained in:
+67
@@ -0,0 +1,67 @@
|
||||
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: 0x02001C6C RID: 7276
|
||||
[Token(Token = "0x2001C6C")]
|
||||
public abstract class TlsRsaUtilities
|
||||
{
|
||||
// Token: 0x0600B381 RID: 45953 RVA: 0x0026C200 File Offset: 0x0026A400
|
||||
[Token(Token = "0x600B381")]
|
||||
[Address(RVA = "0x460AC0", Offset = "0x45FAC0", VA = "0x180460AC0")]
|
||||
public static byte[] GenerateEncryptedPreMasterSecret(TlsContext context, RsaKeyParameters rsaServerPublicKey, Stream output)
|
||||
{
|
||||
byte[] array = new byte[48];
|
||||
int num;
|
||||
array[0] = (byte)num;
|
||||
array[0] = (byte)num;
|
||||
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: 0x0600B382 RID: 45954 RVA: 0x0026C270 File Offset: 0x0026A470
|
||||
[Token(Token = "0x600B382")]
|
||||
[Address(RVA = "0x460DE0", Offset = "0x45FDE0", VA = "0x180460DE0")]
|
||||
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: 0x0600B383 RID: 45955 RVA: 0x0026C2F0 File Offset: 0x0026A4F0
|
||||
[Token(Token = "0x600B383")]
|
||||
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
|
||||
protected TlsRsaUtilities()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user