Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip certificate algorithm check #2832

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions library/spdm_crypt_lib/libspdm_crypt_cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,10 +1109,15 @@ bool libspdm_x509_common_certificate_check(const uint8_t *cert, size_t cert_size
}
#endif /* LIBSPDM_ADDITIONAL_CHECK_CERT */

/* 4. Verify public key algorithm. */
status = libspdm_verify_cert_subject_public_key_info(cert, cert_size, base_asym_algo);
if (!status) {
goto cleanup;
/* 4. Verify public key algorithm.
* If this is a SET_CERTIFICATE operation and the endpoint uses the AliasCert model then the
* check should be skipped as the Device Certificate CA's public key does not have to use
* the same algorithms as the connection's negotiated algorithms. */
if (!set_cert || (cert_model != SPDM_CERTIFICATE_INFO_CERT_MODEL_ALIAS_CERT)) {
status = libspdm_verify_cert_subject_public_key_info(cert, cert_size, base_asym_algo);
if (!status) {
goto cleanup;
}
}

/* 5. issuer_name*/
Expand Down
Loading