add all
This commit is contained in:
45
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/tls/HandshakeMessageInput.cs
vendored
Normal file
45
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/tls/HandshakeMessageInput.cs
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Tls.Crypto;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Tls
|
||||
{
|
||||
// TODO Rewrite without MemoryStream
|
||||
public sealed class HandshakeMessageInput
|
||||
: MemoryStream
|
||||
{
|
||||
private readonly int m_offset;
|
||||
|
||||
internal HandshakeMessageInput(byte[] buf, int offset, int length)
|
||||
: base(buf, offset, length, false, true)
|
||||
{
|
||||
m_offset = offset;
|
||||
}
|
||||
|
||||
public void UpdateHash(TlsHash hash)
|
||||
{
|
||||
WriteTo(new TlsHashSink(hash));
|
||||
}
|
||||
|
||||
internal void UpdateHashPrefix(TlsHash hash, int bindersSize)
|
||||
{
|
||||
byte[] buf = GetBuffer();
|
||||
int count = Convert.ToInt32(Length);
|
||||
|
||||
hash.Update(buf, m_offset, count - bindersSize);
|
||||
}
|
||||
|
||||
internal void UpdateHashSuffix(TlsHash hash, int bindersSize)
|
||||
{
|
||||
byte[] buf = GetBuffer();
|
||||
int count = Convert.ToInt32(Length);
|
||||
|
||||
hash.Update(buf, m_offset + count - bindersSize, bindersSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user