Skip to content

Commit

Permalink
2.18.9
Browse files Browse the repository at this point in the history
  • Loading branch information
AirVPN committed Apr 2, 2020
1 parent 56a4053 commit 7d075c6
Show file tree
Hide file tree
Showing 27 changed files with 358 additions and 206 deletions.
8 changes: 4 additions & 4 deletions common/lang/inv.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"ManOptionLanguageIso": "Language of the UI. alpha-2 iso-3166 code. Default: 'auto'.",
"ManOptionUpdaterChannel": "Software update channel. Can be 'stable','beta','internal' or 'none'.",
"WindowsAboutThanks": "Special thanks to {1} and all the people of the AirVPN Community!",
"WindowsAboutTitle": "About",
"WindowsAboutVersion": "Version {1}",
Expand Down Expand Up @@ -238,7 +236,7 @@
"ManHeaderOption2": "Default options are read from the profile. Options in command-line override them but are not saved in the profile at exit.\nYou can run the UI, choose options in the UI, and then launch the command-line edition with the profile options, to avoid to specify all the options in the command-line.",
"ManHeaderOption3": "The options [i]--login[\/i] and [i]--password[\/i] are mandatory if they are not already in the profile.\nBy default, the client doesn't connect to any server automatically. Specify [i]--connect[\/i] to connect automatically.\nSpecify [i]--netlock[\/i] to start with network lock activation.",
"ManHeaderOption4": "By default the application works interactively: Press [i]n[\/i] to connect to a server, [i]x[\/i] or [i]ctrl+c[\/i] to exit.\nSpecify [i]--batch[\/i] for non-interactive mode.",
"ManName": "eddie-ui -- Eddie - OpenVPN UI, console edition",
"ManName": "eddie-cli -- Eddie - OpenVPN UI, console edition",
"ManOptionAdvancedCheckRoute": "If [i]True[\/i] send a request to the server, that check it come from within the tunnel, and reply with an acknowledgement.",
"ManOptionAdvancedExpert": "Activate some expert information and features; allows sending commands to OpenVPN Management Interface via Logs window; show verbose logs message in main windows",
"ManOptionAdvancedPingerDelay": "Ping each server every [i]X[\/i] seconds. If [i]0[\/i], the recommended values are used.",
Expand All @@ -257,6 +255,7 @@
"ManOptionEventWaitEnd": "Use [i]True[\/i] if the software needs to wait the end (synchronous) or [i]False[\/i] to be asynchronous.",
"ManOptionIPv6": "IPv6 mode. Can be [i]disabled[\/i] to disable IPv6, or [i]none[\/i]",
"ManOptionKey": "Key name.",
"ManOptionLanguageIso": "Language of the UI. alpha-2 iso-3166 code. Default: 'auto'.",
"ManOptionLogin": "Login of your AirVPN account.",
"ManOptionModeAlt": "0 to use the default entry IP, 1 or more for additional entry IP",
"ManOptionModePort": "Port for connection.",
Expand Down Expand Up @@ -308,6 +307,7 @@
"ManOptionToolsSslPath": "Path to a custom SSL tunnel executable",
"ManOptionUiIEC": "Use IEC standard and not metric standard. For example kilobyte are replaced by kibibyte",
"ManOptionUiUnit": "Unit of measurement of data volume and speed. Can be [i]bytes[\/i], [i]bits[\/i] or empty. If empty, bytes are used for volume, bits for speed.",
"ManOptionUpdaterChannel": "Software update channel. Can be 'stable','beta','internal' or 'none'.",
"ManOptionWebUiAddress": "Web-interface bind address. Leave empty for all interfaces, localhost or specify an IP address.",
"ManOptionWebUiEnabled": "Web-interface enabled or not",
"ManOptionWebUiPort": "Web-interface port.",
Expand All @@ -320,7 +320,7 @@
"ManOptionWindowsTapUp": "Force the TAP interface to come UP.",
"ManOptionWindowsWfp": "Use Windows Filtering Platform.",
"ManOptionWindowsWfpDynamic": "If [i]True[\/i], Windows Filtering Platform rules don't survive if the process crash.",
"ManSynopsis": "eddie-cli [OPTIONS...]\neddie-ui -cli [OPTIONS...]",
"ManSynopsis": "eddie-cli [OPTIONS...] or eddie-ui -cli [OPTIONS...]",
"OsLinuxDnsRenameDone": "DNS of the system updated to VPN DNS (Rename method: \/etc\/resolv.conf generated)",
"OsLinuxDnsRenameRestored": "DNS of the system restored to original settings (Rename method)",
"OsLinuxDnsResolvConfScript": "DNS of the system will be updated to VPN DNS (ResolvConf method)",
Expand Down
2 changes: 0 additions & 2 deletions repository/linux_common/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ if [ -z "$COMPILERPATH" ]; then
fi
set -e

echo $COMPILERPATH

