psa_key_derivation_input_bytes with LABEL or SALT #176

Closed
opened 2019-07-16 02:50:34 -05:00 by gowthamsiddarthd · 5 comments
gowthamsiddarthd commented 2019-07-16 02:50:34 -05:00 (Migrated from github.com)

Description

Version: psa-crypto-api-1.0-beta

API: psa_key_derivation_input_bytes with label/seed as step

Method:
Calling key derivation setup with alg such that PSA_ALG_IS_KEY_DERIVATION is true.
Then, calling psa_key_derivation_input_bytes with step as PSA_KEY_DERIVATION_INPUT_LABEL.
The return value is expected to be PSA_SUCCESS but the actual return value is PSA_ERROR_INVALID_ARGUMENT.
The same case with step as PSA_KEY_DERIVATION_INPUT_SEED

Issue request type

[ ] Question
[ ] Enhancement
[x] Bug
<!-- ************************************** WARNING ************************************** The ciarcom bot parses this header automatically. Any deviation from the template may cause the bot to automatically correct this header or may result in a warning message, requesting updates. Please ensure that nothing follows the Issue request type section, all issue details are within the Description section and no changes are made to the template format (as detailed below). ************************************************************************************* --> ### Description Version: psa-crypto-api-1.0-beta API: psa_key_derivation_input_bytes with label/seed as step Method: Calling key derivation setup with alg such that PSA_ALG_IS_KEY_DERIVATION is true. Then, calling psa_key_derivation_input_bytes with step as PSA_KEY_DERIVATION_INPUT_LABEL. The return value is expected to be PSA_SUCCESS but the actual return value is PSA_ERROR_INVALID_ARGUMENT. The same case with step as PSA_KEY_DERIVATION_INPUT_SEED <!-- Required Add detailed description of what you are reporting. Good example: https://os.mbed.com/docs/latest/reference/workflow.html Things to consider sharing: - What target does this relate to? - What toolchain (name + version) are you using? - What tools (name + version - is it mbed-cli, online compiler or IDE) are you using? - What is the SHA of Mbed OS (git log -n1 --oneline)? - Steps to reproduce. (Did you publish code or a test case that exhibits the problem?) --> ### Issue request type <!-- Required Please add only one X to one of the following types. Do not fill multiple types (split the issue otherwise.) Please note this is not a GitHub task list, indenting the boxes or changing the format to add a '.' or '*' in front of them would change the meaning incorrectly. The only changes to be made are to add a description text under the description heading and to add a 'x' to the correct box. --> [ ] Question [ ] Enhancement [x] Bug
gilles-peskine-arm commented 2019-07-16 03:30:37 -05:00 (Migrated from github.com)

The permitted input depend on the algorithm. What algorithm did you pass to psa_key_derivation_setup? Did it succeed? Which version did you use (there's no tag psa-crypto-api-1.0-beta)?

The permitted input depend on the algorithm. What algorithm did you pass to `psa_key_derivation_setup`? Did it succeed? Which version did you use (there's no tag `psa-crypto-api-1.0-beta`)?
ciarmcom commented 2019-07-16 07:23:11 -05:00 (Migrated from github.com)

Internal Jira reference: https://jira.arm.com/browse/IOTCRYPT-830

*Internal Jira reference: https://jira.arm.com/browse/IOTCRYPT-830*
gowthamsiddarthd commented 2019-07-17 20:52:57 -05:00 (Migrated from github.com)

@gilles-peskine-arm,

The spec version is psa-crypto-api-1.0-beta3

Below were the sequence of steps followed and the actual result

1. Psa_crypto_init()

2. Psa_key_derivation_setup() with
	a. operation = PSA_KEY_DERIVATION_OPERATION_INIT
	b. Alg = PSA_ALG_KEY_AGREEMENT(PSA_ALG_ECDH, PSA_ALG_HKDF(PSA_ALG_SHA_256)),
	c. The result is PSA_SUCCESS

3. Psa_key_derivation_input_bytes() with
	a. Operation
	b. Step = PSA_KEY_DERIVATION_INPUT_LABEL
	c. Data = "abcdefghijklmnop"
	d. Size = 16
	e. The result is PSA_ERROR_INVALID_ARGUMENT
@gilles-peskine-arm, The spec version is psa-crypto-api-1.0-beta3 Below were the sequence of steps followed and the actual result 1. Psa_crypto_init() 2. Psa_key_derivation_setup() with a. operation = PSA_KEY_DERIVATION_OPERATION_INIT b. Alg = PSA_ALG_KEY_AGREEMENT(PSA_ALG_ECDH, PSA_ALG_HKDF(PSA_ALG_SHA_256)), c. The result is PSA_SUCCESS 3. Psa_key_derivation_input_bytes() with a. Operation b. Step = PSA_KEY_DERIVATION_INPUT_LABEL c. Data = "abcdefghijklmnop" d. Size = 16 e. The result is PSA_ERROR_INVALID_ARGUMENT
Patater commented 2019-07-18 03:40:25 -05:00 (Migrated from github.com)

This is a question about the API. There may be a bug here, but we don't know yet.

This is a question about the API. There may be a bug here, but we don't know yet.
gilles-peskine-arm commented 2019-09-23 12:53:30 -05:00 (Migrated from github.com)

This is expected: HKDF does not take a LABEL or SEED input (it takes an optional SALT, then a SECRET, then an INFO).

This is expected: HKDF does not take a `LABEL` or `SEED` input (it takes an optional `SALT`, then a `SECRET`, then an `INFO`).
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-ARMmbed/mbed-crypto#176
No description provided.