summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2020-02-10 11:47:27 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-14 22:52:36 +0000
commit0bbcf698f317a0272a167bdc34acea0d12136603 (patch)
tree64448d0fc7df9eec2ecd1ec1e46b46d4ed62e761
parent53c9e11517caa166183f259e0f29f87d37243c6e (diff)
downloadmongo-0bbcf698f317a0272a167bdc34acea0d12136603.tar.gz
SERVER-45592 Raise Windows runtime minimum to Windows 10/Windows 2016 for MongoDB 4.4
-rw-r--r--SConstruct4
-rw-r--r--src/mongo/crypto/sha_block_windows.cpp22
-rw-r--r--src/mongo/installer/msi/wxs/Installer_64.wxs29
-rw-r--r--src/mongo/platform/windows_basic.h24
4 files changed, 55 insertions, 24 deletions
diff --git a/SConstruct b/SConstruct
index c2f165b304b..c8217f1479f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -398,10 +398,6 @@ add_option('osx-version-min',
# https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=vs-2017
# https://docs.microsoft.com/en-us/windows-server/get-started/windows-server-release-info
win_version_min_choices = {
- 'win8' : ('0602', '0000'),
- 'ws2012' : ('0602', '0000'),
- 'win81' : ('0603', '0000'),
- 'ws2012r2' : ('0603', '0000'),
'win10' : ('0A00', '0000'),
'ws2016' : ('0A00', '1607'),
'ws2019' : ('0A00', '1809')
diff --git a/src/mongo/crypto/sha_block_windows.cpp b/src/mongo/crypto/sha_block_windows.cpp
index 0bd35a03ce1..0d63cac3283 100644
--- a/src/mongo/crypto/sha_block_windows.cpp
+++ b/src/mongo/crypto/sha_block_windows.cpp
@@ -119,6 +119,17 @@ template <typename HashType>
void computeHashImpl(BCRYPT_ALG_HANDLE algo,
std::initializer_list<ConstDataRange> input,
HashType* const output) {
+ if (input.size() == 1) {
+ auto it = begin(input);
+ invariant(BCryptHash(algo,
+ NULL,
+ 0,
+ reinterpret_cast<PUCHAR>(const_cast<char*>(it->data())),
+ it->length(),
+ output->data(),
+ output->size()) == STATUS_SUCCESS);
+ }
+
BCRYPT_HASH_HANDLE hHash;
fassert(50725,
@@ -150,6 +161,17 @@ void computeHmacImpl(BCRYPT_ALG_HANDLE algo,
HashType* const output) {
invariant(key);
+ if (input.size() == 1) {
+ auto it = begin(input);
+ invariant(BCryptHash(algo,
+ const_cast<PUCHAR>(key),
+ keyLen,
+ reinterpret_cast<PUCHAR>(const_cast<char*>(it->data())),
+ it->length(),
+ output->data(),
+ output->size()) == STATUS_SUCCESS);
+ }
+
BCRYPT_HASH_HANDLE hHash;
fassert(50726,
diff --git a/src/mongo/installer/msi/wxs/Installer_64.wxs b/src/mongo/installer/msi/wxs/Installer_64.wxs
index c2b8d8e2a49..c5f18790a7d 100644
--- a/src/mongo/installer/msi/wxs/Installer_64.wxs
+++ b/src/mongo/installer/msi/wxs/Installer_64.wxs
@@ -1,15 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
- <Product Id="$(var.ProductId)"
- Name="!(wix.ProductName)"
- Language="1033"
- Version="$(var.MongoDBVersion)"
- Manufacturer="MongoDB Inc."
+ <Product Id="$(var.ProductId)"
+ Name="!(wix.ProductName)"
+ Language="1033"
+ Version="$(var.MongoDBVersion)"
+ Manufacturer="MongoDB Inc."
UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="405" Compressed="yes" Platform="x64"/>
+ <!--
+ We scheck the version number of Windows based on a registry key.
+ Checking the MSI property VersionNT will not work because it is fixed at 603 (i.e. 8.1).
+ https://support.microsoft.com/en-us/help/3202260/versionnt-value-for-windows-10-and-windows-server-2016
+ -->
+ <Property Id="WINDOWSBUILDNUM" Secure="yes">
+ <RegistrySearch Id="WINDOWSBUILDNUM_Search" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Name="CurrentMajorVersionNumber" Type="raw" />
+ </Property>
+
+ <Condition Message="MongoDB application is only supported on Windows 10/Windows 2016 or later">
+ <![CDATA[Installed OR (WINDOWSBUILDNUM >= 10)]]>
+ </Condition>
+
<WixVariable Id="InstallFolder" Value="$(var.MongoDBMajorVersion)"/>
<?if $(var.Edition) = Enterprise ?>
@@ -58,7 +71,7 @@
Impersonate="no"
HideTarget="no" />
- <CustomAction Id="UpdateMongoYAML.SetProperty"
+ <CustomAction Id="UpdateMongoYAML.SetProperty"
Return="check"
Property="UpdateMongoYAML"
Value="BIN=[BIN];MONGO_DATA_PATH=[MONGO_DATA_PATH];MONGO_LOG_PATH=[MONGO_LOG_PATH]"/>
@@ -72,7 +85,7 @@
<Custom Action="UpdateMongoYAML.SetProperty" Before="InstallFiles" />
<Custom Action="UpdateMongoYAML" After="InstallFiles">MONGO_SERVICE_INSTALL AND NOT REMOVE</Custom>
</InstallExecuteSequence>
-
+
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<WixVariable Id="WixUIDialogBmp" Value="$(var.ProjectDir)Dialog.bmp" />
<WixVariable Id="WixUIBannerBmp" Value="$(var.ProjectDir)Banner.bmp" />
@@ -105,7 +118,7 @@
<util:Group Id="PerfmonGroup" Name="Performance Monitor Users" />
- <!--
+ <!--
Setup the domain to use for granting permissions, the gotcha is the local machine.
The util:User element wants an empty string for the domain for the local machine.
The ServiceInstall element wants '.' for the domain for the local machine.
diff --git a/src/mongo/platform/windows_basic.h b/src/mongo/platform/windows_basic.h
index 95b12040c13..ef4a6853999 100644
--- a/src/mongo/platform/windows_basic.h
+++ b/src/mongo/platform/windows_basic.h
@@ -45,11 +45,11 @@
#if !defined(_WIN32_WINNT)
// Can't use symbolic versions here, since we may not have seen sdkddkver.h yet.
#if defined(_WIN64)
-// 64-bit builds default to Windows 7/Windows Server 2008 R2 support.
-#define _WIN32_WINNT 0x0601
+// 64-bit builds default to Windows 10/Windows Server 2016 support.
+#define _WIN32_WINNT 0x0A00
#else
-// 32-bit builds default to Windows 7/Windows Server 2008 R2 support.
-#define _WIN32_WINNT 0x0601
+// 32-bit builds default to Windows 10/Windows Server 2016 support.
+#define _WIN32_WINNT 0x0A00
#endif
#endif
@@ -58,11 +58,11 @@
#if !defined(NTDDI_VERSION)
// Can't use symbolic versions here, since we may not have seen sdkddkver.h yet.
#if defined(_WIN64)
-// 64-bit builds default to Windows 7/Windows Server 2008 R2 support.
-#define NTDDI_VERSION 0x06010000
+// 64-bit builds default to Windows 10/Windows Server 2016 support.
+#define NTDDI_VERSION 0x0A000000
#else
-// 32-bit builds default to Windows 7/Windows Server 2008 R2 support.
-#define NTDDI_VERSION 0x06010000
+// 32-bit builds default to Windows 10/Windows Server 2016 support.
+#define NTDDI_VERSION 0x0A000000
#endif
#endif
@@ -118,10 +118,10 @@
#error "Expected WINVER to have been defined and to equal _WIN32_WINNT"
#endif
-#if !defined(NTDDI_WINBLUE)
-#error "MongoDB requires Windows SDK 8.1 or higher to build"
+#if !defined(NTDDI_WIN10)
+#error "MongoDB requires Windows SDK 10 or higher to build"
#endif
-#if !defined(NTDDI_WIN7) || NTDDI_VERSION < NTDDI_WIN7
-#error "MongoDB does not support Windows versions older than Windows 7/Windows Server 2008 R2."
+#if !defined(NTDDI_WIN10) || NTDDI_VERSION < NTDDI_WIN10
+#error "MongoDB does not support Windows versions older than Windows 10."
#endif