diff --git a/client/core/openvpnconfigurator.cpp b/client/core/openvpnconfigurator.cpp index 9e113925..93f9b40f 100644 --- a/client/core/openvpnconfigurator.cpp +++ b/client/core/openvpnconfigurator.cpp @@ -25,12 +25,17 @@ QString OpenVpnConfigurator::getEasyRsaShPath() // easyrsa sh path should looks like // "/Program Files (x86)/AmneziaVPN/easyrsa/easyrsa" QString easyRsaShPath = QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\easyrsa\\easyrsa"; - easyRsaShPath.replace("C:\\", ""); - easyRsaShPath.replace("\\", "/"); - easyRsaShPath.prepend("/"); +// easyRsaShPath.replace("C:\\", "/cygdrive/c/"); +// easyRsaShPath.replace("\\", "/"); + easyRsaShPath = "\"" + easyRsaShPath + "\""; - //return "\"" + easyRsaShPath + "\""; - return "\"/Program Files (x86)/AmneziaVPN/easyrsa/easyrsa\""; +// easyRsaShPath = "\"/cygdrive/c/Program Files (x86)/AmneziaVPN/easyrsa/easyrsa\""; + +// easyRsaShPath = "\"C:\\Program Files (x86)\\AmneziaVPN\\easyrsa\\easyrsa\""; + qDebug().noquote() << "EasyRsa sh path" << easyRsaShPath; + + return easyRsaShPath; +// return "\"/Program Files (x86)/AmneziaVPN/easyrsa/easyrsa\""; #else return QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/easyrsa"; #endif @@ -42,6 +47,7 @@ QProcessEnvironment OpenVpnConfigurator::prepareEnv() QString pathEnvVar = env.value("PATH"); #ifdef Q_OS_WIN + pathEnvVar.clear(); pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\easyrsa\\bin;"); pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn\\i386;"); pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn\\x64;"); @@ -50,6 +56,7 @@ QProcessEnvironment OpenVpnConfigurator::prepareEnv() #endif env.insert("PATH", pathEnvVar); + //qDebug().noquote() << "ENV PATH" << pathEnvVar; return env; } @@ -61,7 +68,9 @@ ErrorCode OpenVpnConfigurator::initPKI(const QString &path) #ifdef Q_OS_WIN p.setProcessEnvironment(prepareEnv()); p.setProgram("cmd.exe"); - p.setNativeArguments(QString("/C \"sh.exe %1\"").arg(getEasyRsaShPath() + " init-pki")); + p.setNativeArguments(QString("/C \"ash.exe %1\"").arg(getEasyRsaShPath() + " init-pki")); + qDebug().noquote() << "EasyRsa tmp path" << path; + qDebug().noquote() << "EasyRsa args" << p.nativeArguments(); #else p.setProgram(getEasyRsaShPath()); p.setArguments(QStringList() << "init-pki"); @@ -69,9 +78,9 @@ ErrorCode OpenVpnConfigurator::initPKI(const QString &path) p.setWorkingDirectory(path); - // QObject::connect(&p, &QProcess::channelReadyRead, [&](){ - // qDebug().noquote() << p.readAll(); - // }); + QObject::connect(&p, &QProcess::channelReadyRead, [&](){ + qDebug().noquote() << "Init PKI" << p.readAll(); + }); p.start(); p.waitForFinished(); @@ -88,7 +97,8 @@ ErrorCode OpenVpnConfigurator::genReq(const QString &path, const QString &client #ifdef Q_OS_WIN p.setProcessEnvironment(prepareEnv()); p.setProgram("cmd.exe"); - p.setNativeArguments(QString("/C \"sh.exe %1\"").arg(getEasyRsaShPath() + " gen-req " + clientId + " nopass")); + p.setNativeArguments(QString("/C \"ash.exe %1\"").arg(getEasyRsaShPath() + " gen-req " + clientId + " nopass")); + qDebug().noquote() << "EasyRsa args" << p.nativeArguments(); #else p.setArguments(QStringList() << "gen-req" << clientId << "nopass"); p.setProgram(getEasyRsaShPath()); @@ -98,7 +108,7 @@ ErrorCode OpenVpnConfigurator::genReq(const QString &path, const QString &client QObject::connect(&p, &QProcess::channelReadyRead, [&](){ QString data = p.readAll(); - //qDebug().noquote() << data; + qDebug().noquote() << data; if (data.contains("Common Name (eg: your user, host, or server name)")) { p.write("\n"); diff --git a/deploy/data/windows/easyrsa/Licensing/mksh-Win32.txt b/deploy/data/windows/easyrsa/Licensing/mksh-Win32.txt deleted file mode 100644 index f646763b..00000000 --- a/deploy/data/windows/easyrsa/Licensing/mksh-Win32.txt +++ /dev/null @@ -1,148 +0,0 @@ -Licence -------- - -mksh/Win32 is a derived work of The MirBSD Korn Shell and -recognised by The MirOS Project but realised by an independent -developer with support and legal permit by Scalaris AG. - - -The shell itself comes under The MirOS Licence: - -Copyright (c) 2002-2013 - The MirOS Project -Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Thorsten Glaser -Copyright (c) 2010, 2011, 2012, 2013 - Michael Langguth - -Provided that these terms and disclaimer and all copyright notices -are retained or reproduced in an accompanying document, permission -is granted to deal in this work without restriction, including un- -limited rights to use, publicly perform, distribute, sell, modify, -merge, give away, or sublicence. - -This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to -the utmost extent permitted by applicable law, neither express nor -implied; without malicious intent or gross negligence. In no event -may a licensor, author or contributor be held liable for indirect, -direct, other damage, loss, or other issues arising in any way out -of dealing in the work, even if advised of the possibility of such -damage or existence of a defect, except proven that it results out -of said person's immediate fault when using the work as intended. - - -The shell contains strlcpy() under the ISC licence: - -Copyright (c) 2006, 2008, 2009 - Thorsten Glaser -Copyright (c) 1998 Todd C. Miller - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - -This version of the shell contains setmode() under the UCB BSD licence: - -Copyright (c) 1989, 1993, 1994 - The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to Berkeley by -Dave Borman at Cray Research, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - - -The shell includes nedmalloc under the Boost Software License which, -in turn, includes dlmalloc under CC0 (eventually) in its binary. - - -The "liblan" portability library is covered by The MirOS Licence: - -Copyright (c) 1996, 1998, 2003, 2004, 2005, 2010, 2011, 2012, 2013 - Scalaris AG, Author: Michael Langguth - -Provided that these terms and disclaimer and all copyright notices -are retained or reproduced in an accompanying document, permission -is granted to deal in this work without restriction, including un- -limited rights to use, publicly perform, distribute, sell, modify, -merge, give away, or sublicence. - -This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to -the utmost extent permitted by applicable law, neither express nor -implied; without malicious intent or gross negligence. In no event -may a licensor, author or contributor be held liable for indirect, -direct, other damage, loss, or other issues arising in any way out -of dealing in the work, even if advised of the possibility of such -damage or existence of a defect, except proven that it results out -of said person's immediate fault when using the work as intended. - - -It includes an implementation of POSIX directory browsing functions -and types for Win32 under a Historical Permission Notice variant: - -Copyright Kevlin Henney, 1997, 2003. All rights reserved. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose is hereby granted without fee, provided -that this copyright and permissions notice appear in all copies and -derivatives. - -This software is supplied "as is" without express or implied warranty. - -But that said, if there are any problems please get in touch. - - -The program shortcut (mkshicon1.ico) is an unregistered trademark: - -Copyright (c) 2013 Michael Langguth -Copyright (c) 2006 Benny Siegert -Copyright (c) 2005 Thorsten Glaser - -This icon may be used to refer to The MirBSD Korn Shell and -its Win32 port. Distribution patches are acceptable as long -as they modify $KSH_VERSION according to the guidelines that -are published on the website; forks and works that are not -derivates are not allowed to use it. - -The BSD daemon is Copyright (c) 1988 by Marshall Kirk McKusick. -All Rights Reserved. Individuals may use the daemon for their -personal use within the bounds of good taste. When reasonably -possible, the text shown above is to be included. - -The Shilouette daemon is Copyright (c) 2003 by Rick Collette. -The MirOS Project may freely use the former ekkoBSD Logo, -the shilouette Daemon, for MirBSD, on anything the project -leader sees fit, so long as it pertains to MirBSD in some -way and the leader gives credit for the original daemon to -Marshall Kirk McKusick. diff --git a/deploy/data/windows/easyrsa/Licensing/mktemp.txt b/deploy/data/windows/easyrsa/Licensing/mktemp.txt deleted file mode 100644 index 4fe81eff..00000000 --- a/deploy/data/windows/easyrsa/Licensing/mktemp.txt +++ /dev/null @@ -1,20 +0,0 @@ -Mktemp is distributed under the following ISC-style license: - - Copyright (c) 1996-1997, 2000-2001, 2008, 2010 - Todd C. Miller - Copyright (c) 1996, David Mazieres - Copyright (c) 2008, Damien Miller - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -From https://www.mktemp.org/mktemp/license.html diff --git a/deploy/data/windows/easyrsa/bin/awk.exe b/deploy/data/windows/easyrsa/bin/awk.exe deleted file mode 100644 index aa1fada8..00000000 Binary files a/deploy/data/windows/easyrsa/bin/awk.exe and /dev/null differ diff --git a/deploy/data/windows/easyrsa/bin/cat.exe b/deploy/data/windows/easyrsa/bin/cat.exe index 6a6af4df..2a368323 100644 Binary files a/deploy/data/windows/easyrsa/bin/cat.exe and b/deploy/data/windows/easyrsa/bin/cat.exe differ diff --git a/deploy/data/windows/easyrsa/bin/cp.exe b/deploy/data/windows/easyrsa/bin/cp.exe index 60f1cc2b..41d0740e 100644 Binary files a/deploy/data/windows/easyrsa/bin/cp.exe and b/deploy/data/windows/easyrsa/bin/cp.exe differ diff --git a/deploy/data/windows/easyrsa/bin/date.exe b/deploy/data/windows/easyrsa/bin/date.exe index 069bae14..f96cf1a4 100644 Binary files a/deploy/data/windows/easyrsa/bin/date.exe and b/deploy/data/windows/easyrsa/bin/date.exe differ diff --git a/deploy/data/windows/easyrsa/bin/diff.exe b/deploy/data/windows/easyrsa/bin/diff.exe index 2797ffd0..5d91ef3b 100644 Binary files a/deploy/data/windows/easyrsa/bin/diff.exe and b/deploy/data/windows/easyrsa/bin/diff.exe differ diff --git a/deploy/data/windows/easyrsa/bin/easyrsa-shell-init.sh b/deploy/data/windows/easyrsa/bin/easyrsa-shell-init.sh deleted file mode 100644 index 82d4dec1..00000000 --- a/deploy/data/windows/easyrsa/bin/easyrsa-shell-init.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -# shellcheck disable=SC2161,SC1091 - -# This script is a frontend designed to create & launch a POSIX shell -# environment suitable for use with Easy-RSA. mksh/Win32 is used with this -# project; use with other POSIX shells for Windows may require modification to -# this wrapper script. - -setup_path="${EASYRSA:-$PWD}" -export PATH="$setup_path;$setup_path/bin;$PATH" -export HOME="$setup_path" - -# This prevents reading from a user's .mkshrc if they have one. -# A user who runs mksh for other purposes might have it -export ENV="/disable-env" - -# Verify required externals are present -extern_list="which awk cat cp mkdir printf rm" -for f in $extern_list; do - if ! which "${f}.exe" >/dev/null 2>&1; then - echo "" - echo "FATAL: EasyRSA Shell init is missing a required external file:" - echo " ${f}.exe" - echo " Your installation is incomplete and cannot function without the required" - echo " files." - echo "" - echo " Press enter to exit." - #shellcheck disable=SC2162 - read - exit 1 - fi -done - -# set_var is defined as any vars file needs it. -# This is the same as in easyrsa, but we _don't_ export -set_var() { - var="$1" - shift - value="$*" - eval "$var=\"\${$var-$value}\"" -} #=> set_var() - -# Check for a usable openssl bin, referencing vars if present -[ -r "vars" ] && EASYRSA_CALLER=1 . "vars" 2>/dev/null -if [ -z "$EASYRSA_OPENSSL" ] && ! which openssl.exe >/dev/null 2>&1; then - echo "WARNING: openssl isn't in your system PATH. The openssl binary must be" - echo " available in the PATH, defined in the 'vars' file, or defined in a" - echo " named environment variable. See README-Windows.txt for more info." -fi - -[ -f "$setup_path/easyrsa" ] || { - echo "Missing easyrsa script. Expected to find it at: $setup_path/easyrsa" - exit 2 -} - -# Set prompt and welcome message -export PS1=' -EasyRSA Shell -# ' -echo "" -echo "Welcome to the EasyRSA 3 Shell for Windows." -echo "Easy-RSA 3 is available under a GNU GPLv2 license." -echo "" -echo "Invoke './easyrsa' to call the program. Without commands, help is displayed." - -# Drop to a shell and await input -bin/sh diff --git a/deploy/data/windows/easyrsa/bin/grep.exe b/deploy/data/windows/easyrsa/bin/grep.exe index 427f92fc..04166b2b 100644 Binary files a/deploy/data/windows/easyrsa/bin/grep.exe and b/deploy/data/windows/easyrsa/bin/grep.exe differ diff --git a/deploy/data/windows/easyrsa/bin/ls.exe b/deploy/data/windows/easyrsa/bin/ls.exe index 388af5eb..8eb66516 100644 Binary files a/deploy/data/windows/easyrsa/bin/ls.exe and b/deploy/data/windows/easyrsa/bin/ls.exe differ diff --git a/deploy/data/windows/easyrsa/bin/md5sum.exe b/deploy/data/windows/easyrsa/bin/md5sum.exe index 1640ba81..72d149d9 100644 Binary files a/deploy/data/windows/easyrsa/bin/md5sum.exe and b/deploy/data/windows/easyrsa/bin/md5sum.exe differ diff --git a/deploy/data/windows/easyrsa/bin/mkdir.exe b/deploy/data/windows/easyrsa/bin/mkdir.exe index 83e57d97..30afe68d 100644 Binary files a/deploy/data/windows/easyrsa/bin/mkdir.exe and b/deploy/data/windows/easyrsa/bin/mkdir.exe differ diff --git a/deploy/data/windows/easyrsa/bin/mktemp.exe b/deploy/data/windows/easyrsa/bin/mktemp.exe index d9345717..bc099930 100644 Binary files a/deploy/data/windows/easyrsa/bin/mktemp.exe and b/deploy/data/windows/easyrsa/bin/mktemp.exe differ diff --git a/deploy/data/windows/easyrsa/bin/mv.exe b/deploy/data/windows/easyrsa/bin/mv.exe index bcdc9d0e..06169f57 100644 Binary files a/deploy/data/windows/easyrsa/bin/mv.exe and b/deploy/data/windows/easyrsa/bin/mv.exe differ diff --git a/deploy/data/windows/easyrsa/bin/printf.exe b/deploy/data/windows/easyrsa/bin/printf.exe index 9060224b..86e9b130 100644 Binary files a/deploy/data/windows/easyrsa/bin/printf.exe and b/deploy/data/windows/easyrsa/bin/printf.exe differ diff --git a/deploy/data/windows/easyrsa/bin/rm.exe b/deploy/data/windows/easyrsa/bin/rm.exe index c489316c..351bd2b0 100644 Binary files a/deploy/data/windows/easyrsa/bin/rm.exe and b/deploy/data/windows/easyrsa/bin/rm.exe differ diff --git a/deploy/data/windows/easyrsa/bin/sed.exe b/deploy/data/windows/easyrsa/bin/sed.exe index 2a9f38c4..d5c9ace9 100644 Binary files a/deploy/data/windows/easyrsa/bin/sed.exe and b/deploy/data/windows/easyrsa/bin/sed.exe differ diff --git a/deploy/data/windows/easyrsa/bin/sh.exe b/deploy/data/windows/easyrsa/bin/sh.exe deleted file mode 100644 index a42d9962..00000000 Binary files a/deploy/data/windows/easyrsa/bin/sh.exe and /dev/null differ diff --git a/deploy/data/windows/easyrsa/bin/which.exe b/deploy/data/windows/easyrsa/bin/which.exe index fbf68efc..3a3b4433 100644 Binary files a/deploy/data/windows/easyrsa/bin/which.exe and b/deploy/data/windows/easyrsa/bin/which.exe differ diff --git a/deploy/data/windows/openvpn/i386/openssl.exe b/deploy/data/windows/openvpn/i386/openssl.exe deleted file mode 100644 index db9967f4..00000000 Binary files a/deploy/data/windows/openvpn/i386/openssl.exe and /dev/null differ