-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add definitions required by WPA3-SAE and WPA3-SAE-PT #230
base: main
Are you sure you want to change the base?
Add definitions required by WPA3-SAE and WPA3-SAE-PT #230
Conversation
Signed-off-by: Stephan Koch <[email protected]>
The 2024 update to 802.11 is now finalized (late September) - I presume that contains all of the required specification now? |
IEEE Std 802.11™-2024 was approved on September 26, 2024. Publication expected soon. |
Thank you for contributing these definitions. I would like to suggest some changes to the proposal:
Password-token KDF nameIn WPA3-SAE, the password token is computed using the hash-to-element procedure. My suggestion is to name the KDF after the procedure, rather than the result:
I presume the selection of the hash algorithm should follow the 802.11 specification, and match with the hash in the selected WPA3-SAE ciphersuite. Password token keysThere are two separate issues to address here:
We also need to qualify the key type identifiers by group type. My suggestion would be:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am starting to write this up for a draft PR against the specification, and a number of small details have emerged. Please see the the specific comments and questions.
* This key derivation algorithm uses the following inputs, which must be | ||
* provided in the following order: | ||
* - #PSA_KEY_DERIVATION_INPUT_SALT for the uuid. | ||
* - #PSA_KEY_DERIVATION_INPUT_SECRET for the password. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other KDFs, we typically use a SECRET input step for high-entropy secrets, and prefer to use a PASSWORD input step to indicate a low-entropy secret (such as a password). As the password for an SSID in WPA3 is typically a low entropy value, I would prefer to use PSA_KEY_DERIVATION_INPUT_PASSWORD
for this element.
* algorithm. | ||
* For WPA3-SAE selected by the AKM suites 24 and 25 (SAE using group-dependent | ||
* hash), use the PSA_ALG_WPA3_SAE_GDH() algorithm, parameterized by the | ||
* required hash algorithm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can/should we specify that if the selected hash does not match the one specified in §12.4.2 in the IEEE specification (SHA256 for generation of PWE by looping, following Table 12-1 for generation using hash-to-curve), the algorithm identifier will be rejected as invalid?
This might be detected during password-token generation (the hash in the H2E KDF dos not match the cyclic group specified in the output key type); or during PAKE protocol flow if the hash WPA3-SAE algorithm identifier does not match with the cyclic group specified in the PAKE primitive.
* | ||
* \code | ||
* psa_pake_setup(operation, password, cipher_suite); | ||
* psa_pake_set_user(operation, ...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably the user and peer identities for WPA3-SAE are the STA-A-MAC and STA-B-MAC values? Is the format of these evident? - or would a reference to the format of these values within 802.11 by valueable?
* \endcode | ||
* | ||
* If the Hash-To-Element variant is used and a list of rejected groups | ||
* is available, it must be provided as a salt: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format here is obviously the one defined in 802.11 for the salt in the key derivation schedule.
|
||
/** The WPA3-SAE commit step. | ||
* | ||
* The format for both input and output at this step is a 2 byte number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cyclic group is already selected for the PAKE by the cipher-suite used to set up the operation. If the PAKE protocol is initiated following receipt of an SAE Commit frame, the group will already have to be converted into a PAKE primitive and WPA3-SAE algorithm to set up the operation: so passing the group value in the STEP_COMMIT input or output does not seem to be valuable.
I would prefer to leave the conversion from AKN groups to and from PSA cipher suite values outside of the implementation.
/** The WPA3-SAE commit step. | ||
* | ||
* The format for both input and output at this step is a 2 byte number | ||
* specifying the group used followed by a scalar and an element of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make the commit-scalar and COMMIT_ELEMENT components of the commit frames separate outputs/inputs (as we do for the separate values in J-PAKE)?
Does concatenating them make it easier for the caller to assemble/disassemble the SAE Commit frames in 802.11?
* the same as the output of the hash algorithm specified. | ||
* | ||
* For WPA3_SAE algorithms, the format for both input and output at this step | ||
* is a 2 byte little-endian "send-confirm" counter followed by the output of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the prefix counter is redundant in the output, as the caller has just passed this as an input prior; it makes sense to keep this value symmetric for output and input, and it is required for input when verifying the peer's confirmation value using the peer's confirmation counter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questioning the value in explicitly specifying the hash parameter.
An implementation that only supports the standard can determine the correct hash function from the cyclic group and PWE-generation method.
* - optionally; #PSA_KEY_DERIVATION_INPUT_INFO for the password id. | ||
* The output has to be read as a key of type PSA_KEY_TYPE_WPA3_SAE_PT. | ||
* | ||
* \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to decide if we need to parameterize the KDF, and the WPA3-SAE algorithms with a hash function at all. I think for implementations that follow the 80.11 spec precisely we could drop the explicit parameterization:
-
The KDF implies the use of the hash-to-curve password token generation - and for this, the specification §12.4.2 is unambiguous about the mapping from cyclic group to hash function. So the hash function to use can be determined from the cyclic group specified in the output key type.
-
When setting up the PAKE operation, the cipher suite specifies the cyclic group, and the type of key (PASSWORD or WPA_SAE_XX_PT) determines the choice of looping vs H2E generation of the PWE.
- For looping, the hash function is fixed as SHA-256.
- For H2E, the hash function is specified in Table 12-1. In this case, the PAKE set up must also verify that the key type matches the primitive in the cyclic group.
If we keep the parameterization, then we would either:
- Require the implementation to verify that the hash matches the specification requirement. This is only valuable if we anticipate a future change in the standard to use other hash algorithms.
- OR, we permit non-standard hash algorithms to be used with the selected cyclic group/PWE-generation method.
In either of those approaches, it becomes an application problem to select and specify the correct hash algorithm for the KDF and the PAKE operations. In (1), an incorrect value will result in a runtime error, in (2) it will result in an invalid, and possibly vulnerable authentication protocol.
* It is instantiated with the following parameters: | ||
* | ||
* - The group is defined over a finite field or an elliptic curve. | ||
* - A cryptographic hash function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment against L44 regarding the need to explicitly specify the hash parameter?
The PSA Certified Crypto API v1.2 PAKE Extension requires some additional definitions to support WPA3-SAE and WPA3-SAE-PT as defined in IEEE standard specification P802.11-REVme/D7.0, Part 11, Aug 2024 to be embedded in, or included by, psa/crypto.h.
This PR provides a proposal.