if [ -z "$COMPILERPATH" ]; then
echo 'Error: msbuild or xbuild is not installed.' >&2
exit 1
Expand Down
36 changes: 31 additions & 5 deletions repository/windows_installer/nsis/Eddie-UI.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,13 @@

ExecWait '"$INSTDIR\Eddie-CLI-Elevated.exe" service=uninstall'

; DotNet
call CheckAndInstallDotNet

; Basic (required) Eddie files...
{@files_add}

File "{@resources}\dotNetFx45_Full_setup.exe"

; Restore base path
SetOutPath "$INSTDIR"
Expand Down Expand Up @@ -328,10 +333,6 @@ SectionEnd
;--------------------------------
;Installer Functions

;Function LaunchLink
; ExecShell "open" "$INSTDIR\AirVPN.exe"
;FunctionEnd


Function .onInit

Expand Down Expand Up @@ -362,6 +363,31 @@ Function un.onInit
Pop $0


FunctionEnd
FunctionEnd

Function CheckAndInstallDotNet
; Magic numbers from http://msdn.microsoft.com/en-us/library/ee942965.aspx
ClearErrors
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release"

IfErrors NotDetected

${If} $0 >= 378389
DetailPrint "Microsoft .NET Framework 4.5 is installed ($0)"
${Else}
NotDetected:
DetailPrint "Installing Microsoft .NET Framework 4.5"
SetDetailsPrint listonly
ExecWait '"{@resources}\dotNetFx45_Full_setup.exe" /passive /norestart' $0
${If} $0 == 3010
${OrIf} $0 == 1641
DetailPrint "Microsoft .NET Framework 4.5 installer requested reboot"
SetRebootFlag true
${EndIf}
SetDetailsPrint lastused
DetailPrint "Microsoft .NET Framework 4.5 installer returned $0"
${EndIf}

FunctionEnd


Binary file not shown.
4 changes: 2 additions & 2 deletions src/App.CLI.Common.Elevated/hashes.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
// along with Eddie. If not, see <http://www.gnu.org/licenses/>.
// </eddie_source_header>

const std::string expectedOpenvpnHash = "304254d86ad0609e3389345f0158f7326bf1a21c291c125b7e06de74aa263c05";
const std::string expectedHummingbirdHash = "4047d17910bd0d6a39826e08e2f5c1e965795452b8825cc77dd16906efced2a7";
const std::string expectedOpenvpnHash = "e5df1fae208e3946c0926bef41094583cc9b5ac6333bf45a5365116312d1c515";
const std::string expectedHummingbirdHash = "3afbd7a9966340dfe322f7e89c0a649b07ff58c684b5232c59849b364b481e5f";
82 changes: 46 additions & 36 deletions src/App.CLI.Common.Elevated/ibase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ void IBase::MainDo(const std::string& commandId, const std::string& command, std
}
catch (...)
{
ReplyException(commandId, "Internal exception.");
ReplyException(commandId, "Internal exception.");
}

EndCommand(commandId);
EndCommand(commandId);
}


Expand All @@ -141,25 +141,40 @@ void IBase::LogFatal(const std::string& msg)

void IBase::LogRemote(const std::string& msg)
{
LogDevDebug("Remote:" + msg);

SendMessage("ee:log:" + base64_encode(msg));
}

void IBase::LogLocal(const std::string& msg)
{
OnLogDebug(msg);
LogDevDebug("Local:" + msg);

std::cout << msg << std::endl;
}

void IBase::LogDebug(const std::string& msg)
{
LogDevDebug("Debug:" + msg);

#if defined(Debug) || defined(_DEBUG)
OnLogDebug(msg);
std::cout << "Elevated Debug: " << msg << std::endl;
#endif

if (m_debug)
LogRemote("Elevated: " + msg);
}

void IBase::LogDevDebug(const std::string& msg)
{
/*
std::string logPath = "C:\\elevated.log";
FILE* f = fopen(logPath.c_str(), "a");
fprintf(f, "%s\r\n", msg.c_str());
fclose(f);
*/
}

