Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change return type to int
  • Loading branch information
am11 committed Apr 16, 2023
commit d67f01c1269fd6709a98b1bb26a3438604b0f073
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private void MapCipherSuite(TlsCipherSuite cipherSuite)
ReadOnlySpan<int> hashKeySize =
new[] { 0, 128, 160, 256, 384, 512 };

ushort data = GetPackedData(cipherSuite);
int data = GetPackedData(cipherSuite);
Debug.Assert(data != 0, $"No mapping found for cipherSuite {cipherSuite}");

KeyExchangeAlg = exchangeAlgorithmTypes[(data >> 12) & 0xF];
Expand All @@ -38,7 +38,7 @@ private void MapCipherSuite(TlsCipherSuite cipherSuite)
DataHashAlg = hashEnumValues[data & 0xF];
DataHashKeySize = hashKeySize[data & 0xF];

static ushort GetPackedData(TlsCipherSuite cipherSuite)
static int GetPackedData(TlsCipherSuite cipherSuite)
{
switch (cipherSuite)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ foreach (HashAlgorithmTypeIndex val in hashEnumValues)
ReadOnlySpan<int> hashKeySize =
new[] { 0, 128, 160, 256, 384, 512 };

ushort data = GetPackedData(cipherSuite);
int data = GetPackedData(cipherSuite);
Debug.Assert(data != 0, $"No mapping found for cipherSuite {cipherSuite}");

KeyExchangeAlg = exchangeAlgorithmTypes[(data >> 12) & 0xF];
Expand All @@ -63,7 +63,7 @@ foreach (HashAlgorithmTypeIndex val in hashEnumValues)
DataHashAlg = hashEnumValues[data & 0xF];
DataHashKeySize = hashKeySize[data & 0xF];

static ushort GetPackedData(TlsCipherSuite cipherSuite)
static int GetPackedData(TlsCipherSuite cipherSuite)
{
switch (cipherSuite)
{
Expand Down