Skip to content

Fix incorrect identifiers in PAKE operation example code#372

Merged
athoelke merged 2 commits into
GlobalPlatform:mainfrom
krish2718:fix-pake-example-identifiers
Jul 15, 2026
Merged

Fix incorrect identifiers in PAKE operation example code#372
athoelke merged 2 commits into
GlobalPlatform:mainfrom
krish2718:fix-pake-example-identifiers

Conversation

@krish2718

Copy link
Copy Markdown
Contributor

Summary

The SPAKE2+ and WPA3-SAE operation examples in the PAKE chapter
(doc/crypto/api/ops/pake.rst) reference PAKE step macros that are not
defined anywhere in the specification, and the WPA3-SAE shared-key
extraction snippet operates on the wrong operation object. These are
copy/paste-style errors in the .. code-block:: xref example snippets;
they do not affect the normative text or the API.

Fixes

WPA3-SAE example

  • The send-confirm counter input step used PSA_PAKE_STEP_SEND_CONFIRM,
    which is undefined. The defined step is PSA_PAKE_STEP_CONFIRM_COUNT
    (0x07), whose documented format is exactly "the 2-byte little-endian
    send-confirm counter".
  • psa_pake_get_shared_key() operated on &spake2p_p (left over from the
    SPAKE2+ section) instead of the example's &wpa3_sae operation.

SPAKE2+ example

  • The Prover input step for the Verifier confirmation value used
    PSA_PAKE_STEP_KEY_CONFIRM, which is undefined. The defined step is
    PSA_PAKE_STEP_CONFIRM (0x04), consistent with every other
    confirmation step in the same example.

A "Clarifications and fixes" entry is added to the document change history.

Notes

  • Documentation only — no normative or API change.
  • Found while implementing WPA3-SAE against the 1.4 specification.
  • Two commits, split by protocol, so the SPAKE2+ correction can be taken
    or dropped independently of the WPA3-SAE one.
  • Both commits are DCO signed-off.

The WPA3-SAE operation example referenced a PAKE step macro that is not
defined, and extracted the shared key from the wrong operation object (a
copy-paste from the SPAKE2+ example).

*   The send-confirm counter input step used the undefined
    PSA_PAKE_STEP_SEND_CONFIRM; the defined step is
    PSA_PAKE_STEP_CONFIRM_COUNT.
*   psa_pake_get_shared_key() operated on &spake2p_p instead of the
    example's &wpa3_sae operation.

Signed-off-by: Chaitanya Tata <Chaitanya@dotstarsystems.com>
The SPAKE2+ operation example referenced a PAKE step macro that is not
defined: the Prover input step for the Verifier confirmation value used
the undefined PSA_PAKE_STEP_KEY_CONFIRM; the defined step is
PSA_PAKE_STEP_CONFIRM.

Signed-off-by: Chaitanya Tata <Chaitanya@dotstarsystems.com>
@krish2718 krish2718 requested a review from athoelke as a code owner July 12, 2026 20:33
@athoelke athoelke added bug Something is incorrect or inconsistent in the documentation Crypto API Issue or PR related to the Cryptography API labels Jul 13, 2026
@athoelke athoelke added this to the Crypto API 1.5.1 milestone Jul 15, 2026

@athoelke athoelke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for the contributed fixes - these are errors from cut-and-paste or API changes during development.

@athoelke athoelke self-assigned this Jul 15, 2026
@athoelke athoelke merged commit bc98dc5 into GlobalPlatform:main Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is incorrect or inconsistent in the documentation Crypto API Issue or PR related to the Cryptography API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants