The Quote Verification Library verifies Intel® Software Guard Extensions (Intel® SGX) and Intel® Trust Domain Extensions (Intel® TDX) quotes against Intel-issued collateral, and reports the resulting TCB status.
QVL does not fetch collateral and does not depend on a particular host runtime. The caller passes in the PCK certificate chain, revocation lists, TCB information and the Quoting Enclave identity. Only the engine API accepts a call without the Quoting Enclave identity; QvlCore and QvlToken require it, with its issuer chain. The same sources build both an untrusted host library and the trusted library linked into the Quote Verification Enclave (QvE).
Note
Starting with release 1.28, the QvlCore and QvlToken sources are part of this repository, which
confidential-computing.tee.dcap consumes as a submodule at QuoteVerification/verification/QVL.1
Up to release 1.27, this code was part of the Quote Verification Enclave sources, qve.cpp and qve_logic.cpp.
Its history came along, so git log --follow and git blame reach back past the move.
Related Projects
Intel® DCAP builds these sources into the Quote Verification Enclave (QvE) (libsgx_qve.signed.so) and into the untrusted quote verification library (libsgx_dcap_quoteverify.so).
The libraries in this repository take the verification collateral as input and do no I/O of their own: Intel® issues the collateral through the Provisioning Certification Service (PCS), and the DCAP Quote Provider Library (QPL) retrieves it, typically through a Provisioning Certificate Caching Service (PCCS).
The Quote Appraisal Library (QAL) evaluates the verification result against appraisal policies.
The engine parses and checks the caller's quote and collateral, and QvlCore turns the outcome into a verdict, the collateral expiration status and the supplemental data. Optionally, QvlToken returns that result as a Quote Verification Result Token (QVT), a JWT that a caller can consume instead of the supplemental data. QAL, in turn, can appraise the QVT against policies.
flowchart LR
caller["Quote, verification<br/>collateral and root key"]
subgraph verification["Quote verification"]
engine["Engine (<a href='https://github.com/intel/confidential-computing.tee.dcap.qvl/tree/main/Src'>L1</a>)<br/>parse and verify"] --> core["QvlCore (<a href='https://github.com/intel/confidential-computing.tee.dcap.qvl/tree/main/qvl_core'>L2</a>)<br/>verdict, TCB status,<br/>supplemental data"]
subgraph tokenbox["Optional: as a token"]
token["QvlToken (<a href='https://github.com/intel/confidential-computing.tee.dcap.qvl/tree/main/qvl_token'>L3</a>)<br/>QVT (JWT)"]
end
core -.-> token
end
subgraph appraisal["Optional: appraisal"]
qal["<a href='https://github.com/intel/confidential-computing.tee.dcap.qal'>QAL</a><br/>(separate repository)<br/>appraisal policies"]
end
caller --> engine
token -.-> qal
style tokenbox stroke-dasharray: 5 5
style appraisal stroke-dasharray: 5 5
Tip
Applications normally use QVL through Intel® DCAP's libsgx_dcap_quoteverify, which links the host flavour:
qvl_wrapperservestee_verify_quoteand, for a QVT,tee_verify_quote_qvt. It runs QVL in the library, or in the QvE enclave when the caller asks for a QvE report; only the QvE signs the token, and only its result can be cryptographically authenticated.qal_wrapperservestee_appraise_verification_tokenand runs QAL in the library or in the Quote Appraisal Enclave (QAE).
The full API of libsgx_dcap_quoteverify is declared in sgx_dcap_quoteverify.h and sgx_dcap_qal.h.
If the caller passes no collateral, qvl_wrapper fetches it through the QPL.
Note: The Service TD flavour, which has no token pathway, does not go through libsgx_dcap_quoteverify.
It is linked, as libqvl_core_servtd.a, into DCAP's Service TD attestation library libservtd_attest.a, by servtd/verify/linux/Makefile.
Three layers (L1, L2, L3), lowest first:
| Layer | Directory | Contents |
|---|---|---|
| L1 | Src/ 🔗 qvl_engine/ |
Verification engine: attestation library, collateral parsers, sample app |
| L2 | qvl_core/ |
QvlCore: the quote verification API, without the attestation token pathway |
| L3 | qvl_token/ |
QvlToken: the attestation token pathway, layered on QvlCore |
QvlCore and QvlToken expose C linkage and avoid C++ constructs in their public headers, so they can be included from C and C++ alike.
Important
The engine's sources are temporarily kept in Src/ to preserve source layout compatibility with existing callers.
A qvl_engine symlink to Src/ is provided, so callers can move to the new layout already.2
In a future release, Src/ will be renamed to qvl_engine/.
Consumers build against the headers in include/ of QvlCore and QvlToken; the headers next to the sources are internal.
| Header | Role |
|---|---|
qvl_core/include/qvl_core.h |
Verification API, every flavour |
qvl_core/include/qvl_core_servtd.h |
Service TD entrypoint, used on top of qvl_core.h in the Service TD flavour |
qvl_token/include/qvl_token.h |
Verification returning a QVT |
qvl_common_defs.h, qvl_intel_root_pub_key.h |
Supporting: common definitions and the Intel® SGX Root CA keys |
See QvlCore and QvlToken for details.
The engine's own, lower-level APIs are public too; prefer the headers above:
| Directory | Header | Contents |
|---|---|---|
Src/AttestationLibrary/include |
SgxEcdsaAttestation/QuoteVerification.h |
C verification API; qvl_core.h includes it |
Src/AttestationParsers/include |
SgxEcdsaAttestation/AttestationParsers.h |
C++ collateral parsers, used for example by DCAP's PCK certificate selection tool |
- OpenSSL, or Intel® SGX SSL for trusted builds
- RapidJSON - JSON parsing and emission
- jwt-cpp - JWT handling, QvlToken only; a submodule, patched at build time with
patch - Intel® SGX SDK - trusted builds; untrusted builds need only its headers, also shipped as
libsgx-headers
Used only by the engine's CMake build, not in the archives consumers link:
- GoogleTest - unit tests
- Hunter - fetches the packages above and OpenSSL; vendored
- spdlog - logging, only with
BUILD_LOGS - argtable3 - sample application command line; vendored
The Makefile at the repository root is the build interface for consumers such as Intel® DCAP; the engine's CMake build under Src/ serves development, the unit tests and the sample application.
It builds each component in the flavour the consumer links it into, as a static archive:
| Target | Archive | Contains | Linked into |
|---|---|---|---|
qvl_core_untrusted |
libqvl_core_untrusted.a |
QvlCore and the engine | A host library, such as libsgx_dcap_quoteverify.so |
qvl_core_trusted |
libqvl_core_trusted.a |
QvlCore and the engine | An enclave, such as the QvE |
qvl_core_servtd |
libqvl_core_servtd.a |
QvlCore with its Service TD part, and the engine | The Service TD attestation library (libservtd_attest.a) |
qvl_token_untrusted |
libqvl_token_untrusted.a |
QvlToken only | A host library, together with libqvl_core_untrusted.a |
qvl_token_trusted |
libqvl_token_trusted.a |
QvlToken only | An enclave, together with libqvl_core_trusted.a |
No engine library is linked separately.
QvlToken builds on QvlCore: a qvl_token_* target also builds the qvl_core_* archive of its flavour, and on the link line the QvlToken archive goes first.
make with no target builds the untrusted and trusted flavours.
make -s --no-print-directory qvl_include_dirs prints the public include directories: qvl_core/include, qvl_token/include and the engine API directory qvl_core.h uses.
-
Untrusted flavour: the Intel® SGX headers, from the SDK or
libsgx-headers, and OpenSSL. -
Trusted flavour: the Intel® SGX SDK and Intel® SGX SSL.
-
Service TD flavour: the Intel® SGX SDK source tree, built with
make servtd_attest, and Intel® SGX SSL built for the Service TD. -
QvlToken:
patchand the jwt-cpp submodule, unlessJWT_CPP_INC_PATHpoints at an already patched copy. The build stops if the jwt-cpp headers it uses are not patched.git submodule update --init Src/ThirdParty/jwt-cpp
A consumer passes its own compiler flags and where the Intel® SGX SDK and OpenSSL or Intel® SGX SSL are.
QVL derives the include paths from those locations, adds its own, and -DSERVTD_ATTEST for the Service TD flavour.
The flags apply to whichever flavour is built, so build one flavour per make call when passing them.
Without them, each flavour uses defaults that are enough for a standalone build.
| Variable | Description | Default |
|---|---|---|
OUT_DIR |
Where the archives go; objects go to $(OUT_DIR)/obj/<flavour> |
Build |
SGX_COMMON_CXXFLAGS |
Compiler flags for every flavour | Per flavour |
ENCLAVE_CXXFLAGS |
Additional compiler flags for the trusted and Service TD flavours | Per flavour |
JWT_CPP_INC_PATH |
jwt-cpp include directory, already patched with jwt-cpp-sgx.patch |
A patched copy in OUT_DIR |
DEBUG |
1 for an unoptimized debug build; default flags only |
0 |
MITIGATION_CFLAGS |
LVI mitigation flags for the trusted and Service TD flavours; default flags only | Empty |
SGX_SDK |
Intel® SGX SDK installation, or the libsgx-headers prefix for the untrusted flavour |
/opt/intel/sgxsdk |
OPENSSL_INCLUDE_DIR |
OpenSSL include directory for the untrusted flavour | The compiler's |
SGXSSL_PACKAGE_PATH |
Intel® SGX SSL package, for the trusted and Service TD flavours | /opt/intel/sgxssl |
SERVTD_ATTEST_LINUX_TRUNK_ROOT_PATH |
Intel® SGX SDK source tree, for the Service TD flavour | None |
For example, a standalone build:
make -j SGX_SDK=/opt/intel/sgxsdk SGXSSL_PACKAGE_PATH=/opt/intel/sgxsslQvlCore also has MSBuild projects for its trusted and untrusted flavours under qvl_core/win/.
The unit tests of QvlCore and QvlToken, in qvl_core/test and qvl_token/test, build with the engine's CMake build as QvlCore_UT and QvlToken_UT when BUILD_TESTS is on together with BUILD_QVL_CORE and BUILD_QVL_TOKEN, for example ./runUT -DBUILD_QVL_TOKEN=ON in Src.
On Windows, QvlCore's tests build from qvl_core/win/QvlCore_test.
See Src/README.md for the engine's CMake options, requirements, tests, code coverage and the Windows build.
- Intel® SGX DCAP: ECDSA Quote Library API - verification API, results and supplemental data, Intel® SGX
- Intel® TDX DCAP: Quote Generation Library and Quote Verification Library - the same, Intel® TDX
- Intel® DCAP Appraisal Engine Developer Guide - the QVT and appraisal policies
- Intel® SGX PCK Certificate and CRL Profile Specification - the certificates and revocation lists QVL verifies
- Intel® SGX DCAP product brief - DCAP overview
- Intel® Provisioning Certification Service (PCS) - the collateral and its API
- Intel® Confidential Computing documentation - enabling guides, including the caching service
- Intel® SGX and Intel® TDX overviews
- Contributing and the code of conduct
- Security policy, for reporting vulnerabilities
- License and third-party licenses