Combine psa_pake_set_password_key() with psa_pake_setup() #215

Merged
amtkarm1 merged 10 commits from iss9320 into development 2025-08-01 02:17:05 -05:00
amtkarm1 commented 2025-03-19 10:23:49 -05:00 (Migrated from github.com)

Description

Fixed Mbed-TLS/mbedtls#9320

Gatekeeper note: interdependent with Mbed-TLS/mbedtls#10077 - handle with care!

PR checklist

  • changelog provided
  • framework PR not required
  • mbedtls development PR provided Mbed-TLS/mbedtls#10077
  • mbedtls 3.6 PR not required because: no backport required
  • mbedtls 2.28 PR not required because: no backport required
  • tests provided: changed the previous tests
## Description Fixed Mbed-TLS/mbedtls#9320 Gatekeeper note: interdependent with Mbed-TLS/mbedtls#10077 - handle with care! ## PR checklist - [X] **changelog** provided - [X] **framework PR** not required - [X] **mbedtls development PR** provided Mbed-TLS/mbedtls#10077 - [X] **mbedtls 3.6 PR** not required because: no backport required - [X] **mbedtls 2.28 PR** not required because: no backport required - **tests** provided: changed the previous tests
gabor-mezei-arm (Migrated from github.com) requested changes 2025-04-07 08:06:55 -05:00
@ -0,0 +1,7 @@
Removals
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 06:38:23 -05:00
   * Removed the `psa_pake_set_password_key()` function to comply
     with the PSA API 1.2 PAKE extension.
```suggestion * Removed the `psa_pake_set_password_key()` function to comply with the PSA API 1.2 PAKE extension. ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 06:39:20 -05:00
   * Now the functionality of `psa_pake_set_password_key()` is implemented in
     `psa_pake_setup()` function, as per the PSA API 1.2 PAKE extension.
```suggestion * Now the functionality of `psa_pake_set_password_key()` is implemented in `psa_pake_setup()` function, as per the PSA API 1.2 PAKE extension. ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:11:10 -05:00
 *         \p password_key is not a valid key identifier.
```suggestion * \p password_key is not a valid key identifier. ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:11:40 -05:00
 *                              #psa_pake_operation_t and not yet in use.
```suggestion * #psa_pake_operation_t and not yet in use. ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:12:27 -05:00
 *                              The key must permit the usage #PSA_KEY_USAGE_DERIVE.
```suggestion * The key must permit the usage #PSA_KEY_USAGE_DERIVE. ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:13:01 -05:00
 *         - The library requires initializing by a call to #psa_crypto_init().
```suggestion * - The library requires initializing by a call to #psa_crypto_init(). ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:13:31 -05:00
 *         \p password_key does not have the #PSA_KEY_USAGE_DERIVE flag, or it does
 *         not permit the algorithm in \p cipher_suite.
```suggestion * \p password_key does not have the #PSA_KEY_USAGE_DERIVE flag, or it does * not permit the algorithm in \p cipher_suite. ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:13:57 -05:00
 *         - The algorithm in \p cipher_suite is not a PAKE algorithm, or encodes an
```suggestion * - The algorithm in \p cipher_suite is not a PAKE algorithm, or encodes an ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:14:12 -05:00
 *         - The PAKE primitive in \p cipher_suite is not compatible with the PAKE
```suggestion * - The PAKE primitive in \p cipher_suite is not compatible with the PAKE ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:14:26 -05:00
 *         - The key confirmation value in \p cipher_suite is not compatible with the
```suggestion * - The key confirmation value in \p cipher_suite is not compatible with the ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:14:45 -05:00
 *         - The key type or key size of \p password_key is not compatible with
 *           \p cipher_suite.
```suggestion * - The key type or key size of \p password_key is not compatible with * \p cipher_suite. ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:15:00 -05:00
 *         - The algorithm in \p cipher_suite is not a supported PAKE algorithm, or
```suggestion * - The algorithm in \p cipher_suite is not a supported PAKE algorithm, or ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:15:15 -05:00
 *         - The PAKE primitive in \p cipher_suite is not supported or not compatible
```suggestion * - The PAKE primitive in \p cipher_suite is not supported or not compatible ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:15:29 -05:00
 *         - The key confirmation value in \p cipher_suite is not supported, or not
```suggestion * - The key confirmation value in \p cipher_suite is not supported, or not ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:15:47 -05:00
 *         - The key type or key size of \p password_key is not supported with
 *           \p cipher_suite.
```suggestion * - The key type or key size of \p password_key is not supported with * \p cipher_suite. ```
gabor-mezei-arm (Migrated from github.com) commented 2025-04-07 07:16:16 -05:00
 *                              of \p password_key.
```suggestion * of \p password_key. ```
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:37:47 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:37:47 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:37:50 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:37:50 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:37:54 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:37:53 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:37:56 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:37:56 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:37:58 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:37:58 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:00 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:00 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:02 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:02 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:05 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:05 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:07 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:07 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:10 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:10 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:17 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:17 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:20 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:20 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:23 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:23 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:25 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:25 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:28 -05:00
@ -0,0 +1,7 @@
Removals
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:28 -05:00

Updated in a new commit

Updated in a new commit
amtkarm1 (Migrated from github.com) reviewed 2025-04-07 09:38:30 -05:00
@ -0,0 +1,7 @@
Removals
amtkarm1 (Migrated from github.com) commented 2025-04-07 09:38:30 -05:00

Updated in a new commit

