From 6e3484e123e2e211d1619d0662241b1601d57638 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 22 Feb 2021 15:09:03 +0000 Subject: [PATCH] Clarify documentation of MBEDTLS_MPS_STATE_VALIDATION Signed-off-by: Hanno Becker --- library/mps_common.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/library/mps_common.h b/library/mps_common.h index 1ac3bd8b2..467e6cc30 100644 --- a/library/mps_common.h +++ b/library/mps_common.h @@ -61,12 +61,15 @@ * non-sensical calls or not, and that's what this option is about: * * This option determines whether the expected abstract state - * is part of the API preconditions or not. If it is, the function's - * behavior is undefined if the abstract state is not as expected. - * If it is set, API is required to fail gracefully with error - * #MBEDTLS_ERR_MPS_OPERATION_UNEXPECTED, and without changing the abstract - * state of the input context, if the abstract state is unexpected but - * all other preconditions are satisfied. + * is part of the API preconditions or not: If the option is set, + * then the abstract state is not part of the precondition and is + * thus required to be validated by the implementation. If an unexpected + * abstract state is encountered, the implementation must fail gracefully + * with error #MBEDTLS_ERR_MPS_OPERATION_UNEXPECTED. + * Conversely, if this option is not set, then the expected abstract state + * is included in the preconditions of the respective API calls, and + * an implementation's behaviour is undefined if the abstract state is + * not as expected. * * For example: Enabling this makes mps_l2_read_done() fail if * no incoming record is currently open; disabling this would