Skip to content

Handling key handle closing is noisy and error prone #34

@sbailey-arm

Description

@sbailey-arm

As discussed in other PRs, having to deal with cleanup operations after a normal operation and returning any errors in the correct order is noisy and error prone.

E.g.:

let export_res = Status::from(unsafe {
        psa_crypto_sys::psa_export_public_key(
            handle,
            data.as_mut_ptr(),
            data.len(),
            &mut data_length,
        )
    })
    .to_result();
    key.close_handle(handle)?;
    export_res?;
    Ok(data_length)

(not sure if the errors are returned in the 'correct' order here!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions