* Remove stub TLS

We were only using stub TLS to be compatible with ASAN. Now that OpenSSL and Asan work together, we can remove stub TLS and reduce our TLS scope.
This commit is contained in:
Thad House 2021-03-30 14:22:39 -07:00 коммит произвёл GitHub
Родитель db3592271a
Коммит b1940ba5ec
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
25 изменённых файлов: 38 добавлений и 2016 удалений

Просмотреть файл

@ -85,7 +85,6 @@ stages:
displayName: Build Windows - Release
dependsOn: []
jobs:
# Officially supported configurations.
- template: ./templates/build-config-user.yml
parameters:
image: windows-latest
@ -94,7 +93,6 @@ stages:
tls: schannel
config: Release
extraBuildArgs: -EnableTelemetryAsserts
# Other configurations.
- template: ./templates/build-config-user.yml
parameters:
image: windows-latest
@ -108,7 +106,6 @@ stages:
displayName: Build Windows - Debug
dependsOn: []
jobs:
# Officially supported configurations.
- template: ./templates/build-config-user.yml
parameters:
image: windows-latest
@ -117,15 +114,6 @@ stages:
tls: schannel
config: Debug
extraBuildArgs: -EnableTelemetryAsserts
# Other configurations.
- template: ./templates/build-config-user.yml
parameters:
image: windows-latest
platform: windows
arch: x64
tls: stub
config: Debug
extraBuildArgs: -EnableTelemetryAsserts
- template: ./templates/build-config-user.yml
parameters:
image: windows-latest
@ -139,14 +127,6 @@ stages:
displayName: Build Windows - Non Tested
dependsOn: []
jobs:
- template: ./templates/build-config-user.yml
parameters:
image: windows-latest
platform: windows
arch: x64
tls: stub
config: Release
extraBuildArgs: -EnableTelemetryAsserts
- template: ./templates/build-config-user.yml
parameters:
image: windows-latest
@ -223,14 +203,6 @@ stages:
skipOpenSSLCache: true
extraBuildArgs: -SanitizeAddress -ExtraArtifactDir Sanitize
config: Debug
- template: ./templates/build-config-user.yml
parameters:
image: ubuntu-latest
platform: linux
arch: x64
tls: stub
extraBuildArgs: -SanitizeAddress
config: Debug
- template: ./templates/build-config-user.yml
parameters:
image: ubuntu-latest
@ -245,15 +217,6 @@ stages:
displayName: Build Linux - Non Tested
dependsOn: []
jobs:
# Other configurations.
- template: ./templates/build-config-user.yml
parameters:
image: ubuntu-latest
platform: linux
arch: x64
tls: stub
extraBuildArgs: -SanitizeAddress
config: Release
- template: ./templates/build-config-user.yml
parameters:
image: ubuntu-latest
@ -295,7 +258,6 @@ stages:
displayName: Build macOS - Release
dependsOn: []
jobs:
# Officially supported configurations.
- template: ./templates/build-config-user.yml
parameters:
image: macOS-10.15
@ -308,7 +270,6 @@ stages:
displayName: Build macOS - Debug
dependsOn: []
jobs:
# Officially supported configurations.
- template: ./templates/build-config-user.yml
parameters:
image: macOS-10.15
@ -317,17 +278,19 @@ stages:
tls: openssl
config: Debug
- stage: build_macos_nontest
displayName: Build macOS - NonTest
dependsOn: []
jobs:
# Officially supported configurations.
- template: ./templates/build-config-user.yml
parameters:
image: macOS-10.15
platform: macos
arch: arm64
tls: stub
#
# Disabled because arm will not build on CI.
#
# - stage: build_macos_nontest
# displayName: Build macOS - NonTest
# dependsOn: []
# jobs:
# - template: ./templates/build-config-user.yml
# parameters:
# image: macOS-10.15
# platform: macos
# arch: arm64
# tls: openssl
#
# Performance Tests
@ -602,7 +565,7 @@ stages:
- build_winkernel_nontest
- build_linux_nontest
- build_macos_release
- build_macos_nontest
# - build_macos_nontest Skipped because of arm
- build_macos_debug
jobs:
- job: mirror

