Skip to content

Commit 347dd25

Browse files
Wenxing-houjyao1
authored andcommitted
Fix verify authority and integrity logic
Fix the issue: #2689 The verify authority and integrity should be in the same logic. Signed-off-by: Wenxing Hou <[email protected]>
1 parent 908994f commit 347dd25

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

library/spdm_requester_lib/libspdm_req_get_certificate.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Copyright Notice:
3-
* Copyright 2021-2022 DMTF. All rights reserved.
3+
* Copyright 2021-2024 DMTF. All rights reserved.
44
* License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
55
**/
66

@@ -368,14 +368,14 @@ static libspdm_return_t libspdm_try_get_certificate(libspdm_context_t *spdm_cont
368368
status = LIBSPDM_STATUS_VERIF_FAIL;
369369
goto done;
370370
}
371-
}
372371

373-
/*verify peer cert chain authority*/
374-
result = libspdm_verify_peer_cert_chain_buffer_authority(
375-
spdm_context, cert_chain,cert_chain_size_internal,
376-
trust_anchor, trust_anchor_size);
377-
if (!result) {
378-
status = LIBSPDM_STATUS_VERIF_NO_AUTHORITY;
372+
/*verify peer cert chain authority*/
373+
result = libspdm_verify_peer_cert_chain_buffer_authority(
374+
spdm_context, cert_chain,cert_chain_size_internal,
375+
trust_anchor, trust_anchor_size);
376+
if (!result) {
377+
status = LIBSPDM_STATUS_VERIF_NO_AUTHORITY;
378+
}
379379
}
380380

381381
spdm_context->connection_info.peer_used_cert_chain_slot_id = slot_id;

0 commit comments

Comments
 (0)