fix(core): Converts BB packets (#406)
- [X] Organizes and splits up bulletin boards - [X] Converts packets
This commit is contained in:
parent
bae568d856
commit
c58aad733d
32 changed files with 952 additions and 737 deletions
|
|
@ -16,6 +16,7 @@
|
|||
using System;
|
||||
using System.Buffers.Binary;
|
||||
using System.Security.Cryptography;
|
||||
using Server.Network;
|
||||
using Server.Text;
|
||||
|
||||
namespace Server.Accounting.Security
|
||||
|
|
@ -33,7 +34,7 @@ namespace Server.Accounting.Security
|
|||
{
|
||||
Span<byte> output = stackalloc byte[m_OutputSize];
|
||||
var iterations = Utility.RandomMinMax(m_MinIterations, m_MaxIterations);
|
||||
BinaryPrimitives.WriteUInt16LittleEndian(output.Slice(0, 2), (ushort)iterations);
|
||||
BinaryPrimitives.WriteUInt16LittleEndian(output.SliceToLength(2), (ushort)iterations);
|
||||
|
||||
var rfc2898 = new Rfc2898DeriveBytes(plainPassword, m_SaltSize, iterations, HashAlgorithmName.SHA256);
|
||||
rfc2898.Salt.CopyTo(output.Slice(2, m_SaltSize));
|
||||
|
|
@ -47,7 +48,7 @@ namespace Server.Accounting.Security
|
|||
Span<byte> encryptedBytes = stackalloc byte[m_OutputSize];
|
||||
HexStringConverter.GetBytes(encryptedPassword, encryptedBytes);
|
||||
|
||||
var iterations = BinaryPrimitives.ReadUInt16LittleEndian(encryptedBytes.Slice(0, 2));
|
||||
var iterations = BinaryPrimitives.ReadUInt16LittleEndian(encryptedBytes.SliceToLength(2));
|
||||
var salt = encryptedBytes.Slice(2, m_SaltSize);
|
||||
|
||||
ReadOnlySpan<byte> hash =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue