Skip to content

Commit baeb6de

Browse files
committed
Use a single flexible wildcard for WPA3-SAE passwords and password tokens.
1 parent 3d7cc62 commit baeb6de

File tree

7 files changed

+37
-18
lines changed

7 files changed

+37
-18
lines changed

doc/crypto/api.db/psa/crypto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ typedef struct psa_custom_key_parameters_t {
183183
#define PSA_ALG_TLS12_PSK_TO_MS(hash_alg) /* specification-defined value */
184184
#define PSA_ALG_TRUNCATED_MAC(mac_alg, mac_length) \
185185
/* specification-defined value */
186-
#define PSA_ALG_WPA3_SAE_ANY ((psa_algorithm_t)0x0a000800)
186+
#define PSA_ALG_WPA3_SAE_ANY ((psa_algorithm_t)0x0a0088ff)
187187
#define PSA_ALG_WPA3_SAE_FIXED(hash_alg) /* specification-defined value */
188188
#define PSA_ALG_WPA3_SAE_GDH(hash_alg) /* specification-defined value */
189189
#define PSA_ALG_WPA3_SAE_H2E(hash_alg) /* specification-defined value */

doc/crypto/api/keys/policy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The following algorithm policies are supported:
3737
* An algorithm built from `PSA_ALG_AT_LEAST_THIS_LENGTH_MAC()` permits any MAC algorithm from the same base class (for example, CMAC) which computes or verifies a MAC length greater than or equal to the length encoded in the wildcard algorithm.
3838
* An algorithm built from `PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG()` permits any AEAD algorithm from the same base class (for example, CCM) which computes or verifies a tag length greater than or equal to the length encoded in the wildcard algorithm.
3939
* The `PSA_ALG_CCM_STAR_ANY_TAG` wildcard algorithm permits the `PSA_ALG_CCM_STAR_NO_TAG` cipher algorithm, the `PSA_ALG_CCM` AEAD algorithm, and the :code:`PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, tag_length)` truncated-tag AEAD algorithm for ``tag_length`` equal to 4, 8 or 16.
40-
* The wildcard key policy :code:`PSA_ALG_WPA3_SAE_H2E(PSA_ALG_ANY_HASH)` permits a password key to be used with any WPA3-SAE cipher suite.
40+
* The wildcard key policy `PSA_ALG_WPA3_SAE_ANY` permits a password key or WPA3-SAE password token key to be used with any WPA3-SAE cipher suite.
4141

4242
When a key is used in a cryptographic operation, the application must supply the algorithm to use for the operation. This algorithm is checked against the key's permitted-algorithm policy.
4343

doc/crypto/api/keys/types.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,10 @@ See :secref:`wpa3-sae-passwords`.
988988

989989
To construct a WPA3-SAE password token, it must be output from key derivation operation using the `PSA_ALG_WPA3_SAE_H2E` algorithm.
990990

991+
.. note::
992+
993+
To use a password token key with both `PSA_ALG_WPA3_SAE_FIXED` and `PSA_ALG_WPA3_SAE_GDH` algorithms, create the key with the wildcard `PSA_ALG_WPA3_SAE_ANY` permitted algorithm.
994+
991995
.. subsection:: Compatible algorithms
992996

993997
.. hlist::
@@ -1036,6 +1040,10 @@ See :secref:`wpa3-sae-passwords`.
10361040

10371041
To construct a WPA3-SAE password token, it must be output from key derivation operation using the `PSA_ALG_WPA3_SAE_H2E` algorithm.
10381042

1043+
.. note::
1044+
1045+
To use a password token key with both `PSA_ALG_WPA3_SAE_FIXED` and `PSA_ALG_WPA3_SAE_GDH` algorithms, create the key with the wildcard `PSA_ALG_WPA3_SAE_ANY` permitted algorithm.
1046+
10391047
.. subsection:: Compatible algorithms
10401048

10411049
.. hlist::

doc/crypto/api/ops/key-derivation.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ Key-derivation algorithms
394394

395395
:secref:`wpa3-sae-keys` provides details of the derivation procedures.
396396

397-
The wildcard key policy :code:`PSA_ALG_WPA3_SAE_H2E(PSA_ALG_ANY_HASH)` permits a password key to be used with any WPA3-SAE cipher suite.
397+
.. note::
398+
399+
To use a single password key with `PSA_ALG_WPA3_SAE_H2E` for any WPA3-SAE cipher suite, create the key with the wildcard `PSA_ALG_WPA3_SAE_ANY` permitted algorithm.
398400

399401
.. macro:: PSA_ALG_PBKDF2_HMAC
400402
:definition: /* specification-defined value */

doc/crypto/api/ops/pake.rst

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,7 @@ For example, the following code creates a PAKE cipher suite for WPA3-SAE using h
21682168
WPA3-SAE password processing
21692169
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21702170

2171-
WPA3-SAE defines the following two methods for deriving the password element (PWE) from the password:
2171+
WPA3-SAE defines the following two methods for deriving the password element PWE from the password:
21722172

21732173
.. list-table::
21742174
:widths: 1 4
@@ -2193,20 +2193,23 @@ The hash-to-element method is recommended, as it is less vulnerable to timing-ba
21932193

21942194
WPA3-SAE password processing
21952195

2196+
For both methods, the password must be imported as a key of type `PSA_KEY_TYPE_PASSWORD`.
2197+
The password must be encoded as defined in `[IEEE-802.11]` §12.4.3.
2198+
2199+
.. note::
2200+
2201+
`[IEEE-802.11]` specifies that the same password is used for any configured WPA3-SAE cipher suites, and with any configured PWE-derivation methods.
2202+
The wildcard key policy `PSA_ALG_WPA3_SAE_ANY` permits a password key to be used for any valid derivation method, and with any valid WPA3-SAE cipher suite.
2203+
21962204
.. rubric:: Looping method
21972205

2198-
To use the looping method, import the password into a key of type `PSA_KEY_TYPE_PASSWORD`.
2199-
The password must be encoded as defined in `[IEEE-802.11]` §12.4.3.
2200-
Provide this key to the WPA3-SAE PAKE operation in the call to `psa_pake_setup()`.
2206+
Provide the password key directly to the WPA3-SAE PAKE operation in the call to `psa_pake_setup()`.
22012207

22022208
.. rubric:: Hash-to-element method
22032209

22042210
To use the hash-to-element method:
22052211

2206-
1. Import the password into a key of type `PSA_KEY_TYPE_PASSWORD`.
2207-
The password must be encoded as defined in `[IEEE-802.11]` §12.4.3.
2208-
2209-
#. A WPA3-SAE password token is derived from the WPA3-SAE password, using a key-derivation operation with the `PSA_ALG_WPA3_SAE_H2E()` algorithm.
2212+
1. A WPA3-SAE password token is derived from the WPA3-SAE password, using a key-derivation operation with the `PSA_ALG_WPA3_SAE_H2E()` algorithm.
22102213
The `PSA_ALG_WPA3_SAE_H2E()` algorithm is parameterized by the hash used in the required WPA3-SAE cipher suite.
22112214

22122215
The password token is output from the key-derivation operation as a key of type `PSA_KEY_TYPE_WPA3_SAE_ECC()` or `PSA_KEY_TYPE_WPA3_SAE_DH()`.
@@ -2216,7 +2219,9 @@ To use the hash-to-element method:
22162219

22172220
#. Pass the password token key to the WPA3-SAE PAKE operation in the call to `psa_pake_setup()`.
22182221

2219-
The wildcard key policy `PSA_ALG_WPA3_SAE_ANY` permits a password token key to be used with both the `PSA_ALG_WPA3_SAE_FIXED()` and `PSA_ALG_WPA3_SAE_GDH()` PAKE algorithms.
2222+
.. note::
2223+
2224+
The wildcard key policy `PSA_ALG_WPA3_SAE_ANY` permits a password token key to be used with both the `PSA_ALG_WPA3_SAE_FIXED()` and `PSA_ALG_WPA3_SAE_GDH()` PAKE algorithms.
22202225

22212226
The following steps demonstrate the derivation of a password token for use with the group-dependent-hash variant of WPA3-SAE.
22222227
The selected cipher suite in the example is IANA Group 20: ECC using secp384r1, hash function SHA-384.
@@ -2518,15 +2523,13 @@ WPA3-SAE algorithms
25182523
WPA3-SAE algorithms with a group-dependent size for the output key, are constructed using :code:`PSA_ALG_WPA3_SAE_GDH(hash_alg)`.
25192524

25202525
.. macro:: PSA_ALG_WPA3_SAE_ANY
2521-
:definition: ((psa_algorithm_t)0x0a000800)
2526+
:definition: ((psa_algorithm_t)0x0a0088ff)
25222527

25232528
.. summary::
2524-
A wildcard algorithm that permits a WPA3-SAE password token key to be used in hash-to-element and group-dependent-hash variants of the WPA3-SAE PAKE algorithm.
2529+
A wildcard algorithm for WPA3-SAE password keys and password token keys.
25252530

25262531
.. versionadded:: 1.4
25272532

2528-
If a WPA3-SAE password token key specifies `PSA_ALG_WPA3_SAE_ANY` as its permitted algorithm, then the key can be used with the `PSA_ALG_WPA3_SAE_FIXED()` and `PSA_ALG_WPA3_SAE_GDH()` PAKE algorithms.
2529-
2530-
.. todo::
2533+
If a password key (key type `PSA_KEY_TYPE_PASSWORD`) specifies `PSA_ALG_WPA3_SAE_ANY` as its permitted algorithm, then the key can be used for any WPA3-SAE cipher suite with the `PSA_ALG_WPA3_SAE_H2E` key-derivation algorithm, and with the `PSA_ALG_WPA3_SAE_FIXED` PAKE algorithm.
25312534

2532-
We could extend this wildcard key policy to also cover the cases for password keys being used in the PAKE and KDF algorithms for WPA3-SAE?
2535+
If a WPA3-SAE password token key specifies `PSA_ALG_WPA3_SAE_ANY` as its permitted algorithm, then the key can be used with both the `PSA_ALG_WPA3_SAE_FIXED()` and `PSA_ALG_WPA3_SAE_GDH()` PAKE algorithms.

doc/crypto/appendix/encodings.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,14 @@ The permitted values of HASH-TYPE (see :numref:`table-hash-type`) depend on the
440440
SPAKE2+ for Matter, ``0x06``, :code:`PSA_ALG_SPAKE2P_MATTER`, ``0x0A000609``
441441
WPA3-SAE, ``0x08``, :code:`PSA_ALG_WPA3_SAE_FIXED(hash)`, ``0x0A0008hh`` :sup:`a`
442442
WPA3-SAE (GDH), ``0x09``, :code:`PSA_ALG_WPA3_SAE_GDH(hash)`, ``0x0A0009hh`` :sup:`a`
443+
*WPA3-SAE wildcard* :sup:`b c`, ``0x88``, `PSA_ALG_WPA3_SAE_ANY`, ``0x0A0088FF``
443444

444445
a. ``hh`` is the HASH-TYPE for the hash algorithm, ``hash``, used to construct the key-derivation algorithm.
445446

447+
b. The wildcard algorithm `PSA_ALG_WPA3_SAE_ANY` permits a password key to be used for any WPA3-SAE cipher suite with the `PSA_ALG_WPA3_SAE_H2E` key-derivation algorithm, and with the `PSA_ALG_WPA3_SAE_FIXED` PAKE algorithm.
448+
449+
c. The wildcard algorithm `PSA_ALG_WPA3_SAE_ANY` permits a WPA3-SAE password token key to be used for both the `PSA_ALG_WPA3_SAE_FIXED` and `PSA_ALG_WPA3_SAE_GDH` PAKE algorithms.
450+
446451
.. _key-type-encoding:
447452

448453
Key type encoding

doc/crypto/appendix/history.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Changes to the API
2727
- Added the `PSA_ALG_WPA3_SAE_H2E()` KDF for generating a WPA3-SAE password token from a password.
2828
- Added WPA3-SAE PAKE algorithms, `PSA_ALG_WPA3_SAE_FIXED()` and `PSA_ALG_WPA3_SAE_GDH()`.
2929
- Added finite field Diffie-Hellman family `PSA_DH_FAMILY_RFC3526`, which provides cyclic groups used for WPA3-SAE.
30+
- Added wildcard key policy `PSA_ALG_WPA3_SAE_ANY` to permit password and password token keys to be used in any WPA3-SAE cipher suite.
3031

3132
See :secref:`pake-wpa3-sae`.
3233

0 commit comments

Comments
 (0)