From 259147d6efdeb3aded309953ffda722078d17c4c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 15 Jul 2023 09:41:40 +1000 Subject: [PATCH] Add readme note to change app ID on android/ios to avoid installation conflict between modified versions and original classicube client, also fix SChannel SSL backend not compiling on some MinGW versions --- readme.md | 4 ++++ src/SSL.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 4e2fc7ab4..a6076e9d6 100644 --- a/readme.md +++ b/readme.md @@ -123,6 +123,8 @@ Although the regular linux compiliation flags will work fine, to take full advan ## Compiling - for Android +NOTE: If you are distributing a modified version, please change the package ID from `com.classicube.android.client` to something else - otherwise Android users won't be able to have both ClassiCube and your modified version installed at the same time on their Android device + ##### Using Android Studio GUI Open `android` folder in Android Studio (TODO explain more detailed) @@ -135,6 +137,8 @@ Run `gradlew` in android folder (TODO explain more detailed) iOS version will have issues as it's incomplete and only tested in iOS Simulator +NOTE: If you are distributing a modified version, please change the bundle ID from `com.classicube.ios.client` to something else - otherwise iOS users won't be able to have both ClassiCube and your modified version installed at the same time on their iOS device + ##### Using Xcode GUI Import `ios/CCIOS.xcodeproj` project into Xcode (TODO explain more detailed) diff --git a/src/SSL.c b/src/SSL.c index 61ed0ba46..2580eeb99 100644 --- a/src/SSL.c +++ b/src/SSL.c @@ -89,11 +89,15 @@ struct SSLContext { char incoming[TLS_MAX_PACKET_SIZE]; }; +/* Undefined in older MinGW versions */ +#define _SP_PROT_TLS1_1_CLIENT 0x00000200 +#define _SP_PROT_TLS1_2_CLIENT 0x00000800 + static SECURITY_STATUS SSL_CreateHandle(struct SSLContext* ctx) { SCHANNEL_CRED cred = { 0 }; cred.dwVersion = SCHANNEL_CRED_VERSION; cred.dwFlags = SCH_CRED_NO_DEFAULT_CREDS | (_verifyCerts ? SCH_CRED_AUTO_CRED_VALIDATION : SCH_CRED_MANUAL_CRED_VALIDATION); - cred.grbitEnabledProtocols = SP_PROT_TLS1_CLIENT | SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT; + cred.grbitEnabledProtocols = SP_PROT_TLS1_CLIENT | _SP_PROT_TLS1_1_CLIENT | _SP_PROT_TLS1_2_CLIENT; /* TODO: SCHANNEL_NAME_A ? */ return FP_AcquireCredentialsHandleA(NULL, UNISP_NAME_A, SECPKG_CRED_OUTBOUND, NULL,