void IBase::ReplyPID(int pid)
{
SendMessage("ee:pid:" + base64_encode(std::to_string(pid)));
Expand Down Expand Up @@ -216,7 +231,7 @@ int IBase::Main()
{
if (m_cmdline["service"] == "install")
{
if(ServiceInstall())
if (ServiceInstall())
return 0;
else
{
Expand Down Expand Up @@ -251,28 +266,28 @@ int IBase::Main()
nMaxAccepted = 1;
m_serviceMode = false;

if (m_cmdline.find("spot_port") != m_cmdline.end())
port = atoi(m_cmdline["spot_port"].c_str());
if (m_cmdline.find("spot_port") != m_cmdline.end())
port = atoi(m_cmdline["spot_port"].c_str());
}
else if ((m_cmdline.find("mode") != m_cmdline.end()) && (m_cmdline["mode"] == "service"))
{
nMaxAccepted = -1;
m_serviceMode = true;

if (m_cmdline.find("service_port") != m_cmdline.end())
port = atoi(m_cmdline["service_port"].c_str());
if (m_cmdline.find("service_port") != m_cmdline.end())
port = atoi(m_cmdline["service_port"].c_str());
}
else
{
LogLocal("This application can't be run directly, it's used internally by Eddie. (unknown mode)");
return 1;
}




// If launched in SPOT mode, if service was active, they not accept, so reinstall.
if(m_serviceMode == false)
if (m_serviceMode == false)
ServiceReinstall();

int nAccepted = 0;
Expand All @@ -284,11 +299,11 @@ int IBase::Main()

SocketMarkReuseAddr(sockServer);

if (SocketIsValid(sockServer) == false)
if (SocketIsValid(sockServer) == false)
{
ThrowException("Error on opening socket");
}

std::memset(&addrServer, 0, sizeof(addrServer));

addrServer.sin_family = AF_INET;
Expand Down Expand Up @@ -328,10 +343,10 @@ int IBase::Main()
for (;;)
{
m_sockClient = accept(sockServer, (struct sockaddr *)&addrClient, &addrClientLen);

// TOFIX. Under Linux, errno==EWOULDBLOCK. Under Windows, i expect WSAEWOULDBLOCK but there are something not understanding.
if (SocketIsValid(m_sockClient) == false)
{
{
if (IsStopRequested())
break;

Expand All @@ -345,7 +360,7 @@ int IBase::Main()
}
}

if(SocketIsValid(m_sockClient))
if (SocketIsValid(m_sockClient))
{
nAccepted++;

Expand Down Expand Up @@ -386,14 +401,13 @@ int IBase::Main()
std::string integrityHashExpected = "";
if (m_cmdline.find("integrity") != m_cmdline.end())
integrityHashExpected = m_cmdline["integrity"];
std::string clientHash = FsFileSHA256Sum(clientProcessPath);
if (integrityHashExpected != "")
{
if(integrityHashComputed == "")
if (integrityHashComputed == "")
ThrowException("Client not allowed: Client unknown (service mode)");
else if (integrityHashComputed != integrityHashExpected)
ThrowException("Client not allowed: integrity mismatch (client " + integrityHashComputed + " != expected " + integrityHashExpected + ") (service mode)");
}
}
}

std::string allowed = CheckIfClientPathIsAllowed(clientProcessPath);
Expand Down Expand Up @@ -603,10 +617,6 @@ bool IBase::IsStopRequested()
return false;
}

void IBase::OnLogDebug(const std::string& msg)
{
}

bool IBase::IsServiceInstalled()
{
return false;
Expand All @@ -624,7 +634,7 @@ bool IBase::ServiceUninstall()

bool IBase::ServiceReinstall()
{
if(IsServiceInstalled())
if (IsServiceInstalled())
return ServiceInstall();
else
return false;
Expand Down Expand Up @@ -708,7 +718,7 @@ std::string IBase::FsFileGetDirectory(const std::string& path)

std::vector<char> IBase::FsFileReadBytes(const std::string& path)
{
/*
/*
std::ifstream input(path, std::ios::binary);
std::vector<unsigned char> bytes(
Expand All @@ -718,10 +728,10 @@ std::vector<char> IBase::FsFileReadBytes(const std::string& path)
input.close();
return bytes;
*/
// Note: This don't work with a /proc/x/cmdline
*/

// Note: This don't work with a /proc/x/cmdline

std::ifstream ifs(path.c_str(), std::ios::binary | std::ios::ate);
std::ifstream::pos_type pos = ifs.tellg();

Expand Down Expand Up @@ -1130,29 +1140,29 @@ std::string IBase::ComputeIntegrityHash(const std::string& elevatedPath, const s
for (std::vector<std::string>::const_iterator i = files.begin(); i != files.end(); ++i)
{
std::string file = *i;

std::string ext = "";
std::string::size_type extPos = file.rfind('.');

if (extPos != std::string::npos)
ext = file.substr(extPos + 1);

bool include = ( (ext == "") || (ext == "exe") || (ext == "dll") || (ext == "so") || (ext == "dylib") );
bool include = ((ext == "") || (ext == "exe") || (ext == "dll") || (ext == "so") || (ext == "dylib"));

if(include)
if (include)
{
std::string checkPathFull = checkPath + FsPathSeparator + file;
integrity += FsFileSHA256Sum(checkPathFull) + ";";

if (clientPath != "")
{
if(clientPath == checkPathFull)
{
if (clientPath == checkPathFull)
clientPathFound = true;
}
}
}

if( (clientPath != "") && (clientPathFound == false) )
if ((clientPath != "") && (clientPathFound == false))
return "";

return integrity;
Expand Down
Loading

0 comments on commit 7d075c6

Please sign in to comment.