1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-07 00:04:57 +03:00

v4.17-9562-beta

This commit is contained in:
dnobori
2015-05-31 19:02:35 +09:00
parent 7785c41f38
commit ff49706373
1114 changed files with 32910 additions and 1551 deletions

View File

@ -205,7 +205,8 @@ void AcWaitForRequest(AZURE_CLIENT *ac, SOCK *s, AZURE_PARAM *param)
BinToStr(server_cert_hash_str, sizeof(server_cert_hash_str),
server_cert_hash, SHA1_SIZE);
if (IsEmptyStr(ac->DDnsStatusCopy.AzureCertHash) || StrCmpi(server_cert_hash_str, ac->DDnsStatusCopy.AzureCertHash) == 0)
if (IsEmptyStr(ac->DDnsStatusCopy.AzureCertHash) || StrCmpi(server_cert_hash_str, ac->DDnsStatusCopy.AzureCertHash) == 0
|| StrCmpi(server_cert_hash_str, ac->DDnsStatus.AzureCertHash) == 0)
{
if (SendAll(ns, AZURE_PROTOCOL_DATA_SIANGTURE, 24, true))
{

View File

@ -1894,6 +1894,12 @@ bool IsPcdSupported()
UINT type;
OS_INFO *info = GetOsInfo();
if (MsIsWindows10())
{
// Windows 10 or later never supports PCD driver.
return false;
}
type = info->OsType;
if (OS_IS_WINDOWS_NT(type) == false)
@ -1972,11 +1978,6 @@ HINSTANCE InstallPcdDriverInternal()
src_filename = BRIDGE_WIN32_PCD_SYS_X64;
}
if (MsIsIA64())
{
src_filename = BRIDGE_WIN32_PCD_SYS_IA64;
}
// Copy see.sys
if (FileCopy(src_filename, tmp) == false)
{
@ -1995,10 +1996,6 @@ HINSTANCE InstallPcdDriverInternal()
{
dll_filename = BRIDGE_WIN32_PCD_DLL_X64;
}
else if (MsIsIA64())
{
dll_filename = BRIDGE_WIN32_PCD_DLL_IA64;
}
}
// Try to load see.dll and initialize

View File

@ -116,11 +116,9 @@
#define BRIDGE_WIN32_PACKET_DLL "Packet.dll"
#define BRIDGE_WIN32_PCD_DLL "|see.dll"
#define BRIDGE_WIN32_PCD_SYS "|see.sys"
#define BRIDGE_WIN32_PCD_SYS "|DriverPackages\\See\\x86\\See_x86.sys"
#define BRIDGE_WIN32_PCD_DLL_X64 "|see_x64.dll"
#define BRIDGE_WIN32_PCD_SYS_X64 "|see_x64.sys"
#define BRIDGE_WIN32_PCD_DLL_IA64 "|see_ia64.dll"
#define BRIDGE_WIN32_PCD_SYS_IA64 "|see_ia64.sys"
#define BRIDGE_WIN32_PCD_SYS_X64 "|DriverPackages\\See\\x64\\See_x64.sys"
#define BRIDGE_WIN32_PCD_REGKEY "SYSTEM\\CurrentControlSet\\services\\SEE"
#define BRIDGE_WIN32_PCD_BUILDVALUE "CurrentInstalledBuild"

View File

@ -135,10 +135,10 @@
// Version number
#define CEDAR_VER 415
#define CEDAR_VER 417
// Build Number
#define CEDAR_BUILD 9546
#define CEDAR_BUILD 9562
// Beta number
//#define BETA_NUMBER 3
@ -158,11 +158,11 @@
// Specifies the build date
#define BUILD_DATE_Y 2015
#define BUILD_DATE_M 4
#define BUILD_DATE_D 5
#define BUILD_DATE_HO 2
#define BUILD_DATE_MI 54
#define BUILD_DATE_SE 8
#define BUILD_DATE_M 5
#define BUILD_DATE_D 30
#define BUILD_DATE_HO 17
#define BUILD_DATE_MI 41
#define BUILD_DATE_SE 38
// Tolerable time difference
#define ALLOW_TIMESTAMP_DIFF (UINT64)(3 * 24 * 60 * 60 * 1000)
@ -242,7 +242,7 @@
#define FIFO_BUDGET VPN_GP(GP_FIFO_BUDGET, 1000000)
#endif // USE_STRATEGY_LOW_MEMORY
#define MAX_PACKET_SIZE 1560 // Maximum packet size
#define MAX_PACKET_SIZE 1600 // Maximum packet size
#define UDP_BUF_SIZE (32 * 1024) // Aim of the UDP packet size
#ifndef USE_STRATEGY_LOW_MEMORY

View File

@ -23096,7 +23096,7 @@ UINT PsConnect(CONSOLE *c, char *host, UINT port, char *hub, char *adminhub, wch
// Failure
retcode = err;
if (err == ERR_ACCESS_DENIED)
if (err == ERR_ACCESS_DENIED && c->ProgrammingMode == false)
{
char *pass;
// Password is incorrect
@ -23402,6 +23402,7 @@ UINT VpnCmdProc(CONSOLE *c, char *cmd_name, wchar_t *str, void *param)
{"OUT", NULL, NULL, NULL, NULL},
{"CMD", NULL, NULL, NULL, NULL},
{"CSV", NULL, NULL, NULL, NULL},
{"PROGRAMMING", NULL, NULL, NULL, NULL},
};
#ifdef OS_WIN32
@ -23621,6 +23622,7 @@ UINT CommandMain(wchar_t *command_line)
wchar_t *infile, *outfile;
char *a_infile, *a_outfile;
wchar_t *csvmode;
wchar_t *programming_mode;
CONSOLE *c;
// Validate arguments
@ -23664,6 +23666,13 @@ UINT CommandMain(wchar_t *command_line)
c->ConsoleType = CONSOLE_CSV;
}
programming_mode = ParseCommand(command_line, L"programming");
if (programming_mode != NULL)
{
Free(programming_mode);
c->ProgrammingMode = true;
}
if (DispatchNextCmdEx(c, command_line, ">", cmd, sizeof(cmd) / sizeof(cmd[0]), NULL) == false)
{
ret = ERR_INVALID_PARAMETER;

View File

@ -769,6 +769,18 @@ bool DispatchNextCmdEx(CONSOLE *c, wchar_t *exec_command, char *prompt, CMD cmd[
// Show the prompt
RETRY:
tmp = CopyStrToUni(prompt);
if (c->ProgrammingMode)
{
wchar_t tmp2[MAX_PATH];
UniFormat(tmp2, sizeof(tmp2), L"[PROMPT:%u:%s]\r\n", c->RetCode, tmp);
Free(tmp);
tmp = CopyUniStr(tmp2);
}
str = c->ReadLine(c, tmp, false);
Free(tmp);
@ -1430,6 +1442,14 @@ EVAL_VALUE:
Free(str);
break;
}
else if (c->ProgrammingMode)
{
// In the programming mode, return the error immediately.
ok = false;
Free(name);
Free(str);
break;
}
else
{
// Request to re-enter
@ -1458,7 +1478,11 @@ EVAL_VALUE:
wchar_t *tmp;
SHOW_PROMPT:
// Prompt because it is a mandatory parameter
tmp = p->PromptProc(c, p->PromptProcParam);
tmp = NULL;
if (c->ProgrammingMode == false)
{
tmp = p->PromptProc(c, p->PromptProcParam);
}
if (tmp == NULL)
{
// User canceled

View File

@ -160,6 +160,7 @@ struct CONSOLE
char *(*ReadPassword)(CONSOLE *c, wchar_t *prompt); // Function to read the password
bool (*Write)(CONSOLE *c, wchar_t *str); // Function to write a string
UINT (*GetWidth)(CONSOLE *c); // Get the width of the screen
bool ProgrammingMode; // Programming Mode
};
// Local console parameters

View File

@ -367,10 +367,19 @@ bool IPsecWin7InitDriverInner()
if (install_driver)
{
char *src_filename = IPSEC_WIN7_SRC_SYS_X86;
if (MsIsX64())
char src_filename[MAX_PATH];
if (MsIsWindows10() == false)
{
src_filename = IPSEC_WIN7_SRC_SYS_X64;
Format(src_filename, sizeof(src_filename),
"|DriverPackages\\Wfp\\%s\\pxwfp_%s.sys",
(MsIsX64() ? "x64" : "x86"), (MsIsX64() ? "x64" : "x86"));
}
else
{
Format(src_filename, sizeof(src_filename),
"|DriverPackages\\Wfp_Win10\\%s\\pxwfp_%s.sys",
(MsIsX64() ? "x64" : "x86"), (MsIsX64() ? "x64" : "x86"));
}
// Copy the driver
@ -467,13 +476,16 @@ bool IPsecWin7InitDriverInner()
// Write the build number of the current driver
void SetCurrentIPsecWin7DriverBuild()
{
MsRegWriteInt(REG_LOCAL_MACHINE, IPSEC_WIN7_DRIVER_REGKEY, IPSEC_WIN7_DRIVER_BUILDNUMBER, CEDAR_BUILD);
MsRegWriteInt(REG_LOCAL_MACHINE, IPSEC_WIN7_DRIVER_REGKEY,
(MsIsWindows10() ? IPSEC_WIN7_DRIVER_BUILDNUMBER_WIN10 : IPSEC_WIN7_DRIVER_BUILDNUMBER),
CEDAR_BUILD);
}
// Get the build number of the current driver
UINT GetCurrentIPsecWin7DriverBuild()
{
return MsRegReadInt(REG_LOCAL_MACHINE, IPSEC_WIN7_DRIVER_REGKEY, IPSEC_WIN7_DRIVER_BUILDNUMBER);
return MsRegReadInt(REG_LOCAL_MACHINE, IPSEC_WIN7_DRIVER_REGKEY,
(MsIsWindows10() ? IPSEC_WIN7_DRIVER_BUILDNUMBER_WIN10 : IPSEC_WIN7_DRIVER_BUILDNUMBER));
}
// Initialization of the API

View File

@ -127,6 +127,7 @@
#define IPSEC_WIN7_FILTER_TITLE_V6 CEDAR_PRODUCT_STR_W L" VPN IPsec Filter for IPv6"
#define IPSEC_WIN7_DRIVER_REGKEY "SYSTEM\\CurrentControlSet\\services\\pxwfp"
#define IPSEC_WIN7_DRIVER_BUILDNUMBER "CurrentInstalledBuild"
#define IPSEC_WIN7_DRIVER_BUILDNUMBER_WIN10 "CurrentInstalledBuild_Win10"
// Function prototype

View File

@ -4596,24 +4596,6 @@ UINT SwReady(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, WIZARD *wizard,
break;
case WM_WIZ_NEXT:
if (IsUseAlternativeHostname())
{
wchar_t src_dll1[MAX_PATH];
wchar_t src_dll2[MAX_PATH];
wchar_t *exe_dir = MsGetExeFileDirW();
CombinePathW(src_dll1, sizeof(src_dll1), exe_dir, VG_DLL_X86);
CombinePathW(src_dll2, sizeof(src_dll2), exe_dir, VG_DLL_X64);
if (IsFileExistsW(src_dll1) || IsFileExistsW(src_dll2))
{
if (MsgBoxEx(hWnd, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2,
_UU("SW_VG_CONFIRM_MSG")) == IDNO)
{
break;
}
}
}
return D_SW_PERFORM;
case WM_WIZ_BACK:

View File

@ -175,7 +175,9 @@ bool SuInstallDriverInner(bool force)
char *path;
// Read the current version from the registry
current_sl_ver = MsRegReadIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, SL_REG_VER_VALUE, false, true);
current_sl_ver = MsRegReadIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME,
(MsIsWindows10() ? SL_REG_VER_VALUE_WIN10 : SL_REG_VER_VALUE),
false, true);
path = MsRegReadStrEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, "ImagePath", false, true);
@ -195,12 +197,33 @@ bool SuInstallDriverInner(bool force)
}
// Copy necessary files to a temporary directory
UniFormat(src_sys, sizeof(src_sys), L"|SeLow_%S.sys", cpu_type);
UniFormat(src_cat, sizeof(src_cat), L"|inf\\selow_%S\\inf.cat", cpu_type);
UniFormat(src_inf, sizeof(src_inf), L"|inf\\selow_%S\\SeLow_%S.inf", cpu_type, cpu_type);
UniFormat(src_sys, sizeof(src_sys), L"|DriverPackages\\%S\\%S\\SeLow_%S.sys",
(MsIsWindows10() ? "SeLow_Win10" : "SeLow_Win8"),
cpu_type, cpu_type);
if (MsIsWindows8() == false)
{
// Windows Vista and Windows 7 uses SHA-1 catalog files
UniFormat(src_cat, sizeof(src_cat), L"|DriverPackages\\SeLow_Win8\\%S\\inf.cat", cpu_type);
}
else
{
// Windows 8 or above uses SHA-256 catalog files
UniFormat(src_cat, sizeof(src_cat), L"|DriverPackages\\SeLow_Win8\\%S\\inf2.cat", cpu_type);
if (MsIsWindows10())
{
// Windows 10 uses WHQL catalog files
UniFormat(src_cat, sizeof(src_cat), L"|DriverPackages\\SeLow_Win10\\%S\\SeLow_Win10_%S.cat", cpu_type, cpu_type);
}
}
UniFormat(src_inf, sizeof(src_inf), L"|DriverPackages\\%S\\%S\\SeLow_%S.inf",
(MsIsWindows10() ? "SeLow_Win10" : "SeLow_Win8"),
cpu_type, cpu_type);
UniFormat(dst_sys, sizeof(dst_cat), L"%s\\SeLow_%S.sys", tmp_dir, cpu_type);
UniFormat(dst_cat, sizeof(dst_cat), L"%s\\inf_selow.cat", tmp_dir);
UniFormat(dst_cat, sizeof(dst_cat), L"%s\\SeLow_%S_%S.cat", tmp_dir,
(MsIsWindows10() ? "Win10" : "Win8"),
cpu_type);
UniFormat(dst_inf, sizeof(dst_inf), L"%s\\SeLow_%S.inf", tmp_dir, cpu_type);
if (FileCopyW(src_sys, dst_sys) &&
@ -226,7 +249,9 @@ bool SuInstallDriverInner(bool force)
ret = true;
// Write the version number into the registry
MsRegWriteIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, SL_REG_VER_VALUE, SL_VER, false, true);
MsRegWriteIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME,
(MsIsWindows10() ? SL_REG_VER_VALUE_WIN10 : SL_REG_VER_VALUE),
SL_VER, false, true);
// Set to automatic startup
MsRegWriteIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, "Start", SERVICE_SYSTEM_START, false, true);
@ -738,6 +763,7 @@ SU *SuInitEx(UINT wait_for_bind_complete_tick)
UINT read_size;
bool flag = false;
UINT64 giveup_tick = 0;
bool flag2 = false;
if (SuIsSupportedOs(false) == false)
{
@ -761,6 +787,19 @@ LABEL_RETRY:
if (MsStartService(SL_PROTOCOL_NAME) == false)
{
Debug("MsStartService(%s) Failed.\n", SL_PROTOCOL_NAME);
if (MsIsWindows10())
{
if (flag2 == false)
{
flag2 = true;
if (SuInstallDriver(true))
{
goto LABEL_RETRY;
}
}
}
}
else
{

View File

@ -1135,19 +1135,24 @@ void VLanPaFree(SESSION *s)
{
char tmp[MAX_SIZE];
MS_ADAPTER *a;
UINT64 now = Tick64();
UINT64 suspend_tick = MsGetSuspendModeBeginTick();
Format(tmp, sizeof(tmp), VLAN_ADAPTER_NAME_TAG, v->InstanceName);
a = MsGetAdapter(tmp);
if (a != NULL)
if (suspend_tick == 0 || (suspend_tick + (UINT64)(30 * 1000)) < now)
{
if (a->UseDhcp)
{
bool ret = Win32ReleaseAddressByGuidEx(a->Guid, 50);
Debug("*** Win32ReleaseAddressByGuid = %u\n", ret);
}
Format(tmp, sizeof(tmp), VLAN_ADAPTER_NAME_TAG, v->InstanceName);
a = MsGetAdapter(tmp);
MsFreeAdapter(a);
if (a != NULL)
{
if (a->UseDhcp)
{
bool ret = Win32ReleaseAddressByGuidEx(a->Guid, 50);
Debug("*** Win32ReleaseAddressByGuid = %u\n", ret);
}
MsFreeAdapter(a);
}
}
}