From c4235a60c8a52f422718110a7b36c85484afe1a0 Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 5 Jun 2021 01:18:28 -0700 Subject: [PATCH] Macos fixes --- deploy/build_macos_notarized.sh | 2 ++ service/server/router_mac.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/deploy/build_macos_notarized.sh b/deploy/build_macos_notarized.sh index 74d4dd777..7c7a94903 100755 --- a/deploy/build_macos_notarized.sh +++ b/deploy/build_macos_notarized.sh @@ -122,6 +122,7 @@ $QIF_BIN_DIR/binarycreator --offline-only -v -c $BUILD_DIR/installer/config/maco if [ "${MAC_CERT_PW+x}" ]; then echo "Signing installer bundle..." +security unlock-keychain -p $TEMP_PASS $KEYCHAIN /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $INSTALLER_BUNDLE_DIR /usr/bin/codesign --verify -vvvv $INSTALLER_BUNDLE_DIR || true @@ -141,6 +142,7 @@ hdiutil create -volname $APP_NAME -srcfolder $BUILD_DIR/installer/$APP_NAME.app if [ "${MAC_CERT_PW+x}" ]; then echo "Signing DMG installer..." +security unlock-keychain -p $TEMP_PASS $KEYCHAIN /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $DMG_FILENAME /usr/bin/codesign --verify -vvvv $DMG_FILENAME || true diff --git a/service/server/router_mac.cpp b/service/server/router_mac.cpp index a39e4883c..db94b7ee0 100644 --- a/service/server/router_mac.cpp +++ b/service/server/router_mac.cpp @@ -16,6 +16,11 @@ bool RouterMac::routeAdd(const QString &ipWithSubnet, const QString &gw) QString ip = Utils::ipAddressFromIpWithSubnet(ipWithSubnet); QString mask = Utils::netMaskFromIpWithSubnet(ipWithSubnet); + if (!Utils::checkIPFormat(ip) || !Utils::checkIPFormat(gw)) { + qCritical().noquote() << "Critical, trying to add invalid route: " << ip << gw; + return false; + } + QString cmd; if (mask == "255.255.255.255") { cmd = QString("route add -host %1 %2").arg(ip).arg(gw); @@ -69,6 +74,10 @@ bool RouterMac::routeDelete(const QString &ipWithSubnet, const QString &gw) QString ip = Utils::ipAddressFromIpWithSubnet(ipWithSubnet); QString mask = Utils::netMaskFromIpWithSubnet(ipWithSubnet); + if (!Utils::checkIPFormat(ip) || !Utils::checkIPFormat(gw)) { + qCritical().noquote() << "Critical, trying to remove invalid route: " << ip << gw; + return false; + } if (ip == "0.0.0.0") { qDebug().noquote() << "Warning, trying to remove default route, skipping: " << ip << gw;