certificates & ucentral-schema: restore insta operational certs across factory reset (WIFI-15683) - #1272
Open
abhivyas1992 wants to merge 3 commits into
Open
Conversation
Fixes WIFI-15579 Signed-off-by: Arif Alam <arif.alam@netexperience.com> Signed-off-by: Abhishek Vyas <abhishek.vyas@inventum.net>
On udaya,a5-id2 the EST-enrolled operational cert/CA are stored in the insta1/insta2 A/B partitions, but a factory reset left the AP without them. Three problems in the early-boot restore path, all fixed here: - mount_certs and store_certs shared a tar_part_lookup() that both read AND flipped the cert_part u-boot env, so the reader selected the opposite partition from where store_certs wrote. Make the reader map cert_part to the active partition without flipping. - mount_certs runs from early_boot at S09, before uboot-envtools generates /etc/fw_env.config (S95). A factory reset wipes that config, so fw_printenv returned empty and the wrong (empty) partition was picked. Generate the config first when it is missing. - early_boot skipped the restore whenever /etc/ucentral/key.pem existed. An app factory reset (keep_redirector) preserves the birth key.pem but not the operational cert, so mount_certs never ran. Return early only when fully provisioned (key.pem AND operational.pem present). Fixes: WIFI-15591 Signed-off-by: abhishek vyas <abhishek.vyas@inventum.net>
The uCentral app factory reset (cmd_factory.uc) and firmware upgrade (cmd_upgrade.uc) keep_redirector paths preserve the birth certs but not the operational cert/CA, so the AP loses its operational certificate. Add operational.pem and operational.ca to both keep lists via feed patches; the entries are archived only when present (existing fs.stat guard), so this is a no-op on devices without an operational cert. Complements the early_boot restore, which recovers the operational cert from the insta partition when only the birth key is kept. Fixes: WIFI-15591 Signed-off-by: abhishek vyas <abhishek.vyas@inventum.net>
abhivyas1992
requested review from
jaspreetsachdev,
tanyasingh-ec and
venkatchimata
August 26, 2026 09:53
Author
|
OLD PR 1172 migrated to new PR, so closing OLD PR 1172 |
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.
ucentral-schema: keep operational certs across factory reset and upgrade
The uCentral app factory reset (cmd_factory.uc) and firmware upgrade
(cmd_upgrade.uc) keep_redirector paths preserve the birth certs but not the
operational cert/CA, so the AP loses its operational certificate. Add
operational.pem and operational.ca to both keep lists via feed patches; the
entries are archived only when present (existing fs.stat guard), so this is a
no-op on devices without an operational cert.
Complements the early_boot restore, which recovers the operational cert from
the insta partition when only the birth key is kept.
certificates: restore insta operational certs across factory reset
On udaya,a5-id2 the EST-enrolled operational cert/CA are stored in the
insta1/insta2 A/B partitions, but a factory reset left the AP without them.
Three problems in the early-boot restore path, all fixed here:
flipped the cert_part u-boot env, so the reader selected the opposite
partition from where store_certs wrote. Make the reader map cert_part to
the active partition without flipping.
/etc/fw_env.config (S95). A factory reset wipes that config, so fw_printenv
returned empty and the wrong (empty) partition was picked. Generate the
config first when it is missing.
app factory reset (keep_redirector) preserves the birth key.pem but not the
operational cert, so mount_certs never ran. Return early only when fully
provisioned (key.pem AND operational.pem present).
Fixes: WIFI-15683
Signed-off-by: abhishek vyas abhishek.vyas@inventum.net
https://telecominfraproject.atlassian.net/browse/WIFI-15683