Repository navigation
fix(panel): a PIN below a stricter policy still identifies, and the too-short line says the minimum - #256
Merged
Conversation
Raising the PIN minimum marks every account holding a PIN to choose a new
one (markPinsBelowPolicy), so that an account whose PIN is now too short
identifies with it and goes to the change. The keypad refused that entry as
too short, against the new minimum, before Core 0 saw it, and the account
was out of the panel. Core 0 resolves any length from PIN_LEN_MIN.
PinKb::entryMinLen( ) is the shortest entry a screen takes: PIN_LEN_MIN to
prove a PIN, the policy's minimum to choose one. pinSubmit( ) and the row
of dots use it.
That refusal was also the one thing that held a PIN the web set below the
minimum to the policy: the web does not check it (finding 7 of
docs/analysis/PLANO_REVISAO_EXTERNA.md), and no tightening marks such a
PIN. So PinKb::changeAfterProof( ) sends a PIN that proves shorter than the
policy to the change, marked or not. A tap is a character, so the entry's
length is the PIN's.
An entry of 4 characters or more is now a real attempt, and a wrong one
counts on the account's ladder; one shorter than the policy used to cost
nothing. Narrowing the alphabet or lowering the length ceiling still
strands a PIN with a letter that left the cards, or longer than the
ceiling: the cards cannot offer the one, and Core 0 cannot resolve the
other in time. Manual chapters 8 and 30 say so.
Tests first, in the native suite (286 of 286, under ASan and UBSan too):
- test_identification_takes_a_pin_shorter_than_the_policy failed with
main's rule ("Expected 4 Was 5. identifying");
- test_a_pin_below_the_policy_is_changed_once_it_proves failed with the
mark alone ("shorter than the policy, unmarked").
On the rig, pico_w_test from the S1 dump. The policy went from 4/3/0 to
5/3/0 over pshort (PIN 1357) and plong (24680); the web then gave pweb
2468:
- main 8388f32: pshort and pweb got "PIN muito curto (mín. 4)" and no
SEC_PIN_OK, so they stayed out; plong identified and went to Novo PIN;
- this branch: all three identified and went to Novo PIN. pshort chose
13579 and got the menu, and from then on its new PIN opened the menu
directly.
Manual chapters 8 and 30 describe identification and the policy as they
are now; MANUAL.pt-BR.html regenerated. The READMEs count the two cases.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BniVDEDSHGQgcoqmCRn5um
"PIN too short (min 4)" said 4 under any policy: the number was written
into the line, in the firmware and in both packs. On the rig, with the
minimum at 5, Novo PIN answered three digits with "PIN muito curto
(mín. 4)".
The line carries "{n}" now, and display/CountInText.h puts the screen's
shortest entry there: the policy's minimum to choose a PIN, 4 to prove one.
Not printf on the line: a pack is uploaded, and a pack line is never a
format string, so a "%s" in it prints as "%s". A pack older than the marker
shows its line as it is.
check_lang_packs.py, which runs before every build, now refuses a pack line
that drops a marker the firmware's line has, or carries one it does not.
Tests first:
- test_count_in_text_puts_the_number_where_the_line_says, in the native
suite, failed while the helper copied the line ("Expected 'PIN too short
(min 5)' Was 'PIN too short (min {n})'"); 287 of 287 now;
- with "{n}" in the firmware's English, the gate failed on both packs
until their lines carried it.
On the rig, this branch with the new pt-BR pack uploaded: "PIN muito curto
(mín. 5)" (screenshot).
Manual chapter 8's table says N; MANUAL.pt-BR.html regenerated.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BniVDEDSHGQgcoqmCRn5um
All seven images built from this branch, on main 8388f32: - release, test and asserts: 'measured' and the .bin +152 B; - test_https and pico2_w_release: +160 B; - alpha and Air: unchanged, as neither has a panel PIN. Each budget that moves moves by its image's growth, which keeps its margin: release 1,021,012 -> 1,021,164, test 1,025,660 -> 1,025,812, test_https 1,030,492 -> 1,030,652, asserts 1,023,268 -> 1,023,420, pico2_w_release 997,128 -> 997,288. On release: drawPinDotsInto( ) +104 B, the marker filled in; the new pinEntryMinLen( ) +28 B; panelIdentify( ) +8 B. The OTA headroom table of docs/analysis/PLANO_STABLE.md section 3.1 follows: release 7,019 B, test 2,443 B (already under one sector, and warned), asserts 4,723 B, pico2_w_release 571,343 B against its slot. check_flash_budget.py passes on the seven builds, and --table passes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BniVDEDSHGQgcoqmCRn5um
The +152 B of this PR take pico_w_release from 1,020,940 to 1,021,092 used bytes of the 1,044,480 B slot: 97.75 % to 97.76 %, which rounds up. check_readme_numbers.py failed in CI on the three READMEs; it passed locally only because it ran before the flash record moved. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BniVDEDSHGQgcoqmCRn5um
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two defects of the panel's PIN, found while #255 was checked on the rig.
One commit per defect, then the flash record.
What changes
main8388f32{n}markercheck_lang_packs.py(before every build) failsPinKb::entryMinLen( )is the shortest entry a screen takes: 4 to prove a PIN, the policy's minimum to choose one.PinKb::changeAfterProof( )decides the forced change: the mark, or a PIN shorter than the policy.display/CountInText.hfills the marker. It never hands the pack line toprintf: packs are uploaded, so a%sin a line prints as%s.What gets worse: an entry of 4 characters or more is now a real attempt, so a wrong one counts on the account's ladder. One shorter than the policy used to cost nothing.
What stays: narrowing the alphabet or lowering the length ceiling still strands an old PIN with a letter that left the cards, or longer than the ceiling. The cards cannot offer the first, and Core 0 cannot resolve the second in time. Manual chapters 8 and 30 now say so, with the way out (a new PIN from the panel's Users, the web or the console).
Tests first
main's behaviour:test_identification_takes_a_pin_shorter_than_the_policy: "Expected 4 Was 5. identifying";test_a_pin_below_the_policy_is_changed_once_it_proves: "shorter than the policy, unmarked";test_count_in_text_puts_the_number_where_the_line_says: "Expected 'PIN too short (min 5)' Was 'PIN too short (min {n})'". It also covers a pack older than the marker, a%s%nin a line, and a short buffer.{n}in the firmware's English, it failed on both packs until their lines carried it.build_manual.py --checkpass.pico_w_test.On the rig
pico_w_testof each tree, from the S1 bench dump, restored and read back byte for byte before each image. The policy went from 4/3/0 to 5/3/0 overpshort(PIN 1357) andplong(24680). The web then gavepweb2468, unmarked.mainpshort, 1357pweb, 2468plong, 24680On this branch,
pshortchose 13579 and got the menu, and from then on its new PIN opened the menu directly. On the first try after the restart that loaded the pack,pshort's taps landed on the dashboard. That was the instrument, not the device; the second try is the one above. The rig is back in its arrival state (R30).Flash
mainThe signed release
.binhas 7,019 B left under the OTA ceiling.Docs
MANUAL.pt-BR.htmlis regenerated.check_readme_numbers.pybefore the flash record moved.tools/flash_budget.jsonand §3.1 ofPLANO_STABLE.mdcarry the record.🤖 Generated with Claude Code
https://claude.ai/code/session_01BniVDEDSHGQgcoqmCRn5um