mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-18 23:00:58 +00:00
Pass through input for full control stream encryption on GFE 3.22
This commit is contained in:
@@ -188,6 +188,7 @@ static void inputSendThreadProc(void* context) {
|
||||
PPACKET_HOLDER holder;
|
||||
char encryptedBuffer[MAX_INPUT_PACKET_SIZE];
|
||||
uint32_t encryptedSize;
|
||||
bool encryptedControlStream = APP_VERSION_AT_LEAST(7, 1, 431);
|
||||
|
||||
while (!PltIsThreadInterrupted(&inputSendThread)) {
|
||||
int encryptedLengthPrefix;
|
||||
@@ -320,6 +321,18 @@ static void inputSendThreadProc(void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
// On GFE 3.22, the entire control stream is encrypted (and support for separate RI encrypted)
|
||||
// has been removed. We send the plaintext packet through and the control stream code will do
|
||||
// the encryption.
|
||||
if (encryptedControlStream) {
|
||||
err = (SOCK_RET)sendInputPacketOnControlStream((unsigned char*)&holder->packet, holder->packetLength);
|
||||
if (err < 0) {
|
||||
Limelog("Input: sendInputPacketOnControlStream() failed: %d\n", (int) err);
|
||||
ListenerCallbacks.connectionTerminated(err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Encrypt the message into the output buffer while leaving room for the length
|
||||
encryptedSize = sizeof(encryptedBuffer) - 4;
|
||||
err = encryptData((const unsigned char*)&holder->packet, holder->packetLength,
|
||||
@@ -365,6 +378,7 @@ static void inputSendThreadProc(void* context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This function tells GFE that we support haptics and it should send rumble events to us
|
||||
|
||||
Reference in New Issue
Block a user