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

PSA Key derivation does not allow key output if using key agreement for input secret step #3550

Closed
sbailey-arm opened this issue Aug 10, 2020 · 2 comments
Labels
bug component-crypto Crypto primitives and low-level interfaces

Comments

@sbailey-arm
Copy link

Description

  • Type: Bug
  • Priority: Minor

mbed TLS build:
Version: latest commit ID: 0ca6d38

Expected behavior
psa_key_derivation_output_key should be allowed if PSA_KEY_DERIVATION_INPUT_SECRET has been provided using psa_key_derivation_key_agreement.

Actual behavior
psa_key_derivation_output_key fails with PSA_ERROR_NOT_PERMITTED. can_output_key is only set if PSA_KEY_DERIVATION_INPUT_SECRET is provided with a key.

Steps to reproduce
Follow the steps for key derivation as specified in the PSA spec, using psa_key_derivation_key_agreement as the input for step PSA_KEY_DERIVATION_INPUT_SECRET (this was done using psa-crypo as part of this PR).

@gilles-peskine-arm
Copy link
Contributor

The documentation of the PSA_ERROR_NOT_PERMITTED case of psa_key_derivation_output_key is incomplete and inconsistent with the documentation of PSA_KEY_DERIVATION_INPUT_SECRET, which is correct. You can use it after a key agreement. This patch will be in version 1.0.1 of the PSA specification:

-        The `PSA_KEY_DERIVATION_INPUT_SECRET` input was not provided through a key.
+        The `PSA_KEY_DERIVATION_INPUT_SECRET` input was neither provided through a key nor the result of a key agreement.

@gilles-peskine-arm
Copy link
Contributor

This was fixed in #3743.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component-crypto Crypto primitives and low-level interfaces
Projects
None yet
Development

No branches or pull requests

3 participants