From e18e52a33125215b87e678c70fe445bb97105676 Mon Sep 17 00:00:00 2001 From: Xiao Date: Wed, 18 Sep 2024 13:35:53 +0800 Subject: [PATCH] Increase the check for DesiredAsymAlgo to determine whether at most one bit is set for DesiredAsymAlgo. Signed-off-by: Xiao --- .../spdm_responder_lib/libspdm_rsp_set_key_pair_info_ack.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/spdm_responder_lib/libspdm_rsp_set_key_pair_info_ack.c b/library/spdm_responder_lib/libspdm_rsp_set_key_pair_info_ack.c index d0ecf0cd13b..0244663c264 100644 --- a/library/spdm_responder_lib/libspdm_rsp_set_key_pair_info_ack.c +++ b/library/spdm_responder_lib/libspdm_rsp_set_key_pair_info_ack.c @@ -194,6 +194,11 @@ libspdm_return_t libspdm_get_response_set_key_pair_info_ack(libspdm_context_t *s SPDM_ERROR_CODE_INVALID_REQUEST, 0, response_size, response); } + if(!libspdm_onehot0(desired_asym_algo)) { + return libspdm_generate_error_response(spdm_context, + SPDM_ERROR_CODE_INVALID_REQUEST, 0, + response_size, response); + } if ((desired_asym_algo != 0) && ((asym_algo_capabilities | desired_asym_algo) != asym_algo_capabilities)) { return libspdm_generate_error_response(