Updated in a new commit
gabor-mezei-arm (Migrated from github.com) reviewed 2025-04-08 05:43:56 -05:00
gabor-mezei-arm (Migrated from github.com) left a comment
No description provided.
LGTM
bjwtaylor (Migrated from github.com) reviewed 2025-04-15 02:10:22 -05:00
bjwtaylor (Migrated from github.com) commented 2025-04-15 02:08:39 -05:00

Should be initialised?

Should be initialised?
amtkarm1 (Migrated from github.com) reviewed 2025-04-17 11:44:28 -05:00
amtkarm1 (Migrated from github.com) commented 2025-04-17 11:44:28 -05:00

Could you elaborate, please?

Could you elaborate, please?
bjwtaylor (Migrated from github.com) reviewed 2025-04-24 08:40:22 -05:00
bjwtaylor (Migrated from github.com) commented 2025-04-24 08:40:21 -05:00

Actually ignore it, I missed the function def in the git view.

Actually ignore it, I missed the function def in the git view.
bjwtaylor (Migrated from github.com) reviewed 2025-04-24 08:40:54 -05:00
gilles-peskine-arm commented 2025-04-24 12:52:26 -05:00 (Migrated from github.com)

The CI is unhappy.

The CI is unhappy.
mpg commented 2025-05-07 05:22:19 -05:00 (Migrated from github.com)

The CI is unhappy.

Isn't that mostly because this PR and the associated Mbed TLS PR are inter-dependent, though? The associated Mbed TLS PR seems to have a green CI.

Counter-point: one of the failures here is code style, which seems real.

> The CI is unhappy. Isn't that mostly because this PR and the associated Mbed TLS PR are inter-dependent, though? The associated Mbed TLS PR seems to have a green CI. Counter-point: one of the failures here is code style, which seems real.
gabor-mezei-arm commented 2025-05-20 05:35:34 -05:00 (Migrated from github.com)

There are code style issues which need to be fixed.

--- core/psa_crypto.c	2025-05-12 13:31:18.865257612 +0000
+++ core/psa_crypto.c.uncrustify	2025-05-12 13:32:06.609583357 +0000
@@ -8760,7 +8760,7 @@
         type != PSA_KEY_TYPE_PASSWORD_HASH) {
         status = PSA_ERROR_INVALID_ARGUMENT;
         goto exit;
-        }
+    }
     operation->data.inputs.password = mbedtls_calloc(1, slot->key.bytes);
     if (operation->data.inputs.password == NULL) {
@@ -8772,10 +8772,10 @@
     operation->data.inputs.password_len = slot->key.bytes;
     operation->data.inputs.attributes = slot->attr;
 
-    exit:
-        if (status != PSA_SUCCESS) {
-            psa_pake_abort(operation);
-        }
+exit:
+    if (status != PSA_SUCCESS) {
+        psa_pake_abort(operation);
+    }
     unlock_status = psa_unregister_read_under_mutex(slot);
     return (status == PSA_SUCCESS) ? unlock_status : status;
 }
There are code style issues which need to be fixed. ``` diff --- core/psa_crypto.c 2025-05-12 13:31:18.865257612 +0000 +++ core/psa_crypto.c.uncrustify 2025-05-12 13:32:06.609583357 +0000 @@ -8760,7 +8760,7 @@ type != PSA_KEY_TYPE_PASSWORD_HASH) { status = PSA_ERROR_INVALID_ARGUMENT; goto exit; - } + } operation->data.inputs.password = mbedtls_calloc(1, slot->key.bytes); if (operation->data.inputs.password == NULL) { @@ -8772,10 +8772,10 @@ operation->data.inputs.password_len = slot->key.bytes; operation->data.inputs.attributes = slot->attr; - exit: - if (status != PSA_SUCCESS) { - psa_pake_abort(operation); - } +exit: + if (status != PSA_SUCCESS) { + psa_pake_abort(operation); + } unlock_status = psa_unregister_read_under_mutex(slot); return (status == PSA_SUCCESS) ? unlock_status : status; } ```
mpg commented 2025-05-28 04:37:40 -05:00 (Migrated from github.com)

Note: framework/scripts/code_style.py --fix <affected_files> can be used to fix the code style automatically.

Note: `framework/scripts/code_style.py --fix <affected_files>` can be used to fix the code style automatically.
bjwtaylor (Migrated from github.com) approved these changes 2025-06-12 04:40:35 -05:00
bjwtaylor (Migrated from github.com) left a comment

Approved, subject to CI issues being fixed.

Approved, subject to CI issues being fixed.
mpg (Migrated from github.com) approved these changes 2025-07-30 03:03:47 -05:00
mpg (Migrated from github.com) left a comment

Looks good to me, thanks!

Can you rebase on latest development? That should give us a green CI.

Looks good to me, thanks! Can you rebase on latest development? That should give us a green CI.
mpg commented 2025-07-31 03:53:12 -05:00 (Migrated from github.com)

Note: the reason the CI is not green is that it needs the changes in the companion TLS PR https://github.com/Mbed-TLS/mbedtls/pull/10077 - that one has a green CI with its crypto pointer pointing to the tip of this branch, so it counts as a green CI for this PR as well.

Note: the reason the CI is not green is that it needs the changes in the companion TLS PR https://github.com/Mbed-TLS/mbedtls/pull/10077 - that one has a green CI with its crypto pointer pointing to the tip of this branch, so it counts as a green CI for this PR as well.
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-Mbed-TLS/TF-PSA-Crypto!215
No description provided.