Add psa_pake_set_context function for spake2p #588

Open
kusumitg wants to merge 2 commits from kusumitg/implement_psa_pake_set_context_for_spake2p into development
kusumitg commented 2025-12-03 11:20:35 -06:00 (Migrated from github.com)

Description

Implement psa_pake_set_context function for SPAKE2+.

Fixes MbedTLS:9344

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog provided | not required because:
  • framework PR provided Mbed-TLS/mbedtls-framework# | not required
  • mbedtls development PR provided Mbed-TLS/mbedtls# | not required because:
  • mbedtls 3.6 PR provided Mbed-TLS/mbedtls# | not required because:
  • tests provided | not required because:
## Description Implement `psa_pake_set_context` function for SPAKE2+. Fixes [MbedTLS:9344](https://github.com/Mbed-TLS/mbedtls/issues/9344) ## PR checklist Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line. If the provided content is part of the present PR remove the # symbol. - [ ] **changelog** provided | not required because: - [ ] **framework PR** provided Mbed-TLS/mbedtls-framework# | not required - [ ] **mbedtls development PR** provided Mbed-TLS/mbedtls# | not required because: - [ ] **mbedtls 3.6 PR** provided Mbed-TLS/mbedtls# | not required because: - **tests** provided | not required because:
kusumitg commented 2025-12-06 15:28:08 -06:00 (Migrated from github.com)

I think that adding tests for the psa_pake_set_context requires psa_pake_setup. Another way is maybe by modifying the operation structure in the test function. Please let me know if I should do that.

I think that adding tests for the `psa_pake_set_context` requires `psa_pake_setup`. Another way is maybe by modifying the operation structure in the test function. Please let me know if I should do that.
KiruthikPrakash (Migrated from github.com) reviewed 2025-12-16 06:22:47 -06:00
@ -9033,0 +9063,4 @@
if (operation->data.inputs.context == NULL) {
status = PSA_ERROR_INSUFFICIENT_MEMORY;
LOCAL_INPUT_FREE(context_external, context);
goto exit;
KiruthikPrakash (Migrated from github.com) commented 2025-12-16 06:22:13 -06:00

I don’t see it being freed in psa_pake_abort(). Could you add cleanup here to free operation->data.inputs.context (and reset context/context_len) to avoid leaking this buffer when the operation is aborted?

I don’t see it being freed in psa_pake_abort(). Could you add cleanup here to free operation->data.inputs.context (and reset context/context_len) to avoid leaking this buffer when the operation is aborted?
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'kusumitg/implement_psa_pake_set_context_for_spake2p:kusumitg/implement_psa_pake_set_context_for_spake2p'
git switch 'kusumitg/implement_psa_pake_set_context_for_spake2p'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'development'
git merge --no-ff 'kusumitg/implement_psa_pake_set_context_for_spake2p'
git switch 'kusumitg/implement_psa_pake_set_context_for_spake2p'
git rebase 'development'
git switch 'development'
git merge --ff-only 'kusumitg/implement_psa_pake_set_context_for_spake2p'
git switch 'kusumitg/implement_psa_pake_set_context_for_spake2p'
git rebase 'development'
git switch 'development'
git merge --no-ff 'kusumitg/implement_psa_pake_set_context_for_spake2p'
git switch 'development'
git merge --squash 'kusumitg/implement_psa_pake_set_context_for_spake2p'
git switch 'development'
git merge --ff-only 'kusumitg/implement_psa_pake_set_context_for_spake2p'
git switch 'development'
git merge 'kusumitg/implement_psa_pake_set_context_for_spake2p'
git push origin 'development'
Sign in to join this conversation.
No reviewers
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-Mbed-TLS/TF-PSA-Crypto!588
No description provided.