Просмотреть файл

@ -74,7 +74,6 @@ stages:
variables:
runCodesignValidationInjection: false
jobs:
# Officially supported configurations.
- ${{ if and(eq(parameters.kernelmode, false), ne(parameters.tls, 'schannel')) }}:
- template: ./templates/build-config-user.yml
parameters:

Просмотреть файл

@ -227,14 +227,6 @@ if(QUIC_TLS STREQUAL "openssl")
list(APPEND QUIC_COMMON_DEFINES QUIC_DISABLE_CLIENT_CERT_TESTS)
endif()
if(QUIC_TLS STREQUAL "stub")
list(APPEND QUIC_COMMON_DEFINES QUIC_TLS_STUB)
message(STATUS "Disabling PFX tests")
list(APPEND QUIC_COMMON_DEFINES QUIC_DISABLE_PFX_TESTS)
message(STATUS "Disabling ticket key tests")
list(APPEND QUIC_COMMON_DEFINES QUIC_DISABLE_TICKET_KEY_TESTS)
endif()
if(WIN32)
# Generate the MsQuicEtw header file.
file(MAKE_DIRECTORY ${QUIC_BUILD_DIR}/inc)

Просмотреть файл

@ -123,7 +123,7 @@ The script has a lot of additional configuration options, but the default should
`-Arch <x86/x64/arm/arm64>` Allow for building for different architectures. **x64** is the defualt architecture.
`-Tls <stub/schannel/openssl>` Allows for building with different TLS providers. The default is platform dependent (Windows = schannel, Linux = openssl).
`-Tls <schannel/openssl>` Allows for building with different TLS providers. The default is platform dependent (Windows = schannel, Linux = openssl).
`-Clean` Forces a clean build of everything.

Просмотреть файл

