Migration guide: PAKE #484
No reviewers
Labels
No labels
api-break
approved
bug
component-docs
component-platform
component-test
dependencies
deprecation
DO-NOT-MERGE
enhancement
good first issue
help wanted
needs-adoption
needs-backports
needs-ci
needs-design-approval
needs-info
needs-preceding-pr
needs-review
needs-reviewer
needs-work
priority-high
priority-low
priority-medium
priority-scheduled
priority-very-high
resolved-after-1.1
single-reviewer
size-l
size-m
size-optimisation
size-s
size-xs
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-Mbed-TLS/TF-PSA-Crypto!484
Loading…
Reference in a new issue
No description provided.
Delete branch "pake-migration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Populate the PAKE section of the 1.0 migration guide. Resolves #335
Based on:
crypto_extra.h,PR checklist
Found a typo and have a non-blocker question, but other than that it looks good to me.
@ -1,5 +1,126 @@## Changes to the PAKE interfaceTypo
@ -6,0 +87,4 @@psa_set_key_algorithm(&shared_key_attributes, alg); // same as derivationpsa_set_key_type(&shared_key_attributes, PSA_KEY_TYPE_DERIVE);status = psa_pake_get_shared_key(&pake_op,Looking at the API spec,
PSA_KEY_TYPE_HMACis permitted here as well. Is that the case for our implementation too? If so would it be worth signalling that here in some way?@ -6,0 +87,4 @@psa_set_key_algorithm(&shared_key_attributes, alg); // same as derivationpsa_set_key_type(&shared_key_attributes, PSA_KEY_TYPE_DERIVE);status = psa_pake_get_shared_key(&pake_op,Looking at the code, we don't seem to enforce any specific key type here. We probably should. Then we should have negative tests when the key type is not good, and also a positive test for
KEY_TYPE_HMAC. I'm creating an issue to track this: https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/485In the meantime, I'll add a sentence here about HMAC.
How to replace
psa_pake_get_implicit_key()withpsa_pake_get_shared_key()is not fully clear. LGTM otherwise.For completeness, I checked the changes from API 1.1beta to 1.2 that are relevant to J-PAKE, and the changes in
psa/crypto_extra.h, and didn't find anything else to mention.@ -1,5 +1,126 @@## Changes to the PAKE interfaceMinor: wouldn't
PSA_ALG_TLS12_ECJPAKE_TO_PMSbe a better example?It has to be the algorithm that
derivation_opwas set up for.I think it would be helpful to include the code to set up and use the derivation operation, in both the before and after snippets.
A typical audience for the migration guide is someone who may be upgrading multiple libraries used in a project, and who isn't very familiar with the code that they're upgrading. So we should guide them with respect to understanding their existing application code.
Minor: this can be done as soon as
psa_pake_get_shared_keyreturns.Also, it doesn't have to be done, but it's arguably good practice, so I agree with having it in, and not making any mention of it being optional (this code is already pretty long).
Can this be done immediately, or do you need to wait until the key derivation operation is finished?
(Answer: according to the PSA specification, you must not destroy a key while it's in use in an operation: that would effectively abort the operation. But in our implementation, destroying a key while an operation is in progress is currently undetected.)
@ -1,5 +1,126 @@## Changes to the PAKE interfaceAbsolutely, that's what I was looking for, I must have navigated to the wrong part of the file by accident.
@ -1,5 +1,126 @@## Changes to the PAKE interfaceYes, I wasn't sure whether to put cleanup as soon as it can be done, or all at the end to reduce clutter.
LGTM
LGTM