Merge pull request #816 from mariotaku/master

Randomized input IV
This commit is contained in:
irtimmer 2021-07-20 18:34:33 +02:00 committed by GitHub
commit 8f4d9aa5ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#include <uuid/uuid.h>
#include <openssl/sha.h>
#include <openssl/aes.h>
@ -670,10 +671,14 @@ int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, b
RAND_bytes(config->remoteInputAesKey, 16);
memset(config->remoteInputAesIv, 0, 16);
// GFE somehow doesn't like this totally legit random number, so we have to generate one
RAND_bytes(config->remoteInputAesIv, 4);
srand(time(NULL));
char url[4096];
u_int32_t rikeyid = 0;
memset(&rikeyid, config->remoteInputAesIv, 4);
rikeyid = htonl(rikeyid);
char rikey_hex[33];
bytes_to_hex(config->remoteInputAesKey, rikey_hex, 16);