-
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.
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.
Agreed. We already use PSA_KEY_DERIVATION_INPUT_PASSWORD
but the comment on PSA_ALG_WPA3_SAE_PT
was wrong.
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.
Thank you for confirming
* 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.
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?
Agreed.
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.
We think it should be during password-token generation.
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.
We think it should be during password-token generation
Yes. I think I meant to say that the verification should occur in both places, not a choice of one or the other.
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.
But this is only true if we keep the parameterization (see later comments)
* | ||
* \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?
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.
User and peer are 6 byte MAC addresses. But we have not found any reference to the format in the spec.
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.
§9.2.4.3.2 says a MAC address is represented as defined in 802 Clause 8, when present in MAC frame headers.
Presumably the STA-X-MAC octet-strings used in the SAE protocol would have this format.
* \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.
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.
Yes. Defined in 802.11 IEEE standard specification P802.11-REVme/D7.0, Part 11, Aug 2024 chapter 12.4.5.4, on page 3014.
|
||
/** 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.
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.
LGTM.
/** 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?
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.
We do not think it makes a big difference for the caller.
However, more STEP constants would be needed.
* 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.
Agreed.
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.
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.
This is no problem for the PAKE operation.
For the KDF there is a problem regarding an efficient implementation:
The ECC or DH family is needed to fix the hash size. The family is provided as part of the key type contained in the attributes argument of the psa_key_derivation_output_key()
function. This is the last call in a sequence of calls to KDF functions. This means the whole KDF calculations have to be delayed and executed in the psa_pake_output_key
function because the Hash (and MAC) to be used is not known before. All inputs at the other steps have to be buffered in the operation object which is very undesirable for an efficient implementation.
This is why we strongly suggest to keep the hash argument in the KDF 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.
Ok - a valid counter-argument - the HKDF-Extract phase could consume the other inputs as they are provided - as long as we know the Hash function from the start.
* 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?
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 above
We used the hash parameter for consistency with the |
My inclination at this point is to remove the explicit parameterization - because it provides no benefit to the caller of the API, but does incur cost to the caller in determining what the correct value should be. |
The effect of the incremental changes to WPA3-SAE (2016 -> 2020 -> 2024) is that there are notionally 3 distinct variants:
At the moment, the proposal defines one algorithm for (1) and (2), differentiating by the key type of the key that is passed in to set up the PAKE operation. And a second algorithm for (3), to separate it from (2). Would the API be clearer if we gave all three their own algorithm identifier instead? |
The 802.11-2024 specification suggests that for devices might support both looping and H2E methods for generating the PWE - and the method selected can vary between authentication instances. That means the password must be usable with both the A |
Spoke too soon - before you explained the benefit of knowing the Hash to start computing HKDF prior to knowing the cyclic group from the output key type. |
The hash is strictly required only in the KDF algorithm. However, we would prefer if the parameterization would be used in both, the KDF algorithm and the PAKE algorithm. |
We do not see an advantage in introducing another algorithm identifier. |
Agreed. Both wildcards are needed to allow to use stored passwords and PT keys in all cases. |
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.