Skip to content

Write min PIN length RP IDs before the other setMinPINLength state - #806

Merged
kaczmarczyck merged 1 commit into
google:developfrom
17krishna8:fix/set-min-pin-length-rp-ids-first
Oct 19, 2026
Merged

kaczmarczyck merged 1 commit into
google:developfrom
17krishna8:fix/set-min-pin-length-rp-ids-first

Conversation

@17krishna8

Copy link
Copy Markdown
Contributor

The setMinPINLength subcommand persists the force-change flag and the new minimum PIN length before writing the RP ID list. That list is the only input of the subcommand that can still fail at storage time, for example when its serialized form exceeds the maximum value size of the persistent store.

In that case the platform gets an error, but the minimum PIN length was already updated and the PIN was already flagged for change, leaving the authenticator in a state that does not correspond to any completed command.

Write the RP IDs first, so a failing subcommand leaves the other state untouched. This mirrors the ordering fix that was applied to the large blob parameters in #797.

@google-cla

google-cla Bot commented Oct 16, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request reorders the operations in process_set_min_pin_length to write the RP IDs first, ensuring that if this potentially failing step fails, the minimum PIN length and force-change flag are not left in an updated state. A new unit test has been added to verify this behavior under failure conditions. I have no feedback to provide as the changes are correct and well-tested.

@kaczmarczyck kaczmarczyck self-assigned this Oct 16, 2026
The setMinPINLength subcommand persists the force-change flag and the
new minimum PIN length before writing the RP ID list. That list is
the only input of the command that can still fail at storage time,
for example when its serialized form exceeds the maximum value size
of the persistent store. In that case the platform gets an error,
but the minimum PIN length was already updated (and the PIN already
flagged for change), leaving the authenticator in a state that does
not match any completed command.

Write the RP IDs first, so a failing subcommand leaves the other
state untouched. This mirrors the ordering fix that was applied to
the large blob parameters.
@17krishna8
17krishna8 force-pushed the fix/set-min-pin-length-rp-ids-first branch from 264644e to e2d4aae Compare October 16, 2026 15:02
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.296% (+0.003%) from 97.293% — 17krishna8:fix/set-min-pin-length-rp-ids-first into google:develop

@kaczmarczyck
kaczmarczyck merged commit 7d8601e into google:develop Oct 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants