From 8c22abbab17698c85b89f0b2544d95dbb048b24b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 23 Feb 2016 17:19:06 -0500 Subject: [PATCH 1/8] Fix stack corruption when creating the server challenge response --- libgamestream/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgamestream/client.c b/libgamestream/client.c index 2160199..de6a985 100644 --- a/libgamestream/client.c +++ b/libgamestream/client.c @@ -379,7 +379,7 @@ int gs_pair(PSERVER_DATA server, char* pin) { char challenge_response[16 + 256 + 16]; char challenge_response_hash[32]; char challenge_response_hash_enc[32]; - char challenge_response_hex[33]; + char challenge_response_hex[65]; memcpy(challenge_response, challenge_response_data + 20, 16); memcpy(challenge_response + 16, cert->signature->data, 256); memcpy(challenge_response + 16 + 256, client_secret_data, 16); From fbda6e2c1a1739fe96a3c0b5aa7e988338dd11b8 Mon Sep 17 00:00:00 2001 From: runoshun Date: Sat, 27 Feb 2016 18:04:57 +0900 Subject: [PATCH 2/8] Remove minor version of libcec --- third_party/libcec/ceccloader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/libcec/ceccloader.h b/third_party/libcec/ceccloader.h index 0b252c4..1ae0c2a 100644 --- a/third_party/libcec/ceccloader.h +++ b/third_party/libcec/ceccloader.h @@ -225,7 +225,7 @@ static libcecc_lib_instance_t libcecc_load_library(const char* strLib) #if defined(__APPLE__) lib = dlopen(strLib ? strLib : "libcec." CEC_LIB_VERSION_MAJOR_STR ".dylib", RTLD_LAZY); #else - lib = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR ".0", RTLD_LAZY); + lib = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY); #endif if (lib == NULL) printf("%s\n", dlerror()); From 501c20565b736188fbc439a61f565508064d31d7 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 27 Feb 2016 23:05:59 -0800 Subject: [PATCH 3/8] Fix several areas of pairing that relied on undefined behavior --- libgamestream/client.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libgamestream/client.c b/libgamestream/client.c index de6a985..0f0ecca 100644 --- a/libgamestream/client.c +++ b/libgamestream/client.c @@ -337,17 +337,18 @@ int gs_pair(PSERVER_DATA server, char* pin) { unsigned char salt_pin[20]; unsigned char aes_key_hash[20]; - AES_KEY aes_key; + AES_KEY enc_key, dec_key; memcpy(salt_pin, salt_data, 16); - memcpy(salt_pin+16, salt_pin, 4); + memcpy(salt_pin+16, pin, 4); SHA1(salt_pin, 20, aes_key_hash); - AES_set_encrypt_key((unsigned char *)aes_key_hash, 128, &aes_key); + AES_set_encrypt_key((unsigned char *)aes_key_hash, 128, &enc_key); + AES_set_decrypt_key((unsigned char *)aes_key_hash, 128, &dec_key); unsigned char challenge_data[16]; unsigned char challenge_enc[16]; char challenge_hex[33]; RAND_bytes(challenge_data, 16); - AES_encrypt(challenge_data, challenge_enc, &aes_key); + AES_encrypt(challenge_data, challenge_enc, &enc_key); bytes_to_hex(challenge_enc, challenge_hex, 16); uuid_generate_random(uuid); @@ -364,13 +365,13 @@ int gs_pair(PSERVER_DATA server, char* pin) { char challenge_response_data_enc[48]; char challenge_response_data[48]; - for (int count = 0; count < strlen(result); count++) { + for (int count = 0; count < strlen(result); count += 2) { sscanf(&result[count], "%2hhx", &challenge_response_data_enc[count / 2]); } free(result); for (int i = 0; i < 48; i += 16) { - AES_decrypt(&challenge_response_data_enc[i], &challenge_response_data[i], &aes_key); + AES_decrypt(&challenge_response_data_enc[i], &challenge_response_data[i], &dec_key); } char client_secret_data[16]; @@ -386,7 +387,7 @@ int gs_pair(PSERVER_DATA server, char* pin) { SHA1(challenge_response, 16 + 256 + 16, challenge_response_hash); for (int i = 0; i < 32; i += 16) { - AES_encrypt(&challenge_response_hash[i], &challenge_response_hash_enc[i], &aes_key); + AES_encrypt(&challenge_response_hash[i], &challenge_response_hash_enc[i], &enc_key); } bytes_to_hex(challenge_response_hash_enc, challenge_response_hex, 32); From 41c58974d732720a303f97c0867ea26aa4b2567d Mon Sep 17 00:00:00 2001 From: Iwan Timmer Date: Sun, 28 Feb 2016 18:27:14 +0100 Subject: [PATCH 4/8] Fixes for Xbox 360 mapping --- mappings/xbox360.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mappings/xbox360.conf b/mappings/xbox360.conf index a5d3eff..d62423a 100644 --- a/mappings/xbox360.conf +++ b/mappings/xbox360.conf @@ -5,8 +5,8 @@ abs_rx = 3 abs_ry = 4 abs_rz = 9 abs_deadzone = 0 -abs_dpad_x = 16 -abs_dpad_y = 17 +abs_dpad_x = 17 +abs_dpad_y = 16 reverse_x = false reverse_y = true reverse_rx = false @@ -24,8 +24,8 @@ btn_thumbl = 317 btn_thumbr = 318 btn_tl = 310 btn_tr = 311 -btn_tl2 = -1 -btn_tr2 = -1 +btn_tl2 = 312 +btn_tr2 = 313 btn_dpad_up = -1 btn_dpad_down = -1 btn_dpad_left = -1 From 895054aa69b91dc4cfd556f5a6e472143091b82d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 28 Feb 2016 14:22:38 -0500 Subject: [PATCH 5/8] Update common to disable dynamic resolution switching --- third_party/moonlight-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/moonlight-common-c b/third_party/moonlight-common-c index e1473d7..fbd58c6 160000 --- a/third_party/moonlight-common-c +++ b/third_party/moonlight-common-c @@ -1 +1 @@ -Subproject commit e1473d7a2d813135b148de5f20ed12919631b6a7 +Subproject commit fbd58c60ea12d8760bae86b7d98b2d0208418baf From 2da3ca2bcf24152fbdc0974728173a5e2118a2d8 Mon Sep 17 00:00:00 2001 From: Iwan Timmer Date: Sat, 20 Feb 2016 15:11:59 +0100 Subject: [PATCH 6/8] Remove unneeded variables --- src/video/sdl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/video/sdl.c b/src/video/sdl.c index 561edcd..89cb657 100644 --- a/src/video/sdl.c +++ b/src/video/sdl.c @@ -30,7 +30,6 @@ #define DECODER_BUFFER_SIZE 92*1024 -static int screen_width, screen_height; static char* ffmpeg_buffer; static void sdl_setup(int width, int height, int redrawRate, void* context, int drFlags) { @@ -45,9 +44,6 @@ static void sdl_setup(int width, int height, int redrawRate, void* context, int fprintf(stderr, "Not enough memory\n"); exit(1); } - - screen_width = width; - screen_height = height; } static void sdl_cleanup() { From 0569e9fe835741a0a5fcfbca301abeb98c1762f3 Mon Sep 17 00:00:00 2001 From: Iwan Timmer Date: Tue, 1 Mar 2016 20:16:20 +0100 Subject: [PATCH 7/8] Update to version 2.1.4 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8e7a98..0beb0b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ include(${CMAKE_ROOT}/Modules/GNUInstallDirs.cmake) set(MOONLIGHT_MAJOR_VERSION 2) set(MOONLIGHT_MINOR_VERSION 1) -set(MOONLIGHT_PATCH_VERSION 3) +set(MOONLIGHT_PATCH_VERSION 4) set(MOONLIGHT_VERSION ${MOONLIGHT_MAJOR_VERSION}.${MOONLIGHT_MINOR_VERSION}.${MOONLIGHT_PATCH_VERSION}) aux_source_directory(./src SRC_LIST) From 76f1828e35e7154551738bb8aefeb9acaa0a3f05 Mon Sep 17 00:00:00 2001 From: Iwan Timmer Date: Tue, 1 Mar 2016 20:47:40 +0100 Subject: [PATCH 8/8] Update to version 2.1.4 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index c403c66..a09e846 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +moonlight-embedded (2.1.4-1wheezy1) RELEASED; urgency=high + + * Update to version 2.1.4 + + -- Iwan Timmer Tue, 1 Mar 2016 20:23:54 +0200 + moonlight-embedded (2.1.3-1wheezy1) RELEASED; urgency=high * Update to version 2.1.3