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
Fix index
  • Loading branch information
am11 authored Apr 15, 2023
commit a584dac86321f9a7fc5fc6a145b05d4c58618ad9
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ private void MapCipherSuite(TlsCipherSuite cipherSuite)
TlsCipherSuite = cipherSuite;
KeyExchKeySize = 0;

Debug.Assert(s_cipherToIndex.IndexOf((int)cipherSuite) > -1, $"No mapping found for cipherSuite {cipherSuite}");
ulong data = s_encodedNumber[s_cipherToIndex[(int)cipherSuite + 1]];
int index = (int)cipherSuite * 2;
Debug.Assert(s_cipherToIndex.IndexOf(index) > -1, $"No mapping found for cipherSuite {cipherSuite}");
ulong data = s_encodedNumber[s_cipherToIndex[index + 1]];

KeyExchangeAlg = (int)(data >> (64 - (16 * 1)) & 0xFFFF);
DataCipherAlg = (int)(data >> (64 - (16 * 2)) & 0xFFFF);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ namespace System.Net.Security
TlsCipherSuite = cipherSuite;
KeyExchKeySize = 0;

Debug.Assert(s_cipherToIndex.IndexOf((int)cipherSuite) > -1, $"No mapping found for cipherSuite {cipherSuite}");
ulong data = s_encodedNumber[s_cipherToIndex[(int)cipherSuite + 1]];
int index = (int)cipherSuite * 2;
Debug.Assert(s_cipherToIndex.IndexOf(index) > -1, $"No mapping found for cipherSuite {cipherSuite}");
ulong data = s_encodedNumber[s_cipherToIndex[index + 1]];

KeyExchangeAlg = (int)(data >> (64 - (16 * 1)) & 0xFFFF);
DataCipherAlg = (int)(data >> (64 - (16 * 2)) & 0xFFFF);
Expand Down