diff --git a/spdmlib/src/requester/encap_certificate.rs b/spdmlib/src/requester/encap_certificate.rs index ed94281..0d379f6 100644 --- a/spdmlib/src/requester/encap_certificate.rs +++ b/spdmlib/src/requester/encap_certificate.rs @@ -101,7 +101,7 @@ impl RequesterContext { } let offset = get_certificate.offset; - if offset > my_cert_chain.data_size { + if offset >= my_cert_chain.data_size { self.encode_encap_error_response( SpdmErrorCode::SpdmErrorInvalidRequest, 0, diff --git a/spdmlib/src/responder/certificate_rsp.rs b/spdmlib/src/responder/certificate_rsp.rs index 76c33ae..7a37a73 100644 --- a/spdmlib/src/responder/certificate_rsp.rs +++ b/spdmlib/src/responder/certificate_rsp.rs @@ -125,7 +125,7 @@ impl ResponderContext { } let offset = get_certificate.offset; - if offset > my_cert_chain.data_size { + if offset >= my_cert_chain.data_size { self.write_spdm_error(SpdmErrorCode::SpdmErrorInvalidRequest, 0, writer); return ( Err(SPDM_STATUS_INVALID_MSG_FIELD),