mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-28 16:54:32 +00:00
Add replay detection to RTSP and control streams
Replays can do very little harm in these contexts, but let's detect and prevent them anyways. Fixes #165 Closes #170
This commit is contained in:
1 parent
5d3c0ecca0
commit
c7dff22963
7 files changed
+139
-17
No files matched your search
+2
-2
@@ -72,7 +72,7 @@ int initializeAudioStream(void) {
|
||||
receivedDataFromPeer = false;
|
||||
pingThreadStarted = false;
|
||||
firstReceiveTime = 0;
|
||||
audioDecryptionCtx = PltCreateCryptoContext();
|
||||
audioDecryptionCtx = PltCreateCryptoContext(0);
|
||||
#ifdef LC_DEBUG
|
||||
opusHeaderByte = INVALID_OPUS_HEADER;
|
||||
#endif
|
||||
@@ -189,7 +189,7 @@ static void decodeInputData(PQUEUED_AUDIO_PACKET packet) {
|
||||
|
||||
memcpy(iv, &ivSeq, sizeof(ivSeq));
|
||||
|
||||
if (!PltDecryptMessage(audioDecryptionCtx, ALGORITHM_AES_CBC, CIPHER_FLAG_RESET_IV | CIPHER_FLAG_FINISH,
|
||||
if (!PltDecryptMessage(audioDecryptionCtx, ALGORITHM_AES_CBC, CIPHER_FLAG_RESET_IV | CIPHER_FLAG_FINISH, 0, ivSeq,
|
||||
(unsigned char*)StreamConfig.remoteInputAesKey, sizeof(StreamConfig.remoteInputAesKey),
|
||||
iv, sizeof(iv),
|
||||
NULL, 0,
|
||||
|
||||
Reference in new issue
Block a user