@ -48,7 +48,7 @@ MsQuic has a number of implementations for the TLS abstraction layer to support
## OpenSSL
[OpenSSL](https://www.openssl.org/) is the primary TLS library by MsQuic on Linux. It is also works on Windows, but is not officially supported.
[OpenSSL](https://www.openssl.org/) is the primary TLS library by MsQuic on Linux. It is also works on Windows, but Schannel is preferred if supported by your OS build.
> **Important** - Currently, OpenSSL doesn't officially have QUIC API support (hopefully coming soon), so MsQuic **temporarily** relies on a [fork of OpenSSL](https://github.com/quictls/openssl) that is purely a fork + a set of (unapproved by OMC) changes to expose some QUIC functionality. This fork is only a **stopgap solution** until OpenSSL officially supports QUIC, at which MsQuic will immediately switch to it.

Просмотреть файл

@ -9,7 +9,7 @@
"TestName": "RPS",
"Local": {
"Platform": "Windows",
"Tls": ["stub", "schannel", "openssl"],
"Tls": ["schannel", "openssl"],
"Arch": ["x64", "x86", "arm", "arm64"],
"Exe": "secnetperf",
"Arguments": "-test:RPS -target:$RemoteAddress"

Просмотреть файл

@ -9,7 +9,7 @@
"TestName": "ThroughputUp",
"Local": {
"Platform": "Windows",
"Tls": ["stub", "schannel", "openssl"],
"Tls": ["schannel", "openssl"],
"Arch": ["x64", "x86", "arm", "arm64"],
"Exe": "secnetperf",
"Arguments": "-test:Throughput -target:$RemoteAddress -bind:$LocalAddress:4434 -ip:4 -uni:1 -upload:2000000000"
@ -43,7 +43,7 @@
"TestName": "ThroughputUp",
"Local" : {
"Platform": "linux",
"Tls": ["stub", "openssl"],
"Tls": ["openssl"],
"Arch": ["x64", "arm"],
"Exe": "secnetperf",
"Arguments": "-test:Throughput -target:$RemoteAddress -uni:1 -upload:2000000000"
@ -77,7 +77,7 @@
"TestName": "ThroughputDown",
"Local": {
"Platform": "Windows",
"Tls": ["stub", "schannel", "openssl"],
"Tls": ["schannel", "openssl"],
"Arch": ["x64", "x86", "arm", "arm64"],
"Exe": "secnetperf",
"Arguments": "-test:Throughput -target:$RemoteAddress -bind:$LocalAddress:4434 -ip:4 -uni:1 -download:2000000000"
@ -103,7 +103,7 @@
"TestName": "ThroughputDown",
"Local" : {
"Platform": "linux",
"Tls": ["stub", "openssl"],
"Tls": ["openssl"],
"Arch": ["x64", "arm"],
"Exe": "secnetperf",
"Arguments": "-test:Throughput -target:$RemoteAddress -uni:1 -download:2000000000"
@ -129,7 +129,7 @@
"TestName": "RPS",
"Local": {
"Platform": "Windows",
"Tls": ["stub", "schannel", "openssl"],
"Tls": ["schannel", "openssl"],
"Arch": ["x64", "x86", "arm", "arm64"],
"Exe": "secnetperf",
"Arguments": "-test:RPS -target:$RemoteAddress"
@ -172,7 +172,7 @@
"TestName": "RPS",
"Local": {
"Platform": "linux",
"Tls": ["stub", "openssl"],
"Tls": ["openssl"],
"Arch": ["x64", "arm"],
"Exe": "secnetperf",
"Arguments": "-test:RPS -target:$RemoteAddress"
@ -215,7 +215,7 @@
"TestName": "HPS",
"Local": {
"Platform": "Windows",
"Tls": ["stub", "schannel", "openssl"],
"Tls": ["schannel", "openssl"],
"Arch": ["x64", "x86", "arm", "arm64"],
"Exe": "secnetperf",
"Arguments": "-test:HPS -target:$RemoteAddress"
@ -232,7 +232,7 @@
"TestName": "HPS",
"Local": {
"Platform": "linux",
"Tls": ["stub", "openssl"],
"Tls": ["openssl"],
"Arch": ["x64", "arm"],
"Exe": "secnetperf",
"Arguments": "-test:HPS -target:$RemoteAddress"

Просмотреть файл

@ -9,7 +9,7 @@
"TestName": "TcpThroughputUp",
"Local": {
"Platform": "Windows",
"Tls": ["stub", "schannel", "openssl"],
"Tls": ["schannel", "openssl"],
"Arch": ["x64", "x86", "arm", "arm64"],
"Exe": "secnetperf",
"Arguments": "-test:Throughput -target:$RemoteAddress -bind:$LocalAddress:4434 -ip:4 -uni:1 -upload:2000000000 -tcp:1"

Просмотреть файл

@ -109,7 +109,7 @@ param (
[string]$Platform = "",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$Tls = "",
[Parameter(Mandatory = $false)]

Просмотреть файл

@ -55,7 +55,7 @@ param (
[string]$Arch = "x64",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$Tls = "",
[Parameter(Mandatory = $false)]

Просмотреть файл

@ -27,7 +27,7 @@ param (
[string]$Arch,
[Parameter(Mandatory = $true)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$Tls
)

Просмотреть файл

@ -60,7 +60,7 @@ param (
[string]$Arch = "x64",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$Tls = "",
[Parameter(Mandatory = $false)]

Просмотреть файл

@ -27,7 +27,7 @@ param (
[string]$Arch = "x64",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$Tls = "",
[Parameter(Mandatory = $false)]

Просмотреть файл

@ -20,7 +20,7 @@ param (
[string]$Config = "Debug",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$Tls = ""
)

Просмотреть файл

@ -77,7 +77,7 @@ param (
[string]$LocalArch = "x64",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$LocalTls = "",
[Parameter(Mandatory = $false)]
@ -85,7 +85,7 @@ param (
[string]$RemoteArch = "x64",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$RemoteTls = "",
[Parameter(Mandatory = $false)]

Просмотреть файл

@ -57,7 +57,7 @@ param (
[string]$Arch = "x64",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$Tls = "",
[Parameter(Mandatory = $false)]

Просмотреть файл

@ -48,7 +48,7 @@ param (
[string]$Arch = "x64",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$Tls = "",
[Parameter(Mandatory = $false)]

Просмотреть файл

@ -94,7 +94,7 @@ param (
[string]$Arch = "x64",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub")]
[ValidateSet("schannel", "openssl")]
[string]$Tls = "",
[Parameter(Mandatory = $false)]

Просмотреть файл

@ -9690,134 +9690,6 @@
],
"macroName": "QuicTraceLogConnVerbose"
},
"StubTlsCertValidationDisabled": {
"ModuleProperites": {},
"TraceString": "[conn][%p] Certificate validation disabled!",
"UniqueId": "StubTlsCertValidationDisabled",
"splitArgs": [
{
"DefinationEncoding": "p",
"MacroVariableName": "arg1"
}
],
"macroName": "QuicTraceLogConnWarning"
},
"StubTlsHandshakeComplete": {
"ModuleProperites": {},
"TraceString": "[conn][%p] Handshake complete",
"UniqueId": "StubTlsHandshakeComplete",
"splitArgs": [
{
"DefinationEncoding": "p",
"MacroVariableName": "arg1"
}
],
"macroName": "QuicTraceLogConnInfo"
},
"StubTlsProducedData": {
"ModuleProperites": {},
"TraceString": "[conn][%p] Produced %hu bytes",
"UniqueId": "StubTlsProducedData",
"splitArgs": [
{
"DefinationEncoding": "p",
"MacroVariableName": "arg1"
},
{
"DefinationEncoding": "hu",
"MacroVariableName": "arg3"
}
],
"macroName": "QuicTraceLogConnInfo"
},
"StubTlsConsumedData": {
"ModuleProperites": {},
"TraceString": "[conn][%p] Consumed %u bytes",
"UniqueId": "StubTlsConsumedData",
"splitArgs": [
{
"DefinationEncoding": "p",
"MacroVariableName": "arg1"
},
{
"DefinationEncoding": "u",
"MacroVariableName": "arg3"
}
],
"macroName": "QuicTraceLogConnInfo"
},
"StubTlsContextCreated": {
"ModuleProperites": {},
"TraceString": "[conn][%p] TLS context Created",
"UniqueId": "StubTlsContextCreated",
"splitArgs": [
{
"DefinationEncoding": "p",
"MacroVariableName": "arg1"
}
],
"macroName": "QuicTraceLogConnVerbose"
},
"StubTlsUsing0Rtt": {
"ModuleProperites": {},
"TraceString": "[conn][%p] Using 0-RTT ticket.",
"UniqueId": "StubTlsUsing0Rtt",
"splitArgs": [
{
"DefinationEncoding": "p",
"MacroVariableName": "arg1"
}
],
"macroName": "QuicTraceLogConnVerbose"
},
"StubTlsContextCleaningUp": {
"ModuleProperites": {},
"TraceString": "[conn][%p] Cleaning up",
"UniqueId": "StubTlsContextCleaningUp",
"splitArgs": [
{
"DefinationEncoding": "p",
"MacroVariableName": "arg1"
}
],
"macroName": "QuicTraceLogConnVerbose"
},
"StubTlsRecvNewSessionTicket": {
"ModuleProperites": {},
"TraceString": "[conn][%p] Received new ticket. ticket_len:%u for %s",
"UniqueId": "StubTlsRecvNewSessionTicket",
"splitArgs": [
{
"DefinationEncoding": "p",
"MacroVariableName": "arg1"
},
{
"DefinationEncoding": "u",
"MacroVariableName": "arg3"
},
{
"DefinationEncoding": "s",
"MacroVariableName": "arg4"
}
],
"macroName": "QuicTraceLogConnVerbose"
},
"StubTlsProcessData": {
"ModuleProperites": {},
"TraceString": "[conn][%p] Processing %u received bytes",
"UniqueId": "StubTlsProcessData",
"splitArgs": [
{
"DefinationEncoding": "p",
"MacroVariableName": "arg1"
},
{
"DefinationEncoding": "u",
"MacroVariableName": "arg3"
}
],
"macroName": "QuicTraceLogConnVerbose"
},
"TestCaseStart": {
"ModuleProperites": {},
"TraceString": "[test] START %s",
@ -13051,42 +12923,6 @@
"UniquenessHash": "183e91b7-6ad7-7a8b-0d77-94004bde6757",
"TraceID": "SchannelProcessingData"
},
{
"UniquenessHash": "64ef2389-7553-24d5-62f5-94fa1ab55eac",
"TraceID": "StubTlsCertValidationDisabled"
},
{
"UniquenessHash": "2ca06c46-059c-c3e2-a6db-dc8f0d6292eb",
"TraceID": "StubTlsHandshakeComplete"
},
{
"UniquenessHash": "8671265f-83a7-8d8f-4fac-ea0d14b9da84",
"TraceID": "StubTlsProducedData"
},
{
"UniquenessHash": "27a202b6-2090-aed6-26c8-4b193f0cb901",
"TraceID": "StubTlsConsumedData"
},
{
"UniquenessHash": "d3788ab1-cacd-d552-e06c-2e7bee8b6da9",
"TraceID": "StubTlsContextCreated"
},
{
"UniquenessHash": "16a301c5-8f8d-0d34-6fb9-0a608367097e",
"TraceID": "StubTlsUsing0Rtt"
},
{
"UniquenessHash": "068a93f4-8ad9-2eae-53e9-44da62c39494",
"TraceID": "StubTlsContextCleaningUp"
},
{
"UniquenessHash": "9ca0fd16-2037-7132-3b3f-25691460af7f",
"TraceID": "StubTlsRecvNewSessionTicket"
},
{
"UniquenessHash": "9b5f99a0-b1b6-bae7-12fd-89f89d1f1667",
"TraceID": "StubTlsProcessData"
},
{
"UniquenessHash": "75b94a49-9bfe-7be0-7756-8f014aeeddba",
"TraceID": "TestCaseStart"

Просмотреть файл

@ -54,8 +54,7 @@ elseif(QUIC_TLS STREQUAL "openssl")
set(SOURCES ${SOURCES} selfsign_openssl.c)
endif()
else()
message(STATUS "Configuring for stub TLS")
set(SOURCES ${SOURCES} cert_stub.c selfsign_stub.c tls_stub.c)
message(FATAL_ERROR "TLS Provider not configured")
endif()
# Allow CLOG to preprocess all the source files.

Просмотреть файл

@ -1,187 +0,0 @@
/*++
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
Abstract:
Certificate Platform Functions
--*/
#include "platform_internal.h"
#ifdef QUIC_CLOG
#include "cert_stub.c.clog.h"
#endif
QUIC_STATUS
CxPlatCertCreate(
_In_ const QUIC_CREDENTIAL_CONFIG* CredConfig,
_Out_ QUIC_CERTIFICATE** NewCertificate
)
{
if (CredConfig->Type == QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH) {
if (CredConfig->CertificateHash == NULL && CredConfig->Principal == NULL) {
return QUIC_STATUS_INVALID_PARAMETER;
}
} else if (CredConfig->Type == QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH_STORE) {
if (CredConfig->CertificateHashStore == NULL) {
return QUIC_STATUS_INVALID_PARAMETER;
}
} else if (CredConfig->Type == QUIC_CREDENTIAL_TYPE_CERTIFICATE_CONTEXT) {
if (CredConfig->CertificateContext == NULL) {
return QUIC_STATUS_INVALID_PARAMETER;
}
} else if (CredConfig->Type == QUIC_CREDENTIAL_TYPE_CERTIFICATE_FILE) {
if (CredConfig->CertificateFile == NULL) {
return QUIC_STATUS_INVALID_PARAMETER;
}
} else {
return QUIC_STATUS_INVALID_PARAMETER;
}
*NewCertificate = (QUIC_CERTIFICATE*)1;
return QUIC_STATUS_SUCCESS;
}
void
CxPlatCertFree(
_In_ QUIC_CERTIFICATE* Certificate
)
{
UNREFERENCED_PARAMETER(Certificate);
}
_Success_(return != FALSE)
BOOLEAN
CxPlatCertSelect(
_In_opt_ QUIC_CERTIFICATE* Certificate,
_In_reads_(SignatureAlgorithmsLength)
const uint16_t *SignatureAlgorithms,
_In_ size_t SignatureAlgorithmsLength,
_Out_ uint16_t *SelectedSignature
)
{
UNREFERENCED_PARAMETER(Certificate);
UNREFERENCED_PARAMETER(SignatureAlgorithmsLength);
*SelectedSignature = SignatureAlgorithms[0];
return TRUE;
}
_Success_(return != NULL)
QUIC_CERTIFICATE*
CxPlatCertParseChain(
_In_ size_t ChainBufferLength,
_In_reads_(ChainBufferLength)
const uint8_t *ChainBuffer
)
{
if (ChainBufferLength < SIZEOF_CERT_CHAIN_LIST_LENGTH) {
return NULL;
}
uint32_t CertLength =
((uint32_t)ChainBuffer[0]) << 16 |
((uint32_t)ChainBuffer[1]) << 8 |
((uint32_t)ChainBuffer[2]);
if (ChainBufferLength < SIZEOF_CERT_CHAIN_LIST_LENGTH + CertLength) {
return NULL;
}
return (QUIC_CERTIFICATE*)1;
}
_Success_(return != 0)
size_t
CxPlatCertFormat(
_In_opt_ QUIC_CERTIFICATE* Certificate,
_In_ size_t BufferLength,
_Out_writes_to_(BufferLength, return)
uint8_t* Buffer
)
{
UNREFERENCED_PARAMETER(Certificate);
UNREFERENCED_PARAMETER(BufferLength);
if (BufferLength < SIZEOF_CERT_CHAIN_LIST_LENGTH) {
return 0;
}
CxPlatZeroMemory(Buffer, SIZEOF_CERT_CHAIN_LIST_LENGTH); // Encode 0 length cert chain.
return SIZEOF_CERT_CHAIN_LIST_LENGTH;
}
_Success_(return != FALSE)
BOOLEAN
CxPlatCertValidateChain(
_In_ const QUIC_CERTIFICATE* Certificate,
_In_opt_z_ const char* Host,
_In_ uint32_t IgnoreFlags
)
{
UNREFERENCED_PARAMETER(Certificate);
UNREFERENCED_PARAMETER(Host);
UNREFERENCED_PARAMETER(IgnoreFlags);
return TRUE;
}
_Success_(return != NULL)
void*
CxPlatCertGetPrivateKey(
_In_ QUIC_CERTIFICATE* Certificate
)
{
UNREFERENCED_PARAMETER(Certificate);
return (void*)1;
}
void
CxPlatCertDeletePrivateKey(
_In_ void* PrivateKey
)
{
UNREFERENCED_PARAMETER(PrivateKey);
}
_Success_(return != FALSE)
BOOLEAN
CxPlatCertSign(
_In_ void* PrivateKey,
_In_ const uint16_t SignatureAlgorithm,
_In_reads_(CertListToBeSignedLength)
const uint8_t *CertListToBeSigned,
_In_ size_t CertListToBeSignedLength,
_Out_writes_to_(*SignatureLength, *SignatureLength)
uint8_t *Signature,
_Inout_ size_t *SignatureLength
)
{
UNREFERENCED_PARAMETER(PrivateKey);
UNREFERENCED_PARAMETER(SignatureAlgorithm);
UNREFERENCED_PARAMETER(CertListToBeSigned);
UNREFERENCED_PARAMETER(CertListToBeSignedLength);
UNREFERENCED_PARAMETER(Signature);
if (*SignatureLength >= 16) {
*SignatureLength = 16;
return TRUE;
} else {
return FALSE;
}
}
_Success_(return != FALSE)
BOOLEAN
CxPlatCertVerify(
_In_ QUIC_CERTIFICATE* Certificate,
_In_ const uint16_t SignatureAlgorithm,
_In_reads_(CertListToBeSignedLength)
const uint8_t *CertListToBeSigned,
_In_ size_t CertListToBeSignedLength,
_In_reads_(SignatureLength)
const uint8_t *Signature,
_In_ size_t SignatureLength
)
{
UNREFERENCED_PARAMETER(Certificate);
UNREFERENCED_PARAMETER(SignatureAlgorithm);
UNREFERENCED_PARAMETER(CertListToBeSigned);
UNREFERENCED_PARAMETER(CertListToBeSignedLength);
UNREFERENCED_PARAMETER(Signature);
UNREFERENCED_PARAMETER(SignatureLength);
return TRUE;
}

Просмотреть файл

@ -22,8 +22,6 @@
#include <msquic.h>
#include <msquicp.h>
#define CXPLAT_CREDENTIAL_TYPE_NULL ((QUIC_CREDENTIAL_TYPE)0xF0000000) // Stub-only special case type
#ifdef QUIC_FUZZER
#include "msquic_fuzz.h"

Просмотреть файл

@ -1,82 +0,0 @@
/*++
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
Abstract:
Stub implementation for generating the self-signed certificate.
--*/
#define QUIC_TEST_APIS 1
#include "platform_internal.h"
#ifdef QUIC_CLOG
#include "selfsign_stub.c.clog.h"
#endif
_IRQL_requires_max_(PASSIVE_LEVEL)
const QUIC_CREDENTIAL_CONFIG*
CxPlatGetSelfSignedCert(
_In_ CXPLAT_SELF_SIGN_CERT_TYPE Type,
_In_ BOOLEAN ClientCertificate
)
{
UNREFERENCED_PARAMETER(Type);
UNREFERENCED_PARAMETER(ClientCertificate);
QUIC_CREDENTIAL_CONFIG* Params = malloc(sizeof(QUIC_CREDENTIAL_CONFIG));
if (Params != NULL) {
CxPlatZeroMemory(Params, sizeof(*Params));
Params->Type = CXPLAT_CREDENTIAL_TYPE_NULL;
}
return Params;
}
_Success_(return == TRUE)
BOOLEAN
CxPlatGetTestCertificate(
_In_ CXPLAT_TEST_CERT_TYPE Type,
_In_ CXPLAT_SELF_SIGN_CERT_TYPE StoreType,
_In_ uint32_t CredType,
_Out_ QUIC_CREDENTIAL_CONFIG* Params,
_When_(CredType == QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH, _Out_)
_When_(CredType != QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH, _Reserved_)
QUIC_CERTIFICATE_HASH* CertHash,
_When_(CredType == QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH_STORE, _Out_)
_When_(CredType != QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH_STORE, _Reserved_)
QUIC_CERTIFICATE_HASH_STORE* CertHashStore,
_When_(CredType == QUIC_CREDENTIAL_TYPE_NONE, _Out_z_bytecap_(100))
_When_(CredType != QUIC_CREDENTIAL_TYPE_NONE, _Reserved_)
char Principal[100]
)
{
// Not yet supported
UNREFERENCED_PARAMETER(Type);
UNREFERENCED_PARAMETER(StoreType);
UNREFERENCED_PARAMETER(CredType);
UNREFERENCED_PARAMETER(Params);
UNREFERENCED_PARAMETER(CertHash);
UNREFERENCED_PARAMETER(CertHashStore);
UNREFERENCED_PARAMETER(Principal);
return FALSE;
}
_IRQL_requires_max_(PASSIVE_LEVEL)
void
CxPlatFreeTestCert(
_In_ QUIC_CREDENTIAL_CONFIG* Params
)
{
UNREFERENCED_PARAMETER(Params);
}
_IRQL_requires_max_(PASSIVE_LEVEL)
void
CxPlatFreeSelfSignedCert(
_In_ const QUIC_CREDENTIAL_CONFIG* Params
)
{
free((void*)Params);
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -14,8 +14,6 @@
#include "CryptTest.cpp.clog.h"
#endif
#ifndef QUIC_TLS_STUB
void
LogTestBuffer(
_In_z_ const char* Name,
@ -523,5 +521,3 @@ TEST_P(CryptTest, HashRandom)
}
INSTANTIATE_TEST_SUITE_P(CryptTest, CryptTest, ::testing::Values(0, 1, 2));
#endif // CXPLAT_TLS_STUB