psa: Check generator validity before read #57

Merged
Patater merged 1 commit from check-generator-validity into development 2019-02-18 13:22:20 -06:00
Patater commented 2019-02-15 07:15:42 -06:00 (Migrated from github.com)

Check generator validity (i.e. that alg has been initialized) before
allowing reads from the generator or allowing reads of the generator's
capacity.

This aligns our implementation with the documented error code behavior
in our crypto.h and the PSA Crypto API.

Fixes https://github.com/ARMmbed/mbedtls-psa/issues/183

Check generator validity (i.e. that alg has been initialized) before allowing reads from the generator or allowing reads of the generator's capacity. This aligns our implementation with the documented error code behavior in our crypto.h and the PSA Crypto API. Fixes https://github.com/ARMmbed/mbedtls-psa/issues/183
NirSonnenschein (Migrated from github.com) reviewed 2019-02-15 09:06:30 -06:00
NirSonnenschein (Migrated from github.com) left a comment

The changes look good to me.
Besides the tests fixed here are there any other instances that could affected by the change in behavior? (e.g. example repo, IPC parameter checks in IPC)?

The changes look good to me. Besides the tests fixed here are there any other instances that could affected by the change in behavior? (e.g. example repo, IPC parameter checks in IPC)?
gilles-peskine-arm (Migrated from github.com) reviewed 2019-02-15 12:34:32 -06:00
dgreen-arm (Migrated from github.com) reviewed 2019-02-18 11:02:15 -06:00
dgreen-arm (Migrated from github.com) left a comment

A single typo, otherwise looks good to me

A single typo, otherwise looks good to me
@ -3911,7 +3922,13 @@ psa_status_t psa_generator_read( psa_crypto_generator_t *generator,
exit:
dgreen-arm (Migrated from github.com) commented 2019-02-18 10:58:09 -06:00

Typo: exhaused -> exhausted

Typo: exhaused -> exhausted
Patater commented 2019-02-18 11:03:28 -06:00 (Migrated from github.com)

Rebasing to address review comments and to resolve merge conflicts.

Rebasing to address review comments and to resolve merge conflicts.
dgreen-arm (Migrated from github.com) approved these changes 2019-02-18 11:10:11 -06:00
Patater commented 2019-02-18 11:11:27 -06:00 (Migrated from github.com)

Rebased. Unfortunately, the base change had to happen in order to get the merge conflicts resolved, and we've merged the latest Mbed TLS code in (so the base is quite different).

Probably easiest to diff between diffs on this one instead of using GitHub's "force-pushed" diff.

Old branch up at https://github.com/Patater/mbed-crypto/tree/check-generator-validity-1

Rebased. Unfortunately, the base change had to happen in order to get the merge conflicts resolved, and we've merged the latest Mbed TLS code in (so the base is quite different). Probably easiest to diff between diffs on this one instead of using GitHub's "force-pushed" diff. Old branch up at https://github.com/Patater/mbed-crypto/tree/check-generator-validity-1
gilles-peskine-arm (Migrated from github.com) approved these changes 2019-02-18 11:23:37 -06:00
Patater commented 2019-02-18 13:21:56 -06:00 (Migrated from github.com)

CI failure is the FreeBSD timing test, a known flaky test.

CI failure is the FreeBSD timing test, a known flaky test.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-ARMmbed/mbed-crypto!57
No description provided.