-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add verify cert callback function for DiceTcbInfo.
Refer the spec https://trustedcomputinggroup.org/resource/dice-attestation-architecture/ add verify cert callback function for Cert extentison DiceTcbInfo check. Signed-off-by: Wenxing Hou <[email protected]>
- Loading branch information
1 parent
828ef62
commit c1c1faa
Showing
6 changed files
with
552 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
|
||
INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include | ||
${LIBSPDM_DIR}/unit_test/include | ||
${LIBSPDM_DIR}/os_stub/spdm_device_secret_lib_sample | ||
${LIBSPDM_DIR}/unit_test/cmockalib/cmocka/include | ||
${LIBSPDM_DIR}/unit_test/cmockalib/cmocka/include/cmockery | ||
${LIBSPDM_DIR}/unit_test/spdm_unit_test_common | ||
${LIBSPDM_DIR}/os_stub/include | ||
${LIBSPDM_DIR}/os_stub | ||
) | ||
|
||
if(CMAKE_SYSTEM_NAME MATCHES "Windows") | ||
if((TOOLCHAIN STREQUAL "VS2015") OR (TOOLCHAIN STREQUAL "VS2019") OR (TOOLCHAIN STREQUAL "VS2022")) | ||
ADD_COMPILE_OPTIONS(/wd4819) | ||
endif() | ||
endif() | ||
|
||
SET(src_test_spdm_callback | ||
test_spdm_callback.c | ||
spdm_cert_verify_callback.c | ||
${LIBSPDM_DIR}/unit_test/spdm_unit_test_common/support.c | ||
${LIBSPDM_DIR}/unit_test/spdm_unit_test_common/algo.c | ||
) | ||
|
||
SET(test_spdm_callback_LIBRARY | ||
memlib | ||
debuglib | ||
spdm_crypt_lib | ||
${CRYPTO_LIB_PATHS} | ||
cryptlib_${CRYPTO} | ||
rnglib | ||
malloclib | ||
cmockalib | ||
spdm_device_secret_lib_sample | ||
spdm_crypt_ext_lib | ||
spdm_common_lib | ||
spdm_secured_message_lib | ||
) | ||
|
||
if(TOOLCHAIN STREQUAL "ARM_DS2022") | ||
SET(test_spdm_callback_LIBRARY ${test_spdm_callback_LIBRARY} armbuild_lib) | ||
endif() | ||
|
||
if((TOOLCHAIN STREQUAL "KLEE") OR (TOOLCHAIN STREQUAL "CBMC")) | ||
ADD_EXECUTABLE(test_spdm_callback | ||
${src_test_spdm_callback} | ||
$<TARGET_OBJECTS:memlib> | ||
$<TARGET_OBJECTS:debuglib> | ||
$<TARGET_OBJECTS:spdm_crypt_lib> | ||
$<TARGET_OBJECTS:${CRYPTO_LIB_PATHS}> | ||
$<TARGET_OBJECTS:rnglib> | ||
$<TARGET_OBJECTS:cryptlib_${CRYPTO}> | ||
$<TARGET_OBJECTS:malloclib> | ||
) | ||
else() | ||
ADD_EXECUTABLE(test_spdm_callback ${src_test_spdm_callback}) | ||
TARGET_LINK_LIBRARIES(test_spdm_callback ${test_spdm_callback_LIBRARY}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## This is reference implementation to verify CertChain DiceTcbInfo extension. | ||
|
||
### DiceTcbInfo extension Spec | ||
[DICE Attestation Architecture](https://trustedcomputinggroup.org/wp-content/uploads/DICE-Attestation-Architecture-Version-1.1-Revision-18_pub.pdf) | ||
|
||
### Implementation Assumption | ||
1) **Reference TcbInfo.** | ||
|
||
- Only one reference TcbInfo entry is provided by the integrator. (Multiple reference TcbInfo is NOT supported in this Implementation.) | ||
2) **Reported TcbInfo** | ||
|
||
- Reported TcbInfo must be in at least one certificate. | ||
- If none of the certificates includes TcbInfo, the verification must fail. | ||
3) **TcbInfo Matching** | ||
|
||
- At least one reported TcbInfo must fully match the reference TcbInfo. | ||
- If none of the reported TcbInfos matches all fields in the reference TcbInfo, the verification must fail. | ||
- Once one of the reported TcbInfo fully matches, the verification must pass and the rests of reported TcbInfo must be ignored. | ||
4) **TcbInfo Field** | ||
|
||
- The reported TcbInfo must include all fields in the reference TcbInfo. If a field in the reference TcbInfo does not exist in the reported TcbInfo, the verification must fail. | ||
- The reported TcbInfo could include more fields which do not exist in the reference TcbInfo. The extra fields in the reported TcbInfo must be ignored and NOT validated, and they must not impact the final result. | ||
|
||
|
||
### Note | ||
1) The implementaion is just for Openssl Crypto Library. | ||
2) To verify the CertChain DiceTcbInfo extension, please use the following command to build. | ||
``` | ||
cmake -G"NMake Makefiles" -DARCH=x64 -DTOOLCHAIN=VS2019 -DTARGET=Debug -DCRYPTO=openssl -DX509_IGNORE_CRITICAL=ON .. | ||
``` | ||
|
||
``` | ||
cmake -G"NMake Makefiles" -DARCH=x64 -DTOOLCHAIN=VS2019 -DTARGET=Release -DCRYPTO=openssl -DX509_IGNORE_CRITICAL=ON .. | ||
``` |
Oops, something went wrong.