Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various PSA Crypto fixes #20854

Merged
merged 5 commits into from
Sep 18, 2024
Merged

Various PSA Crypto fixes #20854

merged 5 commits into from
Sep 18, 2024

Conversation

Wer-Wolf
Copy link
Contributor

@Wer-Wolf Wer-Wolf commented Sep 7, 2024

Contribution description

This PR fixes some bugs and missing features found during implementing a generic HMAC backend.
Since those fixes are not directly connected to the generic HMAC, it would make sense to merge them separatly.

Testing procedure

The changes where tested using the psa_crypto test where applicable.

Issues/PRs references

See #20758.

@github-actions github-actions bot added Area: tests Area: tests and testing framework Area: sys Area: System labels Sep 7, 2024
When psa_status_t is defined inside crypto_types.h, then all
users of psa_status_t are forced to pull the full range of PSA
Crypto API type definitions.

This however means that psa_status_t cannot be used when defining
those PSA Crypto API types, since doing so would create a cycle.

Fix this by moving the PSA status definitions into a separate header
file which additionally is compatible with the PSA Status code API.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
The PSA crypto specification states that when creating keys,
the usage flags PSA_KEY_USAGE_SIGN_HASH/PSA_KEY_USAGE_VERIFY_HASH
automatically set the usage flags
PSA_KEY_USAGE_SIGN_MESSAGE/PSA_KEY_USAGE_VERIFY_MESSAGE on the key.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
@github-actions github-actions bot added the Area: doc Area: Documentation label Sep 7, 2024
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Sep 7, 2024
@riot-ci
Copy link

riot-ci commented Sep 7, 2024

Murdock results

✔️ PASSED

fe56b7d sys/psa_crypto: Implement PSA_MAC_MAX_SIZE()

Success Failures Total Runtime
10197 0 10197 17m:57s

Artifacts

@Einhornhool Einhornhool self-requested a review September 11, 2024 15:49
Copy link
Contributor

@Einhornhool Einhornhool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM, too! Just two comments below.

tests/sys/psa_crypto/main.c Show resolved Hide resolved
sys/include/psa_crypto/psa/crypto_sizes.h Show resolved Hide resolved
Add some tests to verify that when creating or importing keys,
the usage flags PSA_KEY_USAGE_SIGN_HASH/PSA_KEY_USAGE_VERIFY_HASH
automatically set the usage flags PSA_KEY_USAGE_SIGN_MESSAGE/
PSA_KEY_USAGE_VERIFY_MESSAGE on the key.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
The initial implementation was inspired by MbedTLS, with the
addition of the MD2 and MD4 algorithms.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
This support macro is necessary for full MAC support.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
@mguetschow mguetschow added this pull request to the merge queue Sep 18, 2024
Merged via the queue into RIOT-OS:master with commit 5d95895 Sep 18, 2024
26 checks passed
@Wer-Wolf
Copy link
Contributor Author

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: doc Area: Documentation Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants