diff --git a/deploy/linux_aarch64/libcrypto.so.1.1 b/deploy/linux_aarch64/libcrypto.so.1.1
index b8965d6e..ae3e0801 100644
Binary files a/deploy/linux_aarch64/libcrypto.so.1.1 and b/deploy/linux_aarch64/libcrypto.so.1.1 differ
diff --git a/deploy/linux_aarch64/liblzo2.so.2 b/deploy/linux_aarch64/liblzo2.so.2
index 691dd9f5..f0feeb5f 100644
Binary files a/deploy/linux_aarch64/liblzo2.so.2 and b/deploy/linux_aarch64/liblzo2.so.2 differ
diff --git a/deploy/linux_aarch64/libpkcs11-helper.so.1 b/deploy/linux_aarch64/libpkcs11-helper.so.1
index d8ab40f7..07c82b1b 100644
Binary files a/deploy/linux_aarch64/libpkcs11-helper.so.1 and b/deploy/linux_aarch64/libpkcs11-helper.so.1 differ
diff --git a/deploy/linux_aarch64/libssl.so.1.1 b/deploy/linux_aarch64/libssl.so.1.1
index f068f750..5c8d66ec 100644
Binary files a/deploy/linux_aarch64/libssl.so.1.1 and b/deploy/linux_aarch64/libssl.so.1.1 differ
diff --git a/deploy/linux_aarch64/openvpn b/deploy/linux_aarch64/openvpn
index c8c4b7df..878e2d3a 100644
Binary files a/deploy/linux_aarch64/openvpn and b/deploy/linux_aarch64/openvpn differ
diff --git a/deploy/linux_armv7l/libcrypto.so.1.1 b/deploy/linux_armv7l/libcrypto.so.1.1
index a85cc1ee..593244c0 100644
Binary files a/deploy/linux_armv7l/libcrypto.so.1.1 and b/deploy/linux_armv7l/libcrypto.so.1.1 differ
diff --git a/deploy/linux_armv7l/liblzo2.so.2 b/deploy/linux_armv7l/liblzo2.so.2
index 0df86008..691dd9f5 100644
Binary files a/deploy/linux_armv7l/liblzo2.so.2 and b/deploy/linux_armv7l/liblzo2.so.2 differ
diff --git a/deploy/linux_armv7l/libpkcs11-helper.so.1 b/deploy/linux_armv7l/libpkcs11-helper.so.1
index fd688a81..a98ebfa9 100644
Binary files a/deploy/linux_armv7l/libpkcs11-helper.so.1 and b/deploy/linux_armv7l/libpkcs11-helper.so.1 differ
diff --git a/deploy/linux_armv7l/libssl.so.1.1 b/deploy/linux_armv7l/libssl.so.1.1
index f1ab6cc2..529ff6dd 100644
Binary files a/deploy/linux_armv7l/libssl.so.1.1 and b/deploy/linux_armv7l/libssl.so.1.1 differ
diff --git a/deploy/linux_armv7l/openvpn b/deploy/linux_armv7l/openvpn
index be068750..04393be1 100644
Binary files a/deploy/linux_armv7l/openvpn and b/deploy/linux_armv7l/openvpn differ
diff --git a/deploy/linux_x64/libcrypto.so.1.1 b/deploy/linux_x64/libcrypto.so.1.1
index 4f5a540b..b7a39c11 100644
Binary files a/deploy/linux_x64/libcrypto.so.1.1 and b/deploy/linux_x64/libcrypto.so.1.1 differ
diff --git a/deploy/linux_x64/liblzo2.so.2 b/deploy/linux_x64/liblzo2.so.2
index 49066e7d..efc57956 100644
Binary files a/deploy/linux_x64/liblzo2.so.2 and b/deploy/linux_x64/liblzo2.so.2 differ
diff --git a/deploy/linux_x64/libpkcs11-helper.so.1 b/deploy/linux_x64/libpkcs11-helper.so.1
index 54c8d3ae..05eb7acc 100644
Binary files a/deploy/linux_x64/libpkcs11-helper.so.1 and b/deploy/linux_x64/libpkcs11-helper.so.1 differ
diff --git a/deploy/linux_x64/libssl.so.1.1 b/deploy/linux_x64/libssl.so.1.1
index 835f5cf0..9ab07963 100644
Binary files a/deploy/linux_x64/libssl.so.1.1 and b/deploy/linux_x64/libssl.so.1.1 differ
diff --git a/deploy/linux_x64/openvpn b/deploy/linux_x64/openvpn
index 05bd01d8..f0d59d37 100644
Binary files a/deploy/linux_x64/openvpn and b/deploy/linux_x64/openvpn differ
diff --git a/deploy/linux_x86/libcrypto.so.1.1 b/deploy/linux_x86/libcrypto.so.1.1
index fe5c7281..78cb6800 100644
Binary files a/deploy/linux_x86/libcrypto.so.1.1 and b/deploy/linux_x86/libcrypto.so.1.1 differ
diff --git a/deploy/linux_x86/libpkcs11-helper.so.1 b/deploy/linux_x86/libpkcs11-helper.so.1
index 91ccf9f8..e890fd32 100644
Binary files a/deploy/linux_x86/libpkcs11-helper.so.1 and b/deploy/linux_x86/libpkcs11-helper.so.1 differ
diff --git a/deploy/linux_x86/libssl.so.1.1 b/deploy/linux_x86/libssl.so.1.1
index b4ffdd07..72bac487 100644
Binary files a/deploy/linux_x86/libssl.so.1.1 and b/deploy/linux_x86/libssl.so.1.1 differ
diff --git a/deploy/linux_x86/openvpn b/deploy/linux_x86/openvpn
index 47c4b288..e3bb950b 100644
Binary files a/deploy/linux_x86/openvpn and b/deploy/linux_x86/openvpn differ
diff --git a/deploy/macos_arm64/hummingbird b/deploy/macos_arm64/hummingbird
new file mode 100644
index 00000000..66f9ee5f
Binary files /dev/null and b/deploy/macos_arm64/hummingbird differ
diff --git a/deploy/macos_arm64/libcrypto.1.1.dylib b/deploy/macos_arm64/libcrypto.1.1.dylib
new file mode 100644
index 00000000..96f8a2cf
Binary files /dev/null and b/deploy/macos_arm64/libcrypto.1.1.dylib differ
diff --git a/deploy/macos_arm64/liblzo2.2.dylib b/deploy/macos_arm64/liblzo2.2.dylib
new file mode 100644
index 00000000..2bf9e65c
Binary files /dev/null and b/deploy/macos_arm64/liblzo2.2.dylib differ
diff --git a/deploy/macos_arm64/libpkcs11-helper.1.dylib b/deploy/macos_arm64/libpkcs11-helper.1.dylib
new file mode 100644
index 00000000..63629bec
Binary files /dev/null and b/deploy/macos_arm64/libpkcs11-helper.1.dylib differ
diff --git a/deploy/macos_arm64/libssl.1.1.dylib b/deploy/macos_arm64/libssl.1.1.dylib
new file mode 100644
index 00000000..8fa6c75e
Binary files /dev/null and b/deploy/macos_arm64/libssl.1.1.dylib differ
diff --git a/deploy/macos_arm64/openvpn b/deploy/macos_arm64/openvpn
new file mode 100644
index 00000000..e623f52c
Binary files /dev/null and b/deploy/macos_arm64/openvpn differ
diff --git a/deploy/macos_arm64/stunnel b/deploy/macos_arm64/stunnel
new file mode 100644
index 00000000..12af91fa
Binary files /dev/null and b/deploy/macos_arm64/stunnel differ
diff --git a/deploy/macos_x64/libcrypto.1.1.dylib b/deploy/macos_x64/libcrypto.1.1.dylib
index 8446d812..6144c8fc 100644
Binary files a/deploy/macos_x64/libcrypto.1.1.dylib and b/deploy/macos_x64/libcrypto.1.1.dylib differ
diff --git a/deploy/macos_x64/liblzo2.2.dylib b/deploy/macos_x64/liblzo2.2.dylib
index 92bd6352..af415acb 100644
Binary files a/deploy/macos_x64/liblzo2.2.dylib and b/deploy/macos_x64/liblzo2.2.dylib differ
diff --git a/deploy/macos_x64/libpkcs11-helper.1.dylib b/deploy/macos_x64/libpkcs11-helper.1.dylib
index 451328b7..c8dc2e46 100644
Binary files a/deploy/macos_x64/libpkcs11-helper.1.dylib and b/deploy/macos_x64/libpkcs11-helper.1.dylib differ
diff --git a/deploy/macos_x64/libssl.1.1.dylib b/deploy/macos_x64/libssl.1.1.dylib
index f5528d4a..74591795 100644
Binary files a/deploy/macos_x64/libssl.1.1.dylib and b/deploy/macos_x64/libssl.1.1.dylib differ
diff --git a/deploy/macos_x64/openvpn b/deploy/macos_x64/openvpn
index 7b71042c..b636b971 100755
Binary files a/deploy/macos_x64/openvpn and b/deploy/macos_x64/openvpn differ
diff --git a/deploy/windows-10_x64/libcrypto-1_1-x64.dll b/deploy/windows-10_x64/libcrypto-1_1-x64.dll
index ca9ec78d..10118a61 100644
Binary files a/deploy/windows-10_x64/libcrypto-1_1-x64.dll and b/deploy/windows-10_x64/libcrypto-1_1-x64.dll differ
diff --git a/deploy/windows-10_x64/liblzo2-2.dll b/deploy/windows-10_x64/liblzo2-2.dll
index 77fa2437..7f25de93 100644
Binary files a/deploy/windows-10_x64/liblzo2-2.dll and b/deploy/windows-10_x64/liblzo2-2.dll differ
diff --git a/deploy/windows-10_x64/libpkcs11-helper-1.dll b/deploy/windows-10_x64/libpkcs11-helper-1.dll
index bcb5eb06..ec9a47aa 100644
Binary files a/deploy/windows-10_x64/libpkcs11-helper-1.dll and b/deploy/windows-10_x64/libpkcs11-helper-1.dll differ
diff --git a/deploy/windows-10_x64/libssl-1_1-x64.dll b/deploy/windows-10_x64/libssl-1_1-x64.dll
index 8c49c6c8..0b498d7b 100644
Binary files a/deploy/windows-10_x64/libssl-1_1-x64.dll and b/deploy/windows-10_x64/libssl-1_1-x64.dll differ
diff --git a/deploy/windows-10_x64/openvpn.exe b/deploy/windows-10_x64/openvpn.exe
index 26576366..3f5746dd 100644
Binary files a/deploy/windows-10_x64/openvpn.exe and b/deploy/windows-10_x64/openvpn.exe differ
diff --git a/deploy/windows-10_x64/tapctl.exe b/deploy/windows-10_x64/tapctl.exe
index 4aff283b..2b1cd36a 100644
Binary files a/deploy/windows-10_x64/tapctl.exe and b/deploy/windows-10_x64/tapctl.exe differ
diff --git a/deploy/windows-10_x86/libcrypto-1_1.dll b/deploy/windows-10_x86/libcrypto-1_1.dll
index 3ce169c2..8f51d6db 100644
Binary files a/deploy/windows-10_x86/libcrypto-1_1.dll and b/deploy/windows-10_x86/libcrypto-1_1.dll differ
diff --git a/deploy/windows-10_x86/liblzo2-2.dll b/deploy/windows-10_x86/liblzo2-2.dll
index e88d1766..5f4cf0b4 100644
Binary files a/deploy/windows-10_x86/liblzo2-2.dll and b/deploy/windows-10_x86/liblzo2-2.dll differ
diff --git a/deploy/windows-10_x86/libpkcs11-helper-1.dll b/deploy/windows-10_x86/libpkcs11-helper-1.dll
index 5cfddebe..8a2063cb 100644
Binary files a/deploy/windows-10_x86/libpkcs11-helper-1.dll and b/deploy/windows-10_x86/libpkcs11-helper-1.dll differ
diff --git a/deploy/windows-10_x86/libssl-1_1.dll b/deploy/windows-10_x86/libssl-1_1.dll
index d28402fe..ff27b49a 100644
Binary files a/deploy/windows-10_x86/libssl-1_1.dll and b/deploy/windows-10_x86/libssl-1_1.dll differ
diff --git a/deploy/windows-10_x86/openvpn.exe b/deploy/windows-10_x86/openvpn.exe
index f9f8314c..90a6be05 100644
Binary files a/deploy/windows-10_x86/openvpn.exe and b/deploy/windows-10_x86/openvpn.exe differ
diff --git a/deploy/windows-10_x86/tapctl.exe b/deploy/windows-10_x86/tapctl.exe
index 9bfa320d..3c5d9ccd 100644
Binary files a/deploy/windows-10_x86/tapctl.exe and b/deploy/windows-10_x86/tapctl.exe differ
diff --git a/deploy/windows-7_x64/libcrypto-1_1-x64.dll b/deploy/windows-7_x64/libcrypto-1_1-x64.dll
index ca9ec78d..10118a61 100644
Binary files a/deploy/windows-7_x64/libcrypto-1_1-x64.dll and b/deploy/windows-7_x64/libcrypto-1_1-x64.dll differ
diff --git a/deploy/windows-7_x64/liblzo2-2.dll b/deploy/windows-7_x64/liblzo2-2.dll
index 77fa2437..7f25de93 100644
Binary files a/deploy/windows-7_x64/liblzo2-2.dll and b/deploy/windows-7_x64/liblzo2-2.dll differ
diff --git a/deploy/windows-7_x64/libpkcs11-helper-1.dll b/deploy/windows-7_x64/libpkcs11-helper-1.dll
index bcb5eb06..ec9a47aa 100644
Binary files a/deploy/windows-7_x64/libpkcs11-helper-1.dll and b/deploy/windows-7_x64/libpkcs11-helper-1.dll differ
diff --git a/deploy/windows-7_x64/libssl-1_1-x64.dll b/deploy/windows-7_x64/libssl-1_1-x64.dll
index 8c49c6c8..0b498d7b 100644
Binary files a/deploy/windows-7_x64/libssl-1_1-x64.dll and b/deploy/windows-7_x64/libssl-1_1-x64.dll differ
diff --git a/deploy/windows-7_x64/openvpn.exe b/deploy/windows-7_x64/openvpn.exe
index 26576366..3f5746dd 100644
Binary files a/deploy/windows-7_x64/openvpn.exe and b/deploy/windows-7_x64/openvpn.exe differ
diff --git a/deploy/windows-7_x64/tapctl.exe b/deploy/windows-7_x64/tapctl.exe
index 4aff283b..2b1cd36a 100644
Binary files a/deploy/windows-7_x64/tapctl.exe and b/deploy/windows-7_x64/tapctl.exe differ
diff --git a/deploy/windows-7_x86/libcrypto-1_1.dll b/deploy/windows-7_x86/libcrypto-1_1.dll
index 3ce169c2..8f51d6db 100644
Binary files a/deploy/windows-7_x86/libcrypto-1_1.dll and b/deploy/windows-7_x86/libcrypto-1_1.dll differ
diff --git a/deploy/windows-7_x86/liblzo2-2.dll b/deploy/windows-7_x86/liblzo2-2.dll
index e88d1766..5f4cf0b4 100644
Binary files a/deploy/windows-7_x86/liblzo2-2.dll and b/deploy/windows-7_x86/liblzo2-2.dll differ
diff --git a/deploy/windows-7_x86/libpkcs11-helper-1.dll b/deploy/windows-7_x86/libpkcs11-helper-1.dll
index 5cfddebe..8a2063cb 100644
Binary files a/deploy/windows-7_x86/libpkcs11-helper-1.dll and b/deploy/windows-7_x86/libpkcs11-helper-1.dll differ
diff --git a/deploy/windows-7_x86/libssl-1_1.dll b/deploy/windows-7_x86/libssl-1_1.dll
index d28402fe..ff27b49a 100644
Binary files a/deploy/windows-7_x86/libssl-1_1.dll and b/deploy/windows-7_x86/libssl-1_1.dll differ
diff --git a/deploy/windows-7_x86/openvpn.exe b/deploy/windows-7_x86/openvpn.exe
index f9f8314c..90a6be05 100644
Binary files a/deploy/windows-7_x86/openvpn.exe and b/deploy/windows-7_x86/openvpn.exe differ
diff --git a/deploy/windows-7_x86/tapctl.exe b/deploy/windows-7_x86/tapctl.exe
index 9bfa320d..3c5d9ccd 100644
Binary files a/deploy/windows-7_x86/tapctl.exe and b/deploy/windows-7_x86/tapctl.exe differ
diff --git a/repository/build_macos.sh b/repository/build_macos.sh
index faab0105..ca2081fe 100644
--- a/repository/build_macos.sh
+++ b/repository/build_macos.sh
@@ -2,11 +2,19 @@
set -e
+
+# Currently 2021-02-03 "VS for Mac" works under Rosetta, and for example App.CLI.MacOS.Elevated will be build (because called from VS prebuild) in x86_64 even on Apple M1 (arm64).
+# This avoid the issue. Can be cleaned when "VS for Mac" will be released for arm64.
+# The below file it's checked in /src/App.CLI.MacOS.Elevated/build.sh
+# The below file it's checked in /src/eddie.macos.prebuild.sh to allow pick the right deploy folder for whitelist hashing
+uname -m >/tmp/eddie_deploy_arch_native.txt
+
# rm -f files/*
+
+
# Note: first, ensure deploy files signature. Normally are done by building script, this is an exception.
# Otherwise, openvpn will be signed after the compilation of Elevated, that will contain a mismatch sha256.
-
macos_common/presign.sh
# CLI edition exists, but Xamarin build an .app bundle and
@@ -26,13 +34,16 @@ macos_common/presign.sh
# Mojave works witn 10.9, don't work with 10.15 (throw a SystemNetworkInformation exception, due libc.dylib link issue)
# High Sierra works with 10.15 AND 10.9.
-macos_portable/build.sh ui x64 macos-10.9
-macos_portable/build.sh ui x64 macos-10.15
-
-macos_pkg/build.sh ui x64 macos-10.9
-macos_pkg/build.sh ui x64 macos-10.15
-
-macos_dmg/build.sh ui x64 macos-10.9
-macos_dmg/build.sh ui x64 macos-10.15
+# Need arch diff
+VARARCH=$(cat /tmp/eddie_deploy_arch_native.txt)
+if [ ${VARARCH} = "x86_64" ]; then
+ macos_portable/build.sh ui macos-10.9
+ macos_pkg/build.sh ui macos-10.9
+ macos_dmg/build.sh ui macos-10.9
+fi
+
+macos_portable/build.sh ui macos-10.15
+macos_pkg/build.sh ui macos-10.15
+macos_dmg/build.sh ui macos-10.15
echo "Done."
diff --git a/repository/linux_arch/build.sh b/repository/linux_arch/build.sh
index a00dc01f..8286cef2 100644
--- a/repository/linux_arch/build.sh
+++ b/repository/linux_arch/build.sh
@@ -22,7 +22,8 @@ CONFIG=Release
SCRIPTDIR=$(dirname $(realpath -s $0))
ARCH=$($SCRIPTDIR/../linux_common/get-arch.sh)
VERSION=$($SCRIPTDIR/../linux_common/get-version.sh)
-VERSIONSTABLE="2.18.9"
+#VERSIONSTABLE="2.18.9"
+VERSIONSTABLE=$(curl --silent "https://api.github.com/repos/AirVPN/Eddie/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
TARGETDIR=/tmp/eddie_deploy/eddie-${PROJECT}_${VERSION}_linux_${ARCH}_arch
DEPLOYPATH=${SCRIPTDIR}/../files/eddie-${PROJECT}_${VERSION}_linux_${ARCH}_arch.tar.zst
@@ -99,7 +100,9 @@ function arch_env() {
sed -i "s|{@pkgdepends}|(mono openvpn sudo desktop-file-utils libnotify libappindicator-gtk2)|g" PKGBUILD
fi
sed -i "s|{@source}|https://github.com/AirVPN/Eddie/archive/${VERSIONSTABLE}.tar.gz|g" PKGBUILD
- echo Enter AUR passphrase if requested
+ if test -f "${SCRIPTDIR}/../signing/aur.key.password.txt"; then # Staff AirVPN
+ echo if requested, enter $(cat "${SCRIPTDIR}/../signing/aur.key.password.txt") as passphrase
+ fi
git clone ssh://aur@aur.archlinux.org/eddie-${PROJECT}.git
cd eddie-${PROJECT}
cp ../PKGBUILD .
diff --git a/repository/macos_common/compile.sh b/repository/macos_common/compile.sh
index 66b9a59c..777b0a1d 100644
--- a/repository/macos_common/compile.sh
+++ b/repository/macos_common/compile.sh
@@ -36,6 +36,7 @@ fi
RULESETPATH="${SCRIPTDIR}/../../src/ruleset/norules.ruleset"
ARCHCOMPILE=${ARCH}
+ARCHCOMPILE=x64
# Unlike other platform, the pre-build / post-build script are already in .vcproj, managed by msbuild correctly
diff --git a/repository/macos_common/deploy.sh b/repository/macos_common/deploy.sh
index 3602be11..4c6050af 100644
--- a/repository/macos_common/deploy.sh
+++ b/repository/macos_common/deploy.sh
@@ -7,9 +7,13 @@ realpath() {
}
SCRIPTDIR=$(dirname $(realpath "$0"))
+REMOTEDIR=$2
+if [[ ${REMOTEDIR} == "internal" ]]; then
+ REMOTEDIR=/home/www/repository/eddie/internal
+fi
if test -f "${SCRIPTDIR}/../signing/eddie.website_deploy.key"; then # Staff AirVPN
chmod 600 "${SCRIPTDIR}/../signing/eddie.website_deploy.key"
echo Send to eddie.website server: $1
- scp -P 46333 -i "${SCRIPTDIR}/../signing/eddie.website_deploy.key" "$1" deploy@eddie.website:/home/www/repository/eddie/internal
+ scp -P 46333 -i "${SCRIPTDIR}/../signing/eddie.website_deploy.key" "$1" deploy@eddie.website:${REMOTEDIR}
fi
diff --git a/repository/macos_common/notarize.sh b/repository/macos_common/notarize.sh
index 9be63815..184fc6a1 100644
--- a/repository/macos_common/notarize.sh
+++ b/repository/macos_common/notarize.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# First argument must be file package
-# Second argument must be project (cli/ui)
+# Second argument must be bundle id
# set -euo pipefail
@@ -10,7 +10,7 @@ realpath() {
}
FILENOTARIZE=$1
-PROJECT=$2
+APPLE_NOTARIZE_BUNDLE_ID=$2
SCRIPTDIR=$(dirname $(realpath "$0"))
@@ -21,7 +21,6 @@ if test -f "${SCRIPTDIR}/../signing/apple-dev-id.txt"; then
APPLE_NOTARIZE_USERNAME=$(cat ${SCRIPTDIR}/../signing/apple-notarize-username.txt)
APPLE_NOTARIZE_PASSWORD=$(cat ${SCRIPTDIR}/../signing/apple-notarize-password.txt)
- APPLE_NOTARIZE_BUNDLE_ID="org.airvpn.eddie.${PROJECT}"
APPLE_NOTARIZE_ASC_PROVIDER=$(cat ${SCRIPTDIR}/../signing/apple-notarize-asc-provider.txt)
echo "Notarization Upload..."
@@ -33,6 +32,7 @@ if test -f "${SCRIPTDIR}/../signing/apple-dev-id.txt"; then
echo 2- if fail with 'You must first sign the relevant contracts online. (1048)', goto https://developer.apple.com/account/ , login and accept the new TOS.
echo ----
+ echo xcrun altool --notarize-app --primary-bundle-id "$APPLE_NOTARIZE_BUNDLE_ID" --username "$APPLE_NOTARIZE_USERNAME" --password "$APPLE_NOTARIZE_PASSWORD" --asc-provider "$APPLE_NOTARIZE_ASC_PROVIDER" --file "${FILENOTARIZE}" 2>&1 | awk '/RequestUUID/ { print $NF; }'
requestUUID=$(xcrun altool --notarize-app --primary-bundle-id "$APPLE_NOTARIZE_BUNDLE_ID" --username "$APPLE_NOTARIZE_USERNAME" --password "$APPLE_NOTARIZE_PASSWORD" --asc-provider "$APPLE_NOTARIZE_ASC_PROVIDER" --file "${FILENOTARIZE}" 2>&1 | awk '/RequestUUID/ { print $NF; }')
echo "Notarization RequestUUID: $requestUUID"
diff --git a/repository/macos_common/presign.sh b/repository/macos_common/presign.sh
index 2541cdba..065530c9 100644
--- a/repository/macos_common/presign.sh
+++ b/repository/macos_common/presign.sh
@@ -7,13 +7,14 @@ realpath() {
}
SCRIPTDIR=$(dirname $(realpath "$0"))
+ARCH=$($SCRIPTDIR/../macos_common/get-arch.sh)
-${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_x64/openvpn" no yes
-${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_x64/libcrypto.1.1.dylib" no yes
-${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_x64/liblzo2.2.dylib" no yes
-${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_x64/libpkcs11-helper.1.dylib" no yes
-${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_x64/libssl.1.1.dylib" no yes
-${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_x64/hummingbird" no yes
-${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_x64/stunnel" no yes
+${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_${ARCH}/openvpn" no yes
+${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_${ARCH}/libcrypto.1.1.dylib" no yes
+${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_${ARCH}/liblzo2.2.dylib" no yes
+${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_${ARCH}/libpkcs11-helper.1.dylib" no yes
+${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_${ARCH}/libssl.1.1.dylib" no yes
+${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_${ARCH}/hummingbird" no yes
+${SCRIPTDIR}/sign.sh "${SCRIPTDIR}/../../deploy/macos_${ARCH}/stunnel" no yes
echo "Pre-sign done."
diff --git a/repository/macos_common/sign.sh b/repository/macos_common/sign.sh
index f93b7a19..e36689e5 100644
--- a/repository/macos_common/sign.sh
+++ b/repository/macos_common/sign.sh
@@ -41,8 +41,15 @@ if [ ${VARSTAFF} = "yes" ]; then
if [ ${DOSIGN} = "no" ]; then
set +e
codesign --verify -v "${VARPATH}"
- if [ $? -eq 0 ]; then
- echo "Signing, already: ${VARPATH}"
+ if [ $? -eq 0 ]; then
+ # Files with 'Signature=adhoc' pass verify, ensure there is an Authority
+ VARAUTHORITY=$(codesign -dv --verbose=4 "${VARPATH}" 2>&1 | grep Authority)
+ if [ -z "$VARAUTHORITY" ]; then
+ echo "Detected signed without Authority, resign"
+ DOSIGN="yes"
+ else
+ echo "Signing, already: ${VARPATH}"
+ fi
else
DOSIGN="yes"
fi
diff --git a/repository/macos_dmg/build.sh b/repository/macos_dmg/build.sh
index 9bae8b92..3349dce0 100644
--- a/repository/macos_dmg/build.sh
+++ b/repository/macos_dmg/build.sh
@@ -13,18 +13,12 @@ if [ "$1" == "" ]; then
fi
if [ "$2" == "" ]; then
- echo Second arg must be Architecture: x64
- exit 1
-fi
-
-if [ "$3" == "" ]; then
- echo Third arg must be OS: 10.9,10.15
+ echo Second arg must be OS: 10.9,10.15
exit 1
fi
PROJECT=$1
-ARCH=$2
-VAROS=$3
+VAROS=$2
CONFIG=Release
VARSTAFF="no"
@@ -32,7 +26,7 @@ if test -f "${SCRIPTDIR}/../signing/apple-dev-id.txt"; then # Staff AirVPN
VARSTAFF="yes"
fi
-# ARCH=$($SCRIPTDIR/../macos_common/get-arch.sh)
+ARCH=$($SCRIPTDIR/../macos_common/get-arch.sh)
VERSION=$($SCRIPTDIR/../macos_common/get-version.sh)
TARGETDIR=/tmp/eddie_deploy/eddie-${PROJECT}_${VERSION}_${VAROS}_${ARCH}_disk_temp.dmg
@@ -96,12 +90,12 @@ fi
# Notarization - Not need
# if [ ${VARSTAFF} = "yes" ]; then
-# "${SCRIPTDIR}/../macos_common/notarize.sh" "${FINALPATH}" "${PROJECT}"
+# "${SCRIPTDIR}/../macos_common/notarize.sh" "${FINALPATH}" "org.airvpn.eddie.${PROJECT}"
# fi
# Deploy to eddie.website
-${SCRIPTDIR}/../macos_common/deploy.sh ${FINALPATH}
+${SCRIPTDIR}/../macos_common/deploy.sh ${FINALPATH} "internal"
# End
diff --git a/repository/macos_pkg/build.sh b/repository/macos_pkg/build.sh
index 2a9a1918..d5a757be 100644
--- a/repository/macos_pkg/build.sh
+++ b/repository/macos_pkg/build.sh
@@ -13,18 +13,12 @@ if [ "$1" == "" ]; then
fi
if [ "$2" == "" ]; then
- echo Second arg must be Architecture: x64
- exit 1
-fi
-
-if [ "$3" == "" ]; then
- echo Third arg must be OS: 10.9,10.15
+ echo Second arg must be OS: 10.9,10.15
exit 1
fi
PROJECT=$1
-ARCH=$2
-VAROS=$3
+VAROS=$2
CONFIG=Release
VARSTAFF="no"
@@ -32,7 +26,7 @@ if test -f "${SCRIPTDIR}/../signing/apple-dev-id.txt"; then # Staff AirVPN
VARSTAFF="yes"
fi
-# ARCH=$($SCRIPTDIR/../macos_common/get-arch.sh)
+ARCH=$($SCRIPTDIR/../macos_common/get-arch.sh)
VERSION=$($SCRIPTDIR/../macos_common/get-version.sh)
TARGETDIR=/tmp/eddie_deploy/eddie-${PROJECT}_${VERSION}_${VAROS}_${ARCH}_installer_temp.pkg
@@ -85,7 +79,7 @@ fi
if [ ${VARSTAFF} = "yes" ]; then
if [ ${VARHARDENING} = "yes" ]; then
- "${SCRIPTDIR}/../macos_common/notarize.sh" "${FINALPATH}" "${PROJECT}"
+ "${SCRIPTDIR}/../macos_common/notarize.sh" "${FINALPATH}" "org.airvpn.eddie.${PROJECT}"
fi
fi
@@ -95,7 +89,7 @@ mv ${FINALPATH} ${DEPLOYPATH}
# Deploy to eddie.website
-"${SCRIPTDIR}/../macos_common/deploy.sh" "${DEPLOYPATH}"
+"${SCRIPTDIR}/../macos_common/deploy.sh" "${DEPLOYPATH}" "internal"
# Cleanup
diff --git a/repository/macos_portable/build.sh b/repository/macos_portable/build.sh
index 4a72ef22..ddc07545 100644
--- a/repository/macos_portable/build.sh
+++ b/repository/macos_portable/build.sh
@@ -16,12 +16,7 @@ if [ "$1" == "" ]; then
fi
if [ "$2" == "" ]; then
- echo Second arg must be Architecture: x64
- exit 1
-fi
-
-if [ "$3" == "" ]; then
- echo Third arg must be OS: 10.9,10.15
+ echo Second arg must be OS: 10.9,10.15
exit 1
fi
@@ -37,8 +32,7 @@ if ! [ -x "$(command -v msbuild)" ]; then
fi
PROJECT=$1
-ARCH=$2
-VAROS=$3
+VAROS=$2
CONFIG=Release
VARSTAFF="no"
@@ -46,8 +40,7 @@ if test -f "${SCRIPTDIR}/../signing/apple-dev-id.txt"; then # Staff AirVPN
VARSTAFF="yes"
fi
-# ARCH=$($SCRIPTDIR/../macos_common/get-arch.sh)
-
+ARCH=$($SCRIPTDIR/../macos_common/get-arch.sh)
VERSION=$($SCRIPTDIR/../macos_common/get-version.sh)
TARGETDIR=/tmp/eddie_deploy/eddie-${PROJECT}_${VERSION}_${VAROS}_${ARCH}_portable
@@ -69,7 +62,8 @@ rm -rf /tmp/eddie_deploy
echo Step: Compile
-ARCHCOMPILE=${ARCH}
+# ARCHCOMPILE=${ARCH}
+ARCHCOMPILE=x64
"${SCRIPTDIR}/../macos_common/compile.sh" ${PROJECT}
@@ -215,15 +209,14 @@ fi
if [ ${VARSTAFF} = "yes" ]; then
if [ ${VARHARDENING} = "yes" ]; then
- "${SCRIPTDIR}/../macos_common/notarize.sh" "${FINALPATH}" "${PROJECT}"
- echo "${SCRIPTDIR}/../macos_common/notarize.sh" "${FINALPATH}" "${PROJECT}"
+ "${SCRIPTDIR}/../macos_common/notarize.sh" "${FINALPATH}" "org.airvpn.eddie.${PROJECT}"
fi
fi
# Deploy to eddie.website
if [ ${VARSTAFF} = "yes" ]; then
- "${SCRIPTDIR}/../macos_common/deploy.sh" "${FINALPATH}"
+ "${SCRIPTDIR}/../macos_common/deploy.sh" "${FINALPATH}" "internal"
fi
# End
diff --git a/src/App.CLI.Common.Elevated/hashes.h b/src/App.CLI.Common.Elevated/hashes.h
index ff2a4b15..0e72edfc 100644
--- a/src/App.CLI.Common.Elevated/hashes.h
+++ b/src/App.CLI.Common.Elevated/hashes.h
@@ -16,5 +16,5 @@
// along with Eddie. If not, see .
//
-const std::string expectedOpenvpnHash = "6cf2dae78cf4bee2c5f03ddf1e0bed922ac426d4fa672760d68a4253eef5db1c";
-const std::string expectedHummingbirdHash = "facd09b146b7c41758a9105f1c2415c482e7c24816cc9f3e15d72551495955ae";
+const std::string expectedOpenvpnHash = "60a130c2d465b162b158e96ad8907b8cc1cc51f881e5cd33d141821a3d08df38";
+const std::string expectedHummingbirdHash = "6734448c4b02adde44d8f5f1d6164015266ce6e2e03d254499a44c9d2972cc3a";
diff --git a/src/App.CLI.Common.Elevated/ibase.cpp b/src/App.CLI.Common.Elevated/ibase.cpp
index bec98c45..83159f58 100644
--- a/src/App.CLI.Common.Elevated/ibase.cpp
+++ b/src/App.CLI.Common.Elevated/ibase.cpp
@@ -599,12 +599,15 @@ void IBase::Do(const std::string& commandId, const std::string& command, std::ma
std::vector paths;
AddTorCookiePaths(processPath, username, paths);
+
+ LogRemote("pazzo tor search");
for (std::vector::const_iterator i = paths.begin(); i != paths.end(); ++i)
{
std::string path = *i;
if (FsFileExists(path))
{
+ LogRemote("pazzo tor found:" + path);
std::vector chars = FsFileReadBytes(path);
if (chars.size() > 0)
{
diff --git a/src/App.CLI.Common.Elevated/iposix.cpp b/src/App.CLI.Common.Elevated/iposix.cpp
index 16646dc5..5751e009 100644
--- a/src/App.CLI.Common.Elevated/iposix.cpp
+++ b/src/App.CLI.Common.Elevated/iposix.cpp
@@ -276,6 +276,8 @@ void IPosix::AddTorCookiePaths(const std::string& torPath, const std::string& us
result.push_back("/var/run/tor/control.authcookie");
result.push_back("/var/lib/tor/control_auth_cookie");
+ result.push_back("/run/tor/control.authcookie"); // Default Ubuntu 20.04.1 LTS tor from official repo
+ result.push_back("/run/tor/control_auth_cookie"); // Variant of above
}
// --------------------------
@@ -334,20 +336,16 @@ std::string IPosix::GetCmdlineOfProcessId(pid_t pid)
std::string result;
FILE *f;
- char ch;
f = fopen(path.c_str(), "rb");
if(f == NULL)
return "";
for(;;)
{
- ch = fgetc(f);
- if(ch == EOF)
+ int chI = fgetc(f);
+ if(chI == EOF)
break;
-
- #ifdef __arm__
- // Workaround. The if(ch == EOF) above never match under raspbian (at least Buster) EOF==-1. The if(ch == 255) below throw a warning constant-out-of-range under macOS. Need investigation.
- if(ch == 255) break;
- #endif
+
+ unsigned char ch = (unsigned char) chI;
if(ch == 0)
result += " ";
diff --git a/src/App.CLI.MacOS.Elevated/build.sh b/src/App.CLI.MacOS.Elevated/build.sh
index f10d7b02..0e6b65db 100644
--- a/src/App.CLI.MacOS.Elevated/build.sh
+++ b/src/App.CLI.MacOS.Elevated/build.sh
@@ -14,8 +14,11 @@ fi
BASEPATH=$(dirname $(realpath "$0"))
mkdir -p "$BASEPATH/bin"
+# See comment in /repository/build_macos.sh
+VARARCH=$(cat /tmp/eddie_deploy_arch_native.txt)
+
# Dynamic edition
-g++ -mmacosx-version-min=10.9 -o "$BASEPATH/bin/eddie-cli-elevated" "$BASEPATH/src/main.cpp" "$BASEPATH/src/impl.cpp" "$BASEPATH/../App.CLI.Common.Elevated/iposix.cpp" "$BASEPATH/../App.CLI.Common.Elevated/ibase.cpp" "$BASEPATH/../App.CLI.Common.Elevated/sha256.cpp" -Wall -std=c++11 -O3 -pthread -lpthread -D$1
+g++ -mmacosx-version-min=10.9 -arch ${VARARCH} -o "$BASEPATH/bin/eddie-cli-elevated" "$BASEPATH/src/main.cpp" "$BASEPATH/src/impl.cpp" "$BASEPATH/../App.CLI.Common.Elevated/iposix.cpp" "$BASEPATH/../App.CLI.Common.Elevated/ibase.cpp" "$BASEPATH/../App.CLI.Common.Elevated/sha256.cpp" -Wall -std=c++11 -O3 -pthread -lpthread -D$1
chmod a+x "$BASEPATH/bin/eddie-cli-elevated"
echo Done
diff --git a/src/App.Cocoa.MacOS/App.Cocoa.macOS.csproj b/src/App.Cocoa.MacOS/App.Cocoa.macOS.csproj
index 8b8e91fe..eb14308e 100644
--- a/src/App.Cocoa.MacOS/App.Cocoa.macOS.csproj
+++ b/src/App.Cocoa.MacOS/App.Cocoa.macOS.csproj
@@ -65,7 +65,7 @@
- ..\..\..\..\..\..\Library\Frameworks\Xamarin.Mac.framework\Versions\6.18.2.1\lib\reference\full\Xamarin.Mac.dll
+ ..\..\..\..\..\..\Library\Frameworks\Xamarin.Mac.framework\Versions\Current\lib\reference\full\Xamarin.Mac.dll
diff --git a/src/App.Cocoa.MacOS/Info.plist b/src/App.Cocoa.MacOS/Info.plist
index 32a6ae74..57b56ba2 100644
--- a/src/App.Cocoa.MacOS/Info.plist
+++ b/src/App.Cocoa.MacOS/Info.plist
@@ -17,7 +17,7 @@
LSApplicationCategoryType
public.app-category.utilities
CFBundleShortVersionString
- 2.19.7
+ 2.20.0
CFBundleIdentifier
org.airvpn.eddie.ui
CFBundleDisplayName
diff --git a/src/App.Cocoa.MacOS/MainWindow.xib b/src/App.Cocoa.MacOS/MainWindow.xib
index ebcf79cf..b6d2f1b3 100644
--- a/src/App.Cocoa.MacOS/MainWindow.xib
+++ b/src/App.Cocoa.MacOS/MainWindow.xib
@@ -1,8 +1,7 @@
-
+
-
-
+
@@ -105,18 +104,18 @@
-
+
-
+
-
+
@@ -126,7 +125,7 @@
-
+
@@ -136,14 +135,14 @@
-
+
-
+
@@ -158,7 +157,7 @@
-
+
@@ -170,7 +169,7 @@
-
-
+
@@ -450,7 +449,7 @@
-
+
@@ -466,7 +465,7 @@
-
+
@@ -477,7 +476,7 @@
-
+
@@ -488,7 +487,7 @@
-
+
@@ -496,16 +495,16 @@
-
+
-
+
-
-
+
+
@@ -513,7 +512,6 @@
-
@@ -522,7 +520,6 @@
-
@@ -535,7 +532,6 @@
-
@@ -548,7 +544,6 @@
-
@@ -561,7 +556,6 @@
-
@@ -580,16 +574,16 @@
-
-
+
+
-
+
-
+
@@ -601,16 +595,16 @@
-
+
-
+
-
-
+
+
@@ -618,7 +612,6 @@
-
@@ -627,7 +620,6 @@
-
@@ -636,7 +628,6 @@
-
@@ -649,7 +640,6 @@
-
@@ -658,7 +648,6 @@
-
@@ -671,7 +660,6 @@
-
@@ -684,7 +672,6 @@
-
@@ -693,7 +680,6 @@
-
@@ -706,7 +692,6 @@
-
@@ -725,20 +710,20 @@
-
-
+
+
-
+
-
+
-
+
@@ -746,7 +731,7 @@
-
+
@@ -754,7 +739,7 @@
-
+
@@ -765,7 +750,7 @@
-
+
@@ -776,7 +761,7 @@
-
+
@@ -787,7 +772,7 @@
-
+
@@ -798,7 +783,7 @@
-
+
@@ -815,7 +800,7 @@
-
+
@@ -823,7 +808,7 @@
-
+
@@ -832,7 +817,7 @@
-
+
@@ -840,7 +825,7 @@
-
+
@@ -856,16 +841,16 @@
-
+
-
+
-
-
+
+
@@ -873,7 +858,6 @@
-
@@ -882,7 +866,6 @@
-
@@ -891,7 +874,6 @@
-
@@ -904,7 +886,6 @@
-
@@ -917,7 +898,6 @@
-
@@ -926,7 +906,6 @@
-
@@ -939,7 +918,6 @@
-
@@ -957,20 +935,20 @@
-
+
-
+
-
+
-
+
@@ -978,7 +956,7 @@
-
+
@@ -986,7 +964,7 @@
-
+
@@ -1002,11 +980,11 @@
-
+
-
+
@@ -1015,7 +993,7 @@
-
+
@@ -1032,16 +1010,16 @@
-
+
-
+
-
-
+
+
@@ -1049,7 +1027,6 @@
-
@@ -1058,7 +1035,6 @@
-
@@ -1071,7 +1047,6 @@
-
@@ -1086,11 +1061,11 @@
-
-
+
+
-
+
@@ -1103,16 +1078,16 @@
-
+
-
+
-
-
+
+
@@ -1120,7 +1095,6 @@
-
@@ -1129,7 +1103,6 @@
-
@@ -1142,7 +1115,6 @@
-
@@ -1160,20 +1132,20 @@
-
-
+
+
-
+
-
+
-
+
@@ -1181,7 +1153,7 @@
-
+
@@ -1189,7 +1161,7 @@
-
+
@@ -1197,7 +1169,7 @@
-
+
@@ -1205,7 +1177,7 @@
-
+
@@ -1218,17 +1190,17 @@
-
+
-
+
-
+
@@ -1237,12 +1209,12 @@
-
+
-
+
diff --git a/src/App.Cocoa.MacOS/MainWindowController.cs b/src/App.Cocoa.MacOS/MainWindowController.cs
index a80e2693..18a4fbce 100644
--- a/src/App.Cocoa.MacOS/MainWindowController.cs
+++ b/src/App.Cocoa.MacOS/MainWindowController.cs
@@ -175,11 +175,21 @@ public override void AwakeFromNib()
EnabledUI();
};
+ TxtLogin.Changed += (object sender, EventArgs e) =>
+ {
+ EnabledUI();
+ };
+
TxtPassword.Activated += (object sender, EventArgs e) =>
{
EnabledUI();
};
+ TxtPassword.Changed += (object sender, EventArgs e) =>
+ {
+ EnabledUI();
+ };
+
CboKey.Activated += (object sender, EventArgs e) =>
{
if(Engine.Instance.Options.Get("key") != CboKey.SelectedItem.Title)
diff --git a/src/Lib.Core/ConnectionActive.cs b/src/Lib.Core/ConnectionActive.cs
index 78316822..6644941d 100644
--- a/src/Lib.Core/ConnectionActive.cs
+++ b/src/Lib.Core/ConnectionActive.cs
@@ -25,9 +25,6 @@ namespace Eddie.Core
{
public class ConnectionActive
{
- public OvpnBuilder OpenVpnProfileStartup;
- public OvpnBuilder OpenVpnProfileWithPush;
-
public List Routes = new List();
public bool TunnelIPv4 = true;
@@ -36,12 +33,7 @@ public class ConnectionActive
public bool BlockedIPv4 = false;
public bool BlockedIPv6 = false;
- public IpAddress Address;
- public int SshLocalPort = 0;
- public int SshRemotePort = 0;
- public int SshPortDestination = 0;
- public int SslLocalPort = 0;
- public int SslRemotePort = 0;
+ public IpAddress Address;
public DateTime TimeStart = DateTime.MinValue;
public IpAddress EntryIP = new IpAddress();
@@ -59,18 +51,27 @@ public class ConnectionActive
public Int64 BytesLastDownloadStep = -1;
public Int64 BytesLastUploadStep = -1;
+ private string m_protocol = "";
+
+ // OpenVPN
+
+ public int SshLocalPort = 0;
+ public int SshRemotePort = 0;
+ public int SshPortDestination = 0;
+ public int SslLocalPort = 0;
+ public int SslRemotePort = 0;
+
+ public OvpnBuilder OpenVpnProfileStartup;
+ public OvpnBuilder OpenVpnProfileWithPush;
+
public List PendingPushDetected = new List();
public string ManagementPassword = "";
public TemporaryFile ManagementPasswordFile;
public TemporaryFile ProxyAuthFile;
public TemporaryFile PasswordAuthFile;
-
public TemporaryFile OvpnFile;
- private string m_protocol = "";
-
-
public string Protocol
{
get
diff --git a/src/Lib.Core/ConnectionInfo.cs b/src/Lib.Core/ConnectionInfo.cs
index 13bf0b1c..2086950f 100644
--- a/src/Lib.Core/ConnectionInfo.cs
+++ b/src/Lib.Core/ConnectionInfo.cs
@@ -199,7 +199,10 @@ public int LoadPerc()
}
public int UsersPerc()
- {
+ {
+ if (UsersMax == 0)
+ return 100;
+
return Conversions.ToInt32((Users * 100) / UsersMax);
}
@@ -693,25 +696,7 @@ public ConnectionActive BuildConnectionActive(bool preview)
connectionActive.AddRoute(torNodeIp, "net_gateway", "Tor Guard");
}
}
-
- // TOCLEAN
- /*
- if(Engine.Instance.GetUseOpenVpnManagement())
- {
- string managementPasswordFile = "dummy.ppw";
- if(preview == false)
- {
- connectionActive.ManagementPassword = RandomGenerator.GetHash();
- connectionActive.ManagementPasswordFile = new TemporaryFile("ppw");
- managementPasswordFile = connectionActive.ManagementPasswordFile.Path;
- Platform.Instance.FileContentsWriteText(managementPasswordFile, connectionActive.ManagementPassword, Encoding.ASCII); // UTF8 not recognized by OpenVPN
- Platform.Instance.FileEnsurePermission(managementPasswordFile, "600");
- }
-
- ovpn.AppendDirective("management", "127.0.0.1 " + Engine.Instance.Options.Get("openvpn.management_port") + " " + ovpn.EncodePath(managementPasswordFile), "");
- }
- */
-
+
Provider.OnBuildConnectionActive(this, connectionActive);
Provider.OnBuildConnectionActiveAuth(connectionActive);
diff --git a/src/Lib.Core/ConnectionTypes/Hummingbird.cs b/src/Lib.Core/ConnectionTypes/Hummingbird.cs
index de91ea0d..9c492f9b 100644
--- a/src/Lib.Core/ConnectionTypes/Hummingbird.cs
+++ b/src/Lib.Core/ConnectionTypes/Hummingbird.cs
@@ -26,6 +26,68 @@ namespace Eddie.Core.ConnectionTypes
{
public class Hummingbird : OpenVPN
{
-
- }
+ public static string TranslateMessage(string str)
+ {
+ if (str == "ERROR: NETWORK_RECV_ERROR") return "ERROR: errors receiving on network socket";
+ else if (str == "ERROR: NETWORK_EOF_ERROR") return "ERROR: EOF received on TCP network socket";
+ else if (str == "ERROR: NETWORK_SEND_ERROR") return "ERROR: errors sending on network socket";
+ else if (str == "ERROR: NETWORK_UNAVAILABLE") return "ERROR: network unavailable";
+ else if (str == "ERROR: DECRYPT_ERROR") return "ERROR: data channel encrypt/decrypt error";
+ else if (str == "ERROR: HMAC_ERROR") return "ERROR: HMAC verification failure";
+ else if (str == "ERROR: REPLAY_ERROR") return "ERROR: error from PacketIDReceive";
+ else if (str == "ERROR: BUFFER_ERROR") return "ERROR: exception thrown in Buffer methods";
+ else if (str == "ERROR: CC_ERROR") return "ERROR: general control channel errors";
+ else if (str == "ERROR: BAD_SRC_ADDR") return "ERROR: packet from unknown source address";
+ else if (str == "ERROR: COMPRESS_ERROR") return "ERROR: compress/decompress errors on data channel";
+ else if (str == "ERROR: RESOLVE_ERROR") return "ERROR: DNS resolution error";
+ else if (str == "ERROR: SOCKET_PROTECT_ERROR") return "ERROR: Error calling protect() method on socket";
+ else if (str == "ERROR: TUN_READ_ERROR") return "ERROR: read errors on tun/tap interface";
+ else if (str == "ERROR: TUN_WRITE_ERROR") return "ERROR: write errors on tun/tap interface";
+ else if (str == "ERROR: TUN_FRAMING_ERROR") return "ERROR: error with tun PF_INET/PF_INET6 prefix";
+ else if (str == "ERROR: TUN_SETUP_FAILED") return "ERROR: error setting up tun/tap interface";
+ else if (str == "ERROR: TUN_IFACE_CREATE") return "ERROR: error creating tun/tap interface";
+ else if (str == "ERROR: TUN_IFACE_DISABLED") return "ERROR: tun/tap interface is disabled";
+ else if (str == "ERROR: TUN_ERROR") return "ERROR: general tun error";
+ else if (str == "ERROR: TUN_REGISTER_RINGS_ERROR") return "ERROR: error registering ring buffers with wintun";
+ else if (str == "ERROR: TAP_NOT_SUPPORTED") return "ERROR: dev tap is present in profile but not supported";
+ else if (str == "ERROR: REROUTE_GW_NO_DNS") return "ERROR: redirect-gateway specified without alt DNS servers";
+ else if (str == "ERROR: TRANSPORT_ERROR") return "ERROR: general transport error";
+ else if (str == "ERROR: TCP_OVERFLOW") return "ERROR: TCP output queue overflow";
+ else if (str == "ERROR: TCP_SIZE_ERROR") return "ERROR: bad embedded uint16_t TCP packet size";
+ else if (str == "ERROR: TCP_CONNECT_ERROR") return "ERROR: client error on TCP connect";
+ else if (str == "ERROR: UDP_CONNECT_ERROR") return "ERROR: client error on UDP connect";
+ else if (str == "ERROR: SSL_ERROR") return "ERROR: errors resulting from read/write on SSL object";
+ else if (str == "ERROR: SSL_PARTIAL_WRITE") return "ERROR: SSL object did not process all written cleartext";
+ else if (str == "ERROR: SSL_CA_MD_TOO_WEAK") return "ERROR: CA message digest is too weak";
+ else if (str == "ERROR: SSL_CA_KEY_TOO_SMALL") return "ERROR: CA key is too small";
+ else if (str == "ERROR: SSL_DH_KEY_TOO_SMALL") return "ERROR: DH key is too small";
+ else if (str == "ERROR: ENCAPSULATION_ERROR") return "ERROR: exceptions thrown during packet encapsulation";
+ else if (str == "ERROR: EPKI_CERT_ERROR") return "ERROR: error obtaining certificate from External PKI provider";
+ else if (str == "ERROR: EPKI_SIGN_ERROR") return "ERROR: error obtaining RSA signature from External PKI provider";
+ else if (str == "ERROR: HANDSHAKE_TIMEOUT") return "ERROR: handshake failed to complete within given time frame";
+ else if (str == "ERROR: KEEPALIVE_TIMEOUT") return "ERROR: lost contact with peer";
+ else if (str == "ERROR: INACTIVE_TIMEOUT") return "ERROR: disconnected due to inactive timer";
+ else if (str == "ERROR: CONNECTION_TIMEOUT") return "ERROR: connection failed to establish within given time";
+ else if (str == "ERROR: PRIMARY_EXPIRE") return "ERROR: primary key context expired";
+ else if (str == "ERROR: TLS_VERSION_MIN") return "ERROR: peer cannot handshake at our minimum required TLS version";
+ else if (str == "ERROR: TLS_AUTH_FAIL") return "ERROR: tls-auth HMAC verification failed";
+ else if (str == "ERROR: TLS_CRYPT_META_FAIL") return "ERROR: tls-crypt-v2 metadata verification failed";
+ else if (str == "ERROR: CERT_VERIFY_FAIL") return "ERROR: peer certificate verification failure";
+ else if (str == "ERROR: PEM_PASSWORD_FAIL") return "ERROR: incorrect or missing PEM private key decryption password";
+ else if (str == "ERROR: AUTH_FAILED") return "ERROR: general authentication failure";
+ else if (str == "ERROR: CLIENT_HALT") return "ERROR: HALT message from server received";
+ else if (str == "ERROR: CLIENT_RESTART") return "ERROR: RESTART message from server received";
+ else if (str == "ERROR: TUN_HALT") return "ERROR: halt command from tun interface";
+ else if (str == "ERROR: RELAY") return "ERROR: RELAY message from server received";
+ else if (str == "ERROR: RELAY_ERROR") return "ERROR: RELAY error";
+ else if (str == "ERROR: N_PAUSE") return "ERROR: Number of transitions to Pause state";
+ else if (str == "ERROR: N_RECONNECT") return "ERROR: Number of reconnections";
+ else if (str == "ERROR: N_KEY_LIMIT_RENEG") return "ERROR: Number of renegotiations triggered by per-key limits such as data or packet limits";
+ else if (str == "ERROR: KEY_STATE_ERROR") return "ERROR: Received packet didn't match expected key state";
+ else if (str == "ERROR: PROXY_ERROR") return "ERROR: HTTP proxy error";
+ else if (str == "ERROR: PROXY_NEED_CREDS") return "ERROR: HTTP proxy needs credentials";
+ else
+ return str;
+ }
+ }
}
diff --git a/src/Lib.Core/Constants.cs b/src/Lib.Core/Constants.cs
index c0bb1ac4..94ceb5ab 100644
--- a/src/Lib.Core/Constants.cs
+++ b/src/Lib.Core/Constants.cs
@@ -30,8 +30,8 @@ public static class Constants
public static byte[] NotSecretPayload = Encoding.UTF8.GetBytes("4af85e84255b077ad890dba297e811b7d016add1");
public static string PasswordIfEmpty = "e6552ddf3ac5c8755a82870d91273a63eab0da1e";
public static string Thanks = "Clodo, PJ, Berserker, ProMIND, zhang888, LZ1, giganerd, Uncle Hunto, go558a83nk, sheivoko, NaDre, pfSense_fan, x0wllaar";
- public static int VersionInt = 273;
- public static string VersionDesc = "2.19.7"; // Used by deploy system also to generate filenames
+ public static int VersionInt = 274;
+ public static string VersionDesc = "2.20.0"; // Used by deploy system also to generate filenames
//public static string VersionShow = VersionDesc + "beta"; // Visible to users
public static string VersionShow = VersionDesc; // Visible to users
public static bool AlphaFeatures = false;
diff --git a/src/Lib.Core/Elevated/Process.cs b/src/Lib.Core/Elevated/Process.cs
index 23f7fa85..caaed0f9 100644
--- a/src/Lib.Core/Elevated/Process.cs
+++ b/src/Lib.Core/Elevated/Process.cs
@@ -58,8 +58,7 @@ public void Kill()
public void Start()
{
if (Platform.Instance.NeedExecuteOutsideAppPath(Command.Parameters["path"]))
- {
- // TOCLEAN string tempPathToDelete = Utils.GetTempPath() + "/eddie-external-process-" + RandomGenerator.GetHash();
+ {
string tempPathToDelete = Platform.Instance.FileTempName(Platform.Instance.FileGetNameFromPath(Command.Parameters["path"]));
if (Platform.Instance.FileExists(tempPathToDelete))
diff --git a/src/Lib.Core/Engine.cs b/src/Lib.Core/Engine.cs
index 1f9f05fe..5823fd12 100644
--- a/src/Lib.Core/Engine.cs
+++ b/src/Lib.Core/Engine.cs
@@ -810,17 +810,6 @@ public void MarkAreasListUpdated()
m_areasInfoUpdated = true;
}
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- public bool SendManagementCommand(string cmd)
- {
- if (m_threadSession != null)
- return m_threadSession.SendManagementCommand(cmd);
- else
- return false;
- }
- */
-
public void SetConnected(bool connected)
{
lock (this)
@@ -972,7 +961,7 @@ public virtual void OnLog(LogEntry l)
}
catch (Exception e)
{
- Logs.Log(LogType.Warning, LanguageManager.FormatText("Log to file disabled due to error, {1}", e.Message));
+ Logs.Log(LogType.Warning, LanguageManager.GetText("LogsDisabledForError", e.Message));
Options.SetBool("log.file.enabled", false);
}
}
@@ -1388,16 +1377,6 @@ public List GetConnections(bool all)
ConnectionInfo.UserListType serverUserList = server.UserList;
AreaInfo.UserListType countryUserList = AreaInfo.UserListType.None;
- /*
- if (m_areas.ContainsKey(server.CountryCode))
- countryUserList = m_areas[server.CountryCode].UserList;
- if (serverUserList == ServerInfo.UserListType.BlackList)
- skip = true;
- else if (countryUserList == AreaInfo.UserListType.BlackList)
- skip = true;
- else if ((serverUserList == ServerInfo.UserListType.None) && (countryUserList == AreaInfo.UserListType.None) && (existsWhiteList))
- skip = true;
- */
if (m_areas.ContainsKey(server.CountryCode))
countryUserList = m_areas[server.CountryCode].UserList;
@@ -1435,8 +1414,16 @@ public List GetConnections(bool all)
}
}
- list.Sort();
- return list;
+ try
+ {
+ // TOFIX: in try/catch because some users report exception, "Failed to compare two elements in the array".
+ list.Sort();
+ }
+ catch(Exception)
+ {
+ }
+
+ return list;
}
public ConnectionInfo PickConnectionByName(string name)
diff --git a/src/Lib.Core/ExtensionsString.cs b/src/Lib.Core/ExtensionsString.cs
index c55d9873..8b2828e8 100644
--- a/src/Lib.Core/ExtensionsString.cs
+++ b/src/Lib.Core/ExtensionsString.cs
@@ -38,7 +38,12 @@ public static int IndexOfInv(this string str, string value)
return str.IndexOf(value, StringComparison.InvariantCulture);
}
- public static bool StartsWithInv(this string str, string value)
+ public static int IndexOfInvLower(this string str, string value)
+ {
+ return str.ToLowerInvariant().IndexOf(value.ToLowerInvariant(), StringComparison.InvariantCulture);
+ }
+
+ public static bool StartsWithInv(this string str, string value)
{
return str.StartsWith(value, StringComparison.InvariantCulture);
}
diff --git a/src/Lib.Core/ExtensionsXml.cs b/src/Lib.Core/ExtensionsXml.cs
index 6f4229b7..d8dc3b89 100644
--- a/src/Lib.Core/ExtensionsXml.cs
+++ b/src/Lib.Core/ExtensionsXml.cs
@@ -143,23 +143,6 @@ public static XmlElement GetFirstElementByTagName(this XmlElement node, string n
return null;
}
- // Utils, can be extension (TODO)
-
- public static void ZZZZ_XmlRenameTagName(XmlElement parent, string oldName, string newName) // TOCLEAN
- {
- foreach (XmlElement e in parent.GetElementsByTagName(oldName))
- {
- // TODO
- }
- }
-
- public static string ZZZZ_XmlGetBody(XmlElement node) // TOCLEAN
- {
- if (node == null)
- return "";
- return node.InnerText;
- }
-
// Utils, not extension
public static void XmlCopyElement(XmlElement source, XmlElement parentDestination)
diff --git a/src/Lib.Core/Jobs/Latency.cs b/src/Lib.Core/Jobs/Latency.cs
index 7ff18dbd..ba8b5226 100644
--- a/src/Lib.Core/Jobs/Latency.cs
+++ b/src/Lib.Core/Jobs/Latency.cs
@@ -165,7 +165,7 @@ public bool GetCanRun()
public int GetPingerDelayValid(ConnectionInfo server) // Delay for consider valid
{
int delay = Engine.Instance.Options.GetInt("pinger.valid");
- if (delay == 0)
+ if (delay == 0)
delay = GetPingerDelaySuccess(server) * 5;
return delay;
}
@@ -266,9 +266,8 @@ public bool GetValid()
}
public List GetConnectionsToPing()
- {
- // Old: Engine.Instance.Connections.Values
- List connections = Engine.Instance.GetConnections(false);
+ {
+ List connections = Engine.Instance.GetConnections(false);
return connections;
}
}
diff --git a/src/Lib.Core/LanguageManager.cs b/src/Lib.Core/LanguageManager.cs
index 35ce1d91..e982df71 100644
--- a/src/Lib.Core/LanguageManager.cs
+++ b/src/Lib.Core/LanguageManager.cs
@@ -318,6 +318,8 @@ public static string GetTextTemp(string id)
// Hardcoded string that need to be moved in language system
//if (id == "StatsVpnDataChannel") return "VPN Data Channel";
+ if (id == "LogsDisabledForError") return "Log to file disabled due to error, {1}";
+
return "";
}
}
diff --git a/src/Lib.Core/Options.cs b/src/Lib.Core/Options.cs
index 924ee35d..46561dc6 100644
--- a/src/Lib.Core/Options.cs
+++ b/src/Lib.Core/Options.cs
@@ -498,7 +498,7 @@ public void EnsureDefaults()
SetDefault("openvpn.directives.data-ciphers", "text", "AES-256-GCM:AES-256-CBC:AES-192-GCM:AES-192-CBC:AES-128-GCM:AES-128-CBC", NotInMan);
SetDefault("openvpn.directives.data-ciphers-fallback", "text", "AES-256-CBC", NotInMan);
SetDefaultBool("openvpn.directives.chacha20", false, NotInMan); // Temporary
- //SetDefaultBool("openvpn.allow.script-security", false, NotInMan);
+ //SetDefaultBool("openvpn.allow.script-security", false, NotInMan);
SetDefaultBool("openvpn.skip_defaults", false, LanguageManager.GetText("ManOptionOpenVpnSkipDefaults"));
// Not in Settings
@@ -555,7 +555,7 @@ public void EnsureDefaults()
SetDefaultBool("windows.workarounds", false, NotInMan); // If true, some variants to identify issues
SetDefaultBool("windows.ipv6.bypass_dns", false, NotInMan); // 2.14: Workaround, skip DNS6.
SetDefaultBool("windows.ssh.plink.force", true, NotInMan); // Switch to false when stable/tested.
- SetDefaultBool("windows.wintun", false, NotInMan); // Switch to true when stable/tested.
+ SetDefaultBool("windows.wintun", false, NotInMan);
// Linux only
SetDefault("linux.dns.services", "text", "nscd;dnsmasq;named;bind9;systemd-resolved", NotInMan);
diff --git a/src/Lib.Core/PingerJob.cs b/src/Lib.Core/PingerJob.cs
index ea62c0ec..999e53f3 100644
--- a/src/Lib.Core/PingerJob.cs
+++ b/src/Lib.Core/PingerJob.cs
@@ -46,7 +46,7 @@ public void Run()
if( (ip == null) || (ip.Valid == false) )
throw new Exception("Invalid ip");
routeScope = new RouteScope(ip.ToString());
- Int64 result = Platform.Instance.Ping(ip, Engine.Instance.Options.GetInt("pinger.timeout"));
+ Int64 result = Platform.Instance.Ping(ip, Engine.Instance.Options.GetInt("pinger.timeout"));
if ( (Engine.Instance == null) || (Engine.Instance.JobsManager == null) || (Engine.Instance.JobsManager.Latency == null) )
return; // Avoid unidentified crash
diff --git a/src/Lib.Core/Providers/Manifest.cs b/src/Lib.Core/Providers/Manifest.cs
index 604d7c17..00d5e32c 100644
--- a/src/Lib.Core/Providers/Manifest.cs
+++ b/src/Lib.Core/Providers/Manifest.cs
@@ -487,14 +487,18 @@ public List GetBootstrapUrls()
{
List urls = new List();
- // Manual Urls
+ // Manual URLs
foreach (string url in Engine.Instance.Options.Get("bootstrap.urls").Split(';'))
{
string sUrl = url.Trim();
if (sUrl != "")
{
- if (IpAddress.IsIP(sUrl))
- sUrl = "http://" + sUrl;
+ IpAddress ip = new IpAddress(sUrl);
+ if (ip.IsV4)
+ sUrl = "http://" + ip.ToString();
+ else
+ sUrl = "http://[" + ip.ToString() + "]";
+
string host = Utils.HostFromUrl(sUrl);
if (host != "")
urls.Add(sUrl);
diff --git a/src/Lib.Core/Storage.cs b/src/Lib.Core/Storage.cs
index 38fda489..68688703 100644
--- a/src/Lib.Core/Storage.cs
+++ b/src/Lib.Core/Storage.cs
@@ -359,7 +359,7 @@ public static void DecodeFormat(byte[] b, out string header, out string id, out
dataEncrypted = new byte[b.Length - 3];
Array.Copy(b, 3, dataEncrypted, 0, b.Length - 3);
}
- else if (header.StartsWith("v2"))
+ else if (header.StartsWithInv("v2"))
{
byte[] bId = new byte[64];
Array.Copy(b, 3, bId, 0, 64);
diff --git a/src/Lib.Core/Threads/Session.cs b/src/Lib.Core/Threads/Session.cs
index a73443b9..9716e63b 100644
--- a/src/Lib.Core/Threads/Session.cs
+++ b/src/Lib.Core/Threads/Session.cs
@@ -49,13 +49,6 @@ public class Session : Eddie.Core.Thread
private Elevated.Process m_processOpenVpn;
private Process m_processProxy;
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- private Socket m_openVpnManagementSocket;
- private List m_openVpnManagementCommands = new List();
- private List m_openVpnManagementStatisticsLines = new List();
- */
-
private string m_reset = "";
private List m_logEvents = new List();
List m_routes = new List();
@@ -177,9 +170,6 @@ public override void OnRun()
if (CancelRequested)
continue;
- // TOCLEAN_OPENVPNMANAGEMENT
- // m_openVpnManagementCommands.Clear();
-
if (Engine.NextServer == null)
Engine.NextServer = Engine.PickConnection();
@@ -434,9 +424,6 @@ public override void OnRun()
if (Engine.IsConnected() == false)
throw new Exception("Unexpected.");
- // TOCLEAN_OPENVPNMANAGEMENT
- // ProcessOpenVpnManagement();
-
// Need stop?
bool StopRequest = false;
@@ -514,36 +501,24 @@ public override void OnRun()
int now = Utils.UnixTimeStamp();
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- // OpenVPN process completed, but management socket still opened. Strange, but happen. Closing socket.
- if ((m_processOpenVpn != null) && (m_openVpnManagementSocket != null) && (m_processOpenVpn.ReallyExited == true) && (m_openVpnManagementSocket.Connected))
- m_openVpnManagementSocket.Close();
- */
-
// OpenVPN process still exists, but management socket is not connected. We can't tell to OpenVPN to do a plain disconnection, force killing.
if ((m_processOpenVpn != null) && (m_processOpenVpn.ReallyExited == false))
- {
- // TOCLEAN_OPENVPNMANAGEMENT
- //if ((m_openVpnManagementSocket == null) || (m_openVpnManagementSocket.Connected == false))
- if(true)
+ {
+ if (now - lastSignalTime >= 10)
{
- if (now - lastSignalTime >= 10)
+ lastSignalTime = now;
+
+ if ((lastSignalType == "none") || (lastSignalType == "management"))
+ {
+ lastSignalType = "soft";
+ Engine.Instance.Logs.Log(LogType.Verbose, LanguageManager.GetText("KillWithSoft"));
+ m_processOpenVpn.KillSoft();
+ }
+ else if ((lastSignalType == "soft") || (lastSignalType == "hard"))
{
- lastSignalTime = now;
-
- if ((lastSignalType == "none") || (lastSignalType == "management"))
- {
- lastSignalType = "soft";
- Engine.Instance.Logs.Log(LogType.Verbose, LanguageManager.GetText("KillWithSoft"));
- m_processOpenVpn.KillSoft();
- }
- else if ((lastSignalType == "soft") || (lastSignalType == "hard"))
- {
- lastSignalType = "hard";
- Engine.Instance.Logs.Log(LogType.Verbose, LanguageManager.GetText("KillWithHard"));
- m_processOpenVpn.Kill();
- }
+ lastSignalType = "hard";
+ Engine.Instance.Logs.Log(LogType.Verbose, LanguageManager.GetText("KillWithHard"));
+ m_processOpenVpn.Kill();
}
}
}
@@ -569,22 +544,6 @@ public override void OnRun()
}
}
}
-
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- // Start a clean disconnection
- if ((m_processOpenVpn != null) && (m_openVpnManagementSocket != null) && (m_processOpenVpn.ReallyExited == false) && (m_openVpnManagementSocket.Connected))
- {
- if (now - lastSignalTime >= 10)
- {
- lastSignalTime = now;
- lastSignalType = "management";
- Engine.Instance.Logs.Log(LogType.Verbose, LanguageManager.GetText("KillWithManagement"));
- SendManagementCommand("signal SIGTERM");
- ProcessOpenVpnManagement();
- }
- }
- */
}
catch (Exception e)
{
@@ -593,12 +552,6 @@ public override void OnRun()
bool exit = true;
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- if ((m_openVpnManagementSocket != null) && (m_openVpnManagementSocket.Connected))
- exit = false;
- */
-
if ((m_processProxy != null) && (m_processProxy.ReallyExited == false))
exit = false;
@@ -667,16 +620,6 @@ public override void OnRun()
Engine.Instance.ConnectionActive = null;
-
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- if (m_openVpnManagementSocket != null)
- {
- (m_openVpnManagementSocket as IDisposable).Dispose();
- m_openVpnManagementSocket = null;
- }
- */
-
ProcessLogsEvents();
}
@@ -725,7 +668,6 @@ public override void OnRun()
for (int i = 0; i < waitingSecs; i++)
{
Engine.WaitMessageSet(LanguageManager.FormatText(waitingMessage, (waitingSecs - i).ToString()), true);
- //Engine.Log(Engine.LogType.Verbose, waitingMessage);
if (CancelRequested)
break;
@@ -967,24 +909,6 @@ public bool InReset
}
}
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- public bool SendManagementCommand(string cmd)
- {
- if (m_openVpnManagementSocket == null)
- return false;
-
- if (m_openVpnManagementSocket.Connected == false)
- return false;
-
- lock (this)
- {
- m_openVpnManagementCommands.Add(cmd);
- return true;
- }
- }
- */
-
void ProcessSshOutputDataReceived(object sender, DataReceivedEventArgs e)
{
if (e.Data != null)
@@ -1012,62 +936,7 @@ void ProcessOpenVpnOutputDataReceived(string data)
AddLogEvent("OpenVPN", data);
}
}
-
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- void ProcessOpenVpnManagement()
- {
- try
- {
- // Fetch OpenVPN Management
- if (m_openVpnManagementSocket != null)
- {
- if (m_openVpnManagementSocket.Connected == false)
- throw new Exception("OpenVPN Management disconnected.");
-
- lock (this)
- {
- foreach (string command in m_openVpnManagementCommands)
- {
- bool log = true;
- if (command == "status")
- log = false;
- if (command == m_connectionActive.ManagementPassword)
- log = false;
-
- if (log)
- Engine.Logs.Log(LogType.Verbose, "Management - Send '" + command + "'");
-
- string MyCmd = command + "\n";
- Byte[] bufS = new byte[1024 * 16];
- int lenS = Encoding.ASCII.GetBytes(MyCmd, 0, MyCmd.Length, bufS, 0);
-
- m_openVpnManagementSocket.Send(bufS, lenS, SocketFlags.None);
- }
- m_openVpnManagementCommands.Clear();
- }
-
- // Fetch OpenVPN Management
- if (m_openVpnManagementSocket.Available != 0)
- {
- Byte[] buf = new byte[1024 * 16];
- int bytes = m_openVpnManagementSocket.Receive(buf, buf.Length, 0);
-
- string data = Encoding.ASCII.GetString(buf, 0, bytes);
-
- AddLogEvent("Management", data);
- }
- }
- }
- catch (Exception ex)
- {
- Engine.Logs.Log(LogType.Warning, ex);
-
- SetReset("ERROR");
- }
- }
- */
-
+
void AddLogEvent(string source, string message)
{
lock(m_logEvents)
@@ -1082,7 +951,9 @@ void AddLogEvent(string source, string message)
lineN = System.Text.RegularExpressions.Regex.Replace(lineN, "^\\d{4}\\.\\d{2}\\.\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}\\s+LOG\\d{1}\\[\\d{0,6}:\\d{0,60}\\]:\\s+", "");
// Remove Hummingbird timestamp: "Sat Oct 12 10:15:54.795 2019"
- lineN = System.Text.RegularExpressions.Regex.Replace(lineN, "^\\w{3}\\s+\\w{3}\\s+\\d{1,2}\\s+\\d{1,2}:\\d{1,2}:\\d{1,2}\\.\\d{0,3}\\s+\\d{2,4}\\s+", "");
+ lineN = System.Text.RegularExpressions.Regex.Replace(lineN, "^\\w{3}\\s+\\w{3}\\s+\\d{1,2}\\s+\\d{1,2}:\\d{1,2}:\\d{1,2}\\.\\d{0,3}\\s+\\d{2,4}\\s+", "").Trim();
+ // Bug HB, some lines have two dates, for example "Mon Mar 8 13:42:19.871 2021 Mon Mar 8 13:42:19.928 2021 Connecting to [..]:443 (..) via TCPv4"
+ lineN = System.Text.RegularExpressions.Regex.Replace(lineN, "^\\w{3}\\s+\\w{3}\\s+\\d{1,2}\\s+\\d{1,2}:\\d{1,2}:\\d{1,2}\\.\\d{0,3}\\s+\\d{2,4}\\s+", "").Trim();
// Example OpenVPN<2.5: "Sat Oct 12 10:13:38 2019 /sbin/ip route add 0.0.0.0/1 via 10.20.6.1"
lineN = System.Text.RegularExpressions.Regex.Replace(lineN, "^\\w{3}\\s+\\w{3}\\s+\\d{1,2}\\s+\\d{1,2}:\\d{1,2}:\\d{1,2}\\s+\\d{2,4}\\s+", "");
@@ -1125,6 +996,9 @@ void ProcessLogEvent(SessionLogEvent logEvent)
void ProcessLogEvent(string source, string message)
{
+ if (source == "Hummingbird")
+ message = ConnectionTypes.Hummingbird.TranslateMessage(message);
+
string messageLower = message.ToLowerInvariant(); // Try to match lower/insensitive case when possible.
RegexOptions regexOptions = RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.Multiline;
@@ -1208,21 +1082,21 @@ void ProcessLogEvent(string source, string message)
{
ConnectedStep();
}
- else if (message.StartsWithInv("cipher: "))
+ else if (messageLower.StartsWithInv("cipher: "))
{
m_connectionActive.DataChannel = message.Substring("cipher: ".Length);
}
- else if (message.StartsWithInv("SSL Handshake: "))
+ else if (messageLower.StartsWithInv("ssl handshake: "))
{
m_connectionActive.ControlChannel = message.Substring("SSL Handshake: ".Length);
}
- else if (message.StartsWithInv("open ")) // MacOS
+ else if (messageLower.StartsWithInv("open ")) // MacOS
{
Match match = Regex.Match(message, "open (.+?) SUCCEEDED", regexOptions);
if (match.Success)
CheckTunNetworkInterface(match.Groups[1].Value);
}
- else if (message.StartsWithInv("net_iface_up: ")) // Linux
+ else if (messageLower.StartsWithInv("net_iface_up: ")) // Linux
{
Match match = Regex.Match(message, "net_iface_up: set (.+?) up", regexOptions);
if (match.Success)
@@ -1240,6 +1114,12 @@ void ProcessLogEvent(string source, string message)
}
}
}
+ else if (messageLower.StartsWithInv("client terminated, restarting"))
+ {
+ // 2021-03-08: Hummingbird don't honor the connect_max_retry directive, must not retry the connection itself
+ Engine.Instance.Logs.LogVerbose("Detected Hummingbird retry, force disconnection");
+ SetReset("ERROR");
+ }
if (log)
Engine.Logs.Log(logType, source + " > " + message);
@@ -1477,14 +1357,6 @@ void ProcessLogEvent(string source, string message)
}
}
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- if (messageLower.RegExMatchOne("^management: tcp socket listening on \\[af_inet6?\\]([0-9a-f\\.\\:]+?)$") != "")
- {
- ConnectManagementSocket();
- }
- */
-
if (message.IndexOfInv("Initialization Sequence Completed") != -1)
{
ConnectedStep();
@@ -1647,14 +1519,7 @@ void ProcessLogEvent(string source, string message)
if (log)
Engine.Logs.Log(LogType.Verbose, source + " > " + message);
- }
- /* TOCLEAN
- else if (source == "Management")
- {
-
- ProcessOutputManagement(source, message);
- }
- */
+ }
}
catch (Exception ex)
{
@@ -1664,27 +1529,6 @@ void ProcessLogEvent(string source, string message)
}
}
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- public void ConnectManagementSocket()
- {
- if(Engine.Instance.GetUseOpenVpnManagement() == false)
- return;
-
- if (m_openVpnManagementSocket == null)
- {
- Engine.Logs.Log(LogType.Verbose, LanguageManager.GetText("ConnectionStartManagement"));
-
- m_openVpnManagementSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- m_openVpnManagementSocket.Connect("127.0.0.1", Engine.Storage.GetInt("openvpn.management_port"));
- m_openVpnManagementSocket.SendTimeout = 5000;
- m_openVpnManagementSocket.ReceiveTimeout = 5000;
-
- SendManagementCommand(m_connectionActive.ManagementPassword);
- }
- }
- */
-
public void CheckTunNetworkInterface(string id)
{
if (m_connectionActive.Interface != null)
@@ -2050,61 +1894,5 @@ public void ConnectedStep()
Engine.RequestStop();
}
}
-
- /* TOCLEAN
- public void ProcessOutputManagement(string source, string message)
- {
- // Ignore, useless
- if (message.ContainsInv("OpenVPN Management Interface Version 1 -- type 'help' for more info"))
- return;
- if (message.StartsWithInv("ENTER PASSWORD:"))
- return;
- if (message.StartsWithInv("SUCCESS: password is correct"))
- return;
-
- string[] lines = message.Split('\n');
- for (int i = 0; i < lines.Length; i++)
- {
- lines[i] = lines[i].Trim();
-
- string line = lines[i];
-
- if (line == "")
- {
- }
- else if (line == "OpenVPN STATISTICS")
- {
- m_openVpnManagementStatisticsLines.Add(line);
- }
- else if (line == "END")
- {
- if (m_openVpnManagementStatisticsLines.Count != 0) // If 0, 'END' refer to another command.
- {
- // Process statistics
- Int64 read = 0;
- Int64 write = 0;
- String[] readArray = m_openVpnManagementStatisticsLines[4].Split(',');
- String[] writeArray = m_openVpnManagementStatisticsLines[5].Split(',');
- if (readArray.Length == 2)
- read = Conversions.ToInt64(readArray[1]);
- if (writeArray.Length == 2)
- write = Conversions.ToInt64(writeArray[1]);
-
- UpdateBytesStats(read, write);
-
- m_openVpnManagementStatisticsLines.Clear();
- }
- }
- else if (m_openVpnManagementStatisticsLines.Count != 0)
- {
- m_openVpnManagementStatisticsLines.Add(lines[i]);
- }
- else
- {
- Engine.Logs.Log(LogType.Verbose, "OpenVpn Management > " + line);
- }
- }
- }
- */
}
}
\ No newline at end of file
diff --git a/src/Lib.Core/UiManager.cs b/src/Lib.Core/UiManager.cs
index 2444a028..9a24af7a 100644
--- a/src/Lib.Core/UiManager.cs
+++ b/src/Lib.Core/UiManager.cs
@@ -91,14 +91,6 @@ public Json ProcessCommand(Json data, UiClient sender)
report.Start(sender);
}
- // TOCLEAN_OPENVPNMANAGEMENT
- /*
- else if (cmd == "openvpn_management")
- {
- if (Engine.Instance.SendManagementCommand(data["management_command"].Value as string) == false)
- Engine.Instance.Logs.Log(LogType.Warning, LanguageManager.GetText("OpenVpnManagementCommandFail"));
- }
- */
else if (cmd == "tor_control")
{
string resultC = TorControl.SendCommand(data["control_command"].Value as string);
diff --git a/src/Lib.Forms/Forms/Main.cs b/src/Lib.Forms/Forms/Main.cs
index a4551d32..a2884947 100644
--- a/src/Lib.Forms/Forms/Main.cs
+++ b/src/Lib.Forms/Forms/Main.cs
@@ -1409,7 +1409,7 @@ public void Log(LogEntry l)
Item.TextEdition = l.GetStringLines();
lstLogs.Items.Add(Item);
- Item.EnsureVisible();
+ //Item.EnsureVisible();
if (lstLogs.Items.Count >= Engine.Options.GetInt("log.limit"))
lstLogs.Items.RemoveAt(0);
@@ -1432,7 +1432,9 @@ public void Log(LogEntry l)
}
}
- private delegate void RequestShowDelegate();
+
+
+ private delegate void RequestShowDelegate();
public void RequestShow()
{
try
@@ -1862,6 +1864,8 @@ public void OnRefreshUi(Engine.RefreshUiMode mode)
Log(l);
}
+
+ LogScrollBottom();
}
}
@@ -1881,24 +1885,6 @@ public void OnRefreshUi(Engine.RefreshUiMode mode)
m_listViewServers.UpdateList();
m_listViewAreas.UpdateList();
- // Keys list
- /* TOCLEAN, old version
- cboKey.Items.Clear();
- if( (Engine.Instance != null) && (Engine.Instance.AirVPN != null) && (Engine.Instance.AirVPN.User != null) )
- {
- foreach (XmlElement xmlKey in Engine.Instance.AirVPN.User.SelectNodes("keys/key"))
- {
- string name = xmlKey.GetAttribute("name");
- cboKey.Items.Add(name);
- }
-
- if (cboKey.Items.Contains(Engine.Instance.Options.Get("key")) == true)
- {
- cboKey.SelectedItem = Engine.Instance.Options.Get("key");
- }
- }
- */
-
List keysAdd = new List();
List keysRemove = new List();
foreach (string k in cboKey.Items)
@@ -2453,7 +2439,25 @@ private void LogsDoSave(bool selectedOnly)
}
}
- public bool NetworkLockKnowledge()
+ public void LogScrollBottom()
+ {
+ try
+ {
+ lock (this)
+ {
+ if (lstLogs.Items.Count > 0)
+ {
+ lstLogs.Items[lstLogs.Items.Count - 1].EnsureVisible();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Engine.Instance.Logs.LogUnexpected(ex);
+ }
+ }
+
+ public bool NetworkLockKnowledge()
{
string Msg = LanguageManager.GetText("NetworkLockWarning");
diff --git a/src/Lib.Forms/Forms/Settings.cs b/src/Lib.Forms/Forms/Settings.cs
index 228fc569..aca01621 100644
--- a/src/Lib.Forms/Forms/Settings.cs
+++ b/src/Lib.Forms/Forms/Settings.cs
@@ -480,13 +480,7 @@ public void ReadOptions()
cboDnsSwitchMode.Text = "Disabled";
else if (dnsMode == "auto")
cboDnsSwitchMode.Text = "Automatic";
- /* TOCLEAN
- else if (dnsMode == "resolvconf")
- cboDnsSwitchMode.Text = "Resolvconf (Linux only)";
- else if (dnsMode == "rename")
- cboDnsSwitchMode.Text = "Renaming (Linux only)";
- */
- else
+ else
cboDnsSwitchMode.Text = "Automatic";
chkDnsCheck.Checked = o.GetBool("dns.check");
@@ -856,12 +850,6 @@ public void SaveOptions()
o.Set("dns.mode", "none");
else if (dnsMode == "Automatic")
o.Set("dns.mode", "auto");
- /* TOCLEAN
- else if (dnsMode == "Resolvconf (Linux only)")
- o.Set("dns.mode", "resolvconf");
- else if (dnsMode == "Renaming (Linux only)")
- o.Set("dns.mode", "rename");
- */
else
o.Set("dns.mode", "auto");
diff --git a/src/Lib.Platform.Windows/Platform.cs b/src/Lib.Platform.Windows/Platform.cs
index 016a8e8b..e81b0195 100644
--- a/src/Lib.Platform.Windows/Platform.cs
+++ b/src/Lib.Platform.Windows/Platform.cs
@@ -119,11 +119,35 @@ public override bool OnInit()
try
{
// Check VC++ Redistributable
-
// Need because our lib include libcurl, and static link of libcurl is not recommended
- // Registry check is not affidable, with vcredistr installed via msm/wix
- //if (Conversions.ToInt32(Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\" + GetOsArchitecture(), "Major", "0"), 0)<14)
- if (File.Exists(Path.Combine(Environment.SystemDirectory, "vcruntime140_1.dll")) == false)
+ bool vcRuntimeAvailable = false;
+
+ // <2.20
+ /*
+ if (File.Exists(Path.Combine(Environment.SystemDirectory, "vcruntime140_1.dll")))
+ vcRuntimeAvailable = true;
+ */
+
+ if (GetArchitecture() == "x86")
+ {
+ int currentVersion = Conversions.ToInt32(Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\" + GetArchitecture().ToUpperInvariant(), "Major", "0"), 0);
+ if (currentVersion >= 14)
+ vcRuntimeAvailable = true;
+ if (File.Exists(Path.Combine(Environment.SystemDirectory, "vcruntime140.dll")) == false)
+ vcRuntimeAvailable = false;
+ }
+ else
+ {
+ int currentVersion = Conversions.ToInt32(Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\" + GetArchitecture(), "Major", "0"), 0);
+ if (currentVersion >= 14)
+ vcRuntimeAvailable = true;
+
+ // Registry check is not affidable, with vcredistr installed via msm/wix
+ if( (currentVersion == 14) && (File.Exists(Path.Combine(Environment.SystemDirectory, "vcruntime140_1.dll")) == false) )
+ vcRuntimeAvailable = false;
+ }
+
+ if(vcRuntimeAvailable == false)
{
Engine.Instance.Logs.LogFatal("This software require some additional files (C++ Redistributable) that are not currently installed on your system. Use the Installer edition, or look https://eddie.website/windows-runtime/");
return false;
diff --git a/src/Lib.Platform.macOS.Native/build.sh b/src/Lib.Platform.macOS.Native/build.sh
index 5112ad93..2cd6b168 100755
--- a/src/Lib.Platform.macOS.Native/build.sh
+++ b/src/Lib.Platform.macOS.Native/build.sh
@@ -15,7 +15,12 @@ BASEPATH=$(dirname $(realpath "$0"))
mkdir -p "$BASEPATH/bin"
#g++ -mmacosx-version-min=10.9 -shared -install_name @rpath/libLib.Platform.MacOS.Native.dylib -fPIC -o "$BASEPATH/bin/libLib.Platform.MacOS.Native.dylib" "$BASEPATH/src/api.cpp" -Wall -std=c++11 -lcurl -O3 -D$1
+#M1: need arch as param, after use -arch arm64 OR -arch x86_64
+
+# Don't force any architecture (-arch), it's called by "VS for Mac" and must follow the same arch of parent.
+# So, under Apple M1, at 2020-02-02, it's compiled with x86_64.
g++ -mmacosx-version-min=10.9 -shared -install_name @rpath/libLib.Platform.MacOS.Native.dylib -fPIC -o "$BASEPATH/bin/libLib.Platform.MacOS.Native.dylib" "$BASEPATH/src/api.cpp" -Wall -std=c++11 -lcurl -O3 -D$1
+#g++ -mmacosx-version-min=10.9 -arch x86_64 -shared -install_name @rpath/libLib.Platform.MacOS.Native.dylib -fPIC -o "$BASEPATH/bin/libLib.Platform.MacOS.Native.dylib" "$BASEPATH/src/api.cpp" -Wall -std=c++11 -lcurl -O3 -D$1
chmod a-x "$BASEPATH/bin/libLib.Platform.MacOS.Native.dylib"
diff --git a/src/Lib.Platform.macOS/Lib.Platform.macOS.csproj b/src/Lib.Platform.macOS/Lib.Platform.macOS.csproj
index 09671390..3c43e86a 100644
--- a/src/Lib.Platform.macOS/Lib.Platform.macOS.csproj
+++ b/src/Lib.Platform.macOS/Lib.Platform.macOS.csproj
@@ -38,7 +38,6 @@
false
false
false
-
@@ -101,7 +100,7 @@
- ..\..\..\..\..\..\Library\Frameworks\Xamarin.Mac.framework\Versions\6.18.2.1\lib\reference\full\Xamarin.Mac.dll
+ ..\..\..\..\..\..\Library\Frameworks\Xamarin.Mac.framework\Versions\Current\lib\reference\full\Xamarin.Mac.dll
diff --git a/src/eddie.macos.prebuild.sh b/src/eddie.macos.prebuild.sh
index cf9e6db6..623156cb 100644
--- a/src/eddie.macos.prebuild.sh
+++ b/src/eddie.macos.prebuild.sh
@@ -39,6 +39,12 @@ PROJECT=$2
ARCH=$3
CONFIG=$4
+# See comment in /repository/build_macos.sh
+ARCH=$(cat /tmp/eddie_deploy_arch_native.txt)
+if [ ${ARCH} = "x86_64" ]; then
+ ARCH=x64
+fi
+
echo Basepath: $BASEPATH
echo TargetDir: $OUTPATH
echo Project: $PROJECT