Fix multi-part termination on error

For multi-part operations, the PSA Crypto API specifies that if
the final operation does not return PSA_SUCCESS, the abort
operaion must be called by a client to clean-up the operation.
This change modifies the behaviour of the crypto provider
to only clear its operation context on success. This leaves
the operation context allocated, ensuring that the correct
PSA API status is returned when a client makes the mandatory
call to abort the failed operation. If the client never calls
abort, the context will eventually get recycled.

Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I9a6e2f2b96febec2e1b1b91c5d4f5189b1b24f8f
8 files changed