Skip to content

Commit

Permalink
Fix for incorrect caching of passphrase
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Dec 27, 2024
1 parent 063ec58 commit 9ccbd08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Kucoin.Net/KucoinAuthenticationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public override void AuthenticateRequest(
headers ??= new Dictionary<string, string>();
headers.Add("KC-API-KEY", _credentials.Key);
headers.Add("KC-API-TIMESTAMP", GetMillisecondTimestamp(apiClient).ToString());
var phrase = _credentials.PassPhrase;
if (!_phraseCache.TryGetValue(phrase, out var phraseSign))
var phraseKey = _credentials.Key + "|" + _credentials.PassPhrase;
if (!_phraseCache.TryGetValue(phraseKey, out var phraseSign))
{
phraseSign = SignHMACSHA256(phrase, SignOutputType.Base64);
_phraseCache.TryAdd(phrase, phraseSign);
phraseSign = SignHMACSHA256(_credentials.PassPhrase, SignOutputType.Base64);
_phraseCache.TryAdd(phraseKey, phraseSign);
}

headers.Add("KC-API-PASSPHRASE", phraseSign);
Expand Down

0 comments on commit 9ccbd08

Please sign in to comment.