Skip to content

Commit

Permalink
Backports for v2.1.7 (#3374)
Browse files Browse the repository at this point in the history
* Use the new onebranch linux docker image (#3315)

* Address onebranch pipeline warnings (#3325)

* gamecore_console: avoid importing timeGetDevCaps (#3332)

it is not part of WINAPI_FAMILY_GAMES available to GDK platforms

The proper fix is to refactor our link dependencies on Windows platforms. That is however a risker and more involved change, so this PR intends to address the immediate issue rendering msquic unusable on GDK gaming platform.

Signed-off-by: Jianye Chen <[email protected]>

Signed-off-by: Jianye Chen <[email protected]>

* Adds Hashtable Restructuring (#3344)

* Adds Hashtable Restructuring

* Extra line in contract path

* Make compiler happy

* A bit of refactor

* Remove unnecessary declaration

* formatting

* Forgot to remove a few #ifdefs

* Updated PGO files

* Fix a tag

* Update src/platform/hashtable.c

* Update src/platform/hashtable.c

* Update src/platform/hashtable.c

* Rename CXPLAT_HASHTABLE_MAX_RESTRUCT_ATTEMPTS to CXPLAT_HASHTABLE_MAX_RESIZE_ATTEMPTS

Co-authored-by: Matt Olson <[email protected]>

* gamecore_console: default to latest Windows SDK (#3343)

Signed-off-by: Jianye Chen <[email protected]>

* Update Quic VNE and Version 2 constants. (#3324)

* gamecore_console: fix build with 10.0.20348.0 (#6) (#3348)

updated min. SDK to 10.0.20348.0 for SetThreadIdealProcessor

Signed-off-by: Jianye Chen <[email protected]>

Signed-off-by: Jianye Chen <[email protected]>

* Fix QUIC_SETTINGS param validation tests. (#3331)

* Fix credscan warnings (#3359)

* build: fix onebranch pipelines (#3360)

changed base image to ltsc2019/vse2019
installed additional SDK to the image
added pipeline parameter to specify the target branch

Signed-off-by: Jianye Chen <[email protected]>

Signed-off-by: Jianye Chen <[email protected]>

* Update patch version

* Use Ubuntu 20.04 to Build OpenSSL-Systemcrypto Variant (#3267)

* Fix/suppress some new clang/cppcheck warnings (#3064)

Signed-off-by: Jianye Chen <[email protected]>
Co-authored-by: Yi Huang <[email protected]>
Co-authored-by: Jianye Chen <[email protected]>
Co-authored-by: Matt Olson <[email protected]>
Co-authored-by: Anthony Rossi <[email protected]>
Co-authored-by: Lars Eggert <[email protected]>
  • Loading branch information
6 people authored Jan 24, 2023
1 parent 8696239 commit 2db78a2
Show file tree
Hide file tree
Showing 30 changed files with 1,103 additions and 87 deletions.
873 changes: 873 additions & 0 deletions .azure/CredScanSuppressions.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .azure/OneBranch.Docker.Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ extends:
displayName: '🔒 Download artifacts'
inputs:
targetPath: $(Build.SourcesDirectory)\dst\.azure\dockers\ob\windows
artifact: drop_main_download_external_libs
artifact: drop_docker_download_external_libs
- task: onebranch.pipeline.imagebuildinfo@1
inputs:
repositoryName: msquicbuild
Expand Down
14 changes: 9 additions & 5 deletions .azure/OneBranch.Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ parameters: # parameters are shown up in ADO UI in a build queue time
displayName: 'Enable debug output'
type: boolean
default: false
- name: 'WindowsContainerImage2DockerTag'
displayName: 'WindowsContainerImage2 DockerTag'
type: string
default: 'latest'

variables:
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
Expand All @@ -36,9 +40,9 @@ variables:
NUGET_XMLDOC_MODE: none
ONEBRANCH_AME_ACR_LOGIN: onebranch.azurecr.io, cdpxb7b51c2f738e43e48f7605d9a8e5f6d700.azurecr.io

WindowsContainerImage: 'cdpxwin1809.azurecr.io/global/vse2019:latest'
WindowsContainerImage2: 'cdpxb7b51c2f738e43e48f7605d9a8e5f6d700.azurecr.io/b7b51c2f-738e-43e4-8f76-05d9a8e5f6d7/official/msquicbuild:20220812.8'
LinuxContainerImage: 'cdpxb7b51c2f738e43e48f7605d9a8e5f6d700.azurecr.io/b7b51c2f-738e-43e4-8f76-05d9a8e5f6d7/official/msquicbuild:xcomp1'
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2019/vse2019:latest'
WindowsContainerImage2: 'cdpxb7b51c2f738e43e48f7605d9a8e5f6d700.azurecr.io/b7b51c2f-738e-43e4-8f76-05d9a8e5f6d7/official/msquicbuild:${{ parameters.WindowsContainerImage2DockerTag }}'
LinuxContainerImage: 'cdpxb7b51c2f738e43e48f7605d9a8e5f6d700.azurecr.io/b7b51c2f-738e-43e4-8f76-05d9a8e5f6d7/official/msquicbuild:xcomp2'
LinuxContainerImage2: 'cdpxlinux.azurecr.io/global/ubuntu-1804:latest'

resources:
Expand All @@ -58,8 +62,8 @@ extends:
validate: false
tsa:
enabled: false # onebranch publish all sdl results to TSA. If TSA is disabled all SDL tools will forced into 'break' build mode.
# credscan:
# suppressionsFile: $(Build.SourcesDirectory)\.config\CredScanSuppressions.json
credscan:
suppressionsFile: $(Build.SourcesDirectory)\.azure\CredScanSuppressions.json
binskim:
break: true # always break the build on binskim issues in addition to TSA upload
policheck:
Expand Down
2 changes: 1 addition & 1 deletion .azure/OneBranch.PullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ variables:
OUTPUTROOT: $(REPOROOT)\out
NUGET_XMLDOC_MODE: none

WindowsContainerImage: 'cdpxwin1809.azurecr.io/global/vse2019:latest'
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2019/vse2019:latest'
WindowsContainerImage2: 'cdpxwin1809.azurecr.io/user/corenet/msquic:latest' # Docker image which is used to build the project https://aka.ms/obpipelines/containers
LinuxContainerImage: 'cdpxlinux.azurecr.io/user/corenet/msquic:latest'

Expand Down
4 changes: 2 additions & 2 deletions .azure/azure-pipelines.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ stages:
config: Debug
- template: ./templates/build-config-user.yml
parameters:
image: ubuntu-latest
image: ubuntu-20.04
platform: linux
arch: x64
tls: openssl
Expand Down Expand Up @@ -405,7 +405,7 @@ stages:
extraName: 'codecheck'
- template: ./templates/build-config-user.yml
parameters:
image: ubuntu-latest
image: ubuntu-20.04
platform: linux
arch: x64
tls: openssl
Expand Down
5 changes: 4 additions & 1 deletion .azure/dockers/ob/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# escape=`
FROM cdpxwin1809.azurecr.io/global/vse2019:latest
FROM onebranch.azurecr.io/windows/ltsc2019/vse2019:latest

# Default .NET FX images switch shell to PS. Switch it back.
SHELL ["cmd", "/S", "/C"]

COPY win-installer-helper.psm1 C:\
COPY install*.* C:\
COPY xgameplatform.lib C:\
COPY vsconfig.2019 C:\

RUN dir C:\

RUN C:\install.cmd C:\install-workloads.ps1

RUN C:\install.cmd C:\install-ewdk.ps1

RUN C:\install.cmd C:\install-tools.ps1
Expand Down
34 changes: 34 additions & 0 deletions .azure/dockers/ob/windows/install-workloads.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

if (Test-Path "$PSScriptRoot\win-installer-helper.psm1")
{
Import-Module "$PSScriptRoot\win-installer-helper.psm1"
}
elseif (Test-Path "C:\win-installer-helper.psm1")
{
Import-Module "C:\win-installer-helper.psm1"
}

$ProgressPreference = 'SilentlyContinue'

Start-Setup

try {

Write-Host "Installing additional visual studio workloads"

$vsInstallerPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe"

$installerArgs = "modify --config `"C:\vsconfig.2019`" --installPath `"${env:VS2019}`" --quiet --norestart --nocache"
Install-FromEXE -Path $vsInstallerPath -Arguments $installerArgs

Write-Output "Installed additional visual studio workloads"

} catch {
Write-Host "Error during workloads installation"
dir $Env:TEMP -Filter *.log | where Length -gt 0 | Get-Content
dir $Env:TEMP -Filter *.txt | where Length -gt 0 | Get-Content
$_.Exception | Format-List -Force
exit 1
} finally {
Stop-Setup
}
8 changes: 8 additions & 0 deletions .azure/dockers/ob/windows/vsconfig.2019
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre",
"Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre",
"Microsoft.VisualStudio.Component.Windows10SDK.20348"
]
}
2 changes: 1 addition & 1 deletion .azure/obtemplates/push-vpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
vpackToken: $(VPACK_PAT)
majorVer: 2
minorVer: 1
patchVer: 6
patchVer: 7
prereleaseVer: $(Build.BuildId)

- publish: $(XES_VPACKMANIFESTDIRECTORY)
Expand Down
2 changes: 1 addition & 1 deletion .azure/templates/test-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
sudo apt-add-repository ppa:lttng/stable-2.12
sudo apt-get update
sudo apt-get install -y lttng-tools
sudo dpkg -i $(Build.SourcesDirectory)/distribution/libmsquic_2.1.6_amd64.deb
sudo dpkg -i $(Build.SourcesDirectory)/distribution/libmsquic_2.1.7_amd64.deb
- pwsh: |
chmod +x $(Build.SourcesDirectory)/artifacts/bin/linux/x64_Release_openssl/msquictest
$(Build.SourcesDirectory)/artifacts/bin/linux/x64_Release_openssl/msquictest --gtest_filter=ParameterValidation.ValidateApi
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
message(STATUS "Source Dir: ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "Host System name: ${CMAKE_HOST_SYSTEM_NAME}")
if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
set(CMAKE_SYSTEM_VERSION 10.0.18362.0 CACHE STRING INTERNAL FORCE)
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 10.0.18362.0 CACHE STRING INTERNAL FORCE)
if (NOT DEFINED CMAKE_SYSTEM_VERSION)
set(CMAKE_SYSTEM_VERSION 10.0.18362 CACHE STRING INTERNAL FORCE)
endif()
endif()

if(POLICY CMP0091)
Expand Down Expand Up @@ -55,7 +56,7 @@ message(STATUS "Platform version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

set(QUIC_MAJOR_VERSION 2)
set(QUIC_FULL_VERSION 2.1.6)
set(QUIC_FULL_VERSION 2.1.7)

if (WIN32)
set(CX_PLATFORM "windows")
Expand Down Expand Up @@ -106,6 +107,12 @@ option(QUIC_OFFICIAL_RELEASE "Configured the build for an official release" OFF)
set(QUIC_FOLDER_PREFIX "" CACHE STRING "Optional prefix for source group folders when using an IDE generator")
set(QUIC_LIBRARY_NAME "msquic" CACHE STRING "Override the output library name")

if (QUIC_GAMECORE_BUILD)
if(${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} VERSION_LESS "10.0.20348.0")
message(FATAL_ERROR "gamecore builds require Windows 10 SDK version 20348 or later.")
endif()
endif()

if (QUIC_UWP_BUILD OR QUIC_GAMECORE_BUILD)
message(STATUS "UWP And GameCore builds disable all executables, and force shared CRT")
set(QUIC_BUILD_TOOLS OFF)
Expand Down Expand Up @@ -641,14 +648,17 @@ if(QUIC_CODE_CHECK)
-altera-*
-android-cloexec-fopen
-android-cloexec-socket
-bugprone-assignment-in-if-condition
-bugprone-easily-swappable-parameters
-bugprone-implicit-widening-of-multiplication-result
-bugprone-macro-parentheses
-bugprone-narrowing-conversions
-bugprone-reserved-identifier
-bugprone-sizeof-expression
-modernize-macro-to-enum
-cert-dcl37-c
-cert-dcl51-cpp
-cert-err33-c
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
-clang-diagnostic-microsoft-anon-tag
-concurrency-mt-unsafe
Expand All @@ -662,7 +672,9 @@ if(QUIC_CODE_CHECK)
-llvmlibc-restrict-system-libc-headers
-misc-no-recursion # do you really need recursion?
-readability-avoid-const-params-in-decls
-readability-duplicate-include
-readability-function-cognitive-complexity
-readability-identifier-length
-readability-isolate-declaration
-readability-magic-numbers
-readability-non-const-parameter
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "msquic"
version = "2.1.6-beta"
version = "2.1.7-beta"
edition = "2018"
authors = ["Microsoft"]
description = "Microsoft implementation of the IETF QUIC protocol"
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ function CMake-Generate {
$Arguments += " -DQUIC_PGO=on"
}
if ($Platform -eq "uwp") {
$Arguments += " -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10 -DQUIC_UWP_BUILD=on"
$Arguments += " -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -DQUIC_UWP_BUILD=on"
}
if ($Platform -eq "gamecore_console") {
$Arguments += " -DQUIC_GAMECORE_BUILD=on"
$Arguments += " -DCMAKE_SYSTEM_VERSION=10.0 -DQUIC_GAMECORE_BUILD=on"
}
if ($ToolchainFile -ne "") {
$Arguments += " -DCMAKE_TOOLCHAIN_FILE=""$ToolchainFile"""
Expand Down
2 changes: 1 addition & 1 deletion scripts/package-distribution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ArtifactsBinDir = Join-Path $BaseArtifactsDir "bin"
# All direct subfolders are OS's
$Platforms = Get-ChildItem -Path $ArtifactsBinDir

$Version = "2.1.6"
$Version = "2.1.7"

$WindowsBuilds = @()
$AllBuilds = @()
Expand Down
2 changes: 1 addition & 1 deletion scripts/package-nuget.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ $DistDir = Join-Path $BaseArtifactsDir "dist"
$CurrentCommitHash = Get-GitHash -RepoDir $RootDir
$RepoRemote = Get-GitRemote -RepoDir $RootDir

$Version = "2.1.6"
$Version = "2.1.7"

$BuildId = $env:BUILD_BUILDID
if ($null -ne $BuildId) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/write-versions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $ArtifactsDir = $BuildConfig.ArtifactsDir
$SourceVersion = $env:BUILD_SOURCEVERSION;
$SourceBranch = $env:BUILD_SOURCEBRANCH;
$BuildId = $env:BUILD_BUILDID;
$VersionNumber = "2.1.6";
$VersionNumber = "2.1.7";

class BuildData {
[string]$SourceVersion;
Expand Down
2 changes: 1 addition & 1 deletion src/core/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ MsQuicConnectionSendResumptionTicket(
goto Error;
}

if (Flags > (QUIC_SEND_RESUMPTION_FLAG_FINAL | QUIC_SEND_RESUMPTION_FLAG_NONE)) {
if (Flags > QUIC_SEND_RESUMPTION_FLAG_FINAL) {
Status = QUIC_STATUS_INVALID_PARAMETER;
goto Error;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/crypto_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ typedef enum eSniNameType {
//
#define QUIC_TP_ID_MAX_DATAGRAM_FRAME_SIZE 32 // varint
#define QUIC_TP_ID_DISABLE_1RTT_ENCRYPTION 0xBAAD // N/A
#define QUIC_TP_ID_VERSION_NEGOTIATION_EXT 0xFF73DB // Blob
#define QUIC_TP_ID_VERSION_NEGOTIATION_EXT 0x11 // Blob
#define QUIC_TP_ID_MIN_ACK_DELAY 0xFF03DE1AULL // varint
#define QUIC_TP_ID_CIBIR_ENCODING 0x1000 // {varint, varint}

Expand Down
2 changes: 1 addition & 1 deletion src/core/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extern "C" {
#define QUIC_ERROR_CRYPTO_USER_CANCELED QUIC_ERROR_CRYPTO_ERROR(90) // TLS error code for 'user_canceled'
#define QUIC_ERROR_CRYPTO_NO_APPLICATION_PROTOCOL QUIC_ERROR_CRYPTO_ERROR(120) // TLS error code for 'no_application_protocol'

#define QUIC_ERROR_VERSION_NEGOTIATION_ERROR 0x53F8
#define QUIC_ERROR_VERSION_NEGOTIATION_ERROR 0x11

//
// Used for determining which errors to count for performance counters.
Expand Down
4 changes: 2 additions & 2 deletions src/core/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
//
const QUIC_VERSION_INFO QuicSupportedVersionList[] = {
{ QUIC_VERSION_2,
{ 0xa7, 0x07, 0xc2, 0x03, 0xa5, 0x9b, 0x47, 0x18, 0x4a, 0x1d,
0x62, 0xca, 0x57, 0x04, 0x06, 0xea, 0x7a, 0xe3, 0xe5, 0xd3 },
{ 0x0d, 0xed, 0xe3, 0xde, 0xf7, 0x00, 0xa6, 0xdb, 0x81, 0x93,
0x81, 0xbe, 0x6e, 0x26, 0x9d, 0xcb, 0xf9, 0xbd, 0x2e, 0xd9 },
{ 0x34, 0x25, 0xc2, 0x0c, 0xf8, 0x87, 0x79, 0xdf, 0x2f, 0xf7, 0x1e, 0x8a, 0xbf, 0xa7, 0x82, 0x49,
0x89, 0x1e, 0x76, 0x3b, 0xbe, 0xd2, 0xf1, 0x3c, 0x04, 0x83, 0x43, 0xd3, 0x48, 0xc0, 0x60, 0xe2 },
{ "quicv2 key", "quicv2 iv", "quicv2 hp", "quicv2 ku" } },
Expand Down
2 changes: 1 addition & 1 deletion src/distribution/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleVersion</key>
<string>2.1.6</string>
<string>2.1.7</string>
<key>NSHumanReadableCopyright</key>
<string>MIT</string>
<key>CFBundleGetInfoString</key>
Expand Down
2 changes: 1 addition & 1 deletion src/inc/msquic.ver
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#endif

#ifndef VER_PATCH
#define VER_PATCH 6
#define VER_PATCH 7
#endif

#ifndef VER_BUILD_ID
Expand Down
16 changes: 0 additions & 16 deletions src/inc/quic_hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ typedef struct CXPLAT_HASHTABLE {

// Entries used in bucket computation.
uint32_t TableSize;
#ifdef CXPLAT_HASHTABLE_RESIZE_SUPPORT
uint32_t Pivot;
uint32_t DivisorMask;
#endif

// Counters
uint32_t NumEntries;
Expand Down Expand Up @@ -229,20 +227,6 @@ CxPlatHashtableEnumerateEnd(
_Inout_ CXPLAT_HASHTABLE_ENUMERATOR* Enumerator
);

#ifdef CXPLAT_HASHTABLE_RESIZE_SUPPORT

BOOLEAN
CxPlatHashTableExpand(
_Inout_ CXPLAT_HASHTABLE* HashTable
);

BOOLEAN
CxPlatHashTableContract(
_Inout_ CXPLAT_HASHTABLE* HashTable
);

#endif // CXPLAT_HASHTABLE_RESIZE_SUPPORT

//
// Simple helper hash function.
//
Expand Down
4 changes: 2 additions & 2 deletions src/inc/quic_versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// The QUIC version numbers, in network byte order.
//
#define QUIC_VERSION_VER_NEG 0x00000000U // Version for 'Version Negotiation'
#define QUIC_VERSION_2 0xc4509a70U // Second official version
#define QUIC_VERSION_2 0xcf43336bU // Second official version
#define QUIC_VERSION_1 0x01000000U // First official version
#define QUIC_VERSION_MS_1 0x0000cdabU // First Microsoft version (currently same as latest draft)
#define QUIC_VERSION_DRAFT_29 0x1d0000ffU // IETF draft 29
Expand All @@ -24,7 +24,7 @@
// The QUIC version numbers, in host byte order.
//
#define QUIC_VERSION_VER_NEG_H 0x00000000U // Version for 'Version Negotiation'
#define QUIC_VERSION_2_H 0x709a50c4U // Second official version
#define QUIC_VERSION_2_H 0x6b3343cfU // Second official version
#define QUIC_VERSION_1_H 0x00000001U // First official version
#define QUIC_VERSION_1_MS_H 0xabcd0000U // First Microsoft version (-1412628480 in decimal)
#define QUIC_VERSION_DRAFT_29_H 0xff00001dU // IETF draft 29
Expand Down
Loading

0 comments on commit 2db78a2

Please sign in to comment.