Skip to content

Clarify the failure states for multi-part operation setup functions - #380

Open
athoelke wants to merge 1 commit into
GlobalPlatform:mainfrom
athoelke:fix-multipart-setup-failure-postconditions
Open

Clarify the failure states for multi-part operation setup functions#380
athoelke wants to merge 1 commit into
GlobalPlatform:mainfrom
athoelke:fix-multipart-setup-failure-postconditions

Conversation

@athoelke

Copy link
Copy Markdown
Collaborator

In version 1.1, the error condition descriptions were clarified and aligned across the whole API, but in the process an error was introduced in the description of multi-part operation objects when the setup function returned an error. The typical wording is as follows:

If psa_sign_setup() returns an error, the operation object is unchanged. If a subsequent function call with an active operation returns an error, the operation enters an error state.

To abandon an active operation, or reset an operation in an error state, call psa_sign_abort().

The first statement is only true if the operation was inactive prior to the call. If the operation was not inactive then calling the setup function is going to return PSA_ERROR_BAD_STATE (as the call is out of sequence) and put the operation object into an error state. TF-PSA-Crypto still implements the original MbedTLS behaviour from before Crypto API 1.1 - which is to put the object into an error state if it was not inactive prior to the setup call.

This PR clarifies the behaviour and restores the missing (v1.0) conditions to all of the setup functions.

@athoelke athoelke added this to the Crypto API 1.x milestone Aug 12, 2026
@athoelke athoelke self-assigned this Aug 12, 2026
@athoelke athoelke added clarification Something is confusing or missing in the documentation Crypto API Issue or PR related to the Cryptography API labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clarification Something is confusing or missing in the documentation Crypto API Issue or PR related to the Cryptography API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant