diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/crypto/sha_block_windows.cpp | 22 | ||||
-rw-r--r-- | src/mongo/installer/msi/wxs/Installer_64.wxs | 29 | ||||
-rw-r--r-- | src/mongo/platform/windows_basic.h | 24 |
3 files changed, 55 insertions, 20 deletions
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 |