Closed Bug 2082516 Opened 1 month ago Closed 14 days ago

Wire certificate data into the sub-page

Categories

(Firefox for Android :: Settings, task)

All
Android
task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: lmccracken, Assigned: lmccracken)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][android-activation-trust])

Attachments

(2 external files)

Summary
Plumb certificate details from the session into the Trust Panel certificate sub-page

Description
The certificate details sub-page needs real data. Today the Trust Panel knows whether a connection is secure, but it may not expose the certificate’s subject and issuer fields in a form the UI can use. This ticket covers getting the certificate information for the current tab from the engine layer into the UI state.

The data needed is:

Subject fields: organization (O), locality (L), country (C), and common name (CN) as a possible fallback
Issuer fields: organization (O) and common name (CN)
Whether the connection is secure and whether a certificate is present at all (needed for the edge-states tickets)

This ticket should investigate what the engine already exposes (for example, certificate information on the session or security info object in GeckoView or Android Components) and use it where possible. If the required fields are not exposed, the ticket should either add them or split the engine-side work into a separate bug, so it can be reviewed by the right people.

The output should be a simple, testable state model (for example, a data class holding nullable fields) that the UI observes, and that updates correctly when the user navigates or switches tabs.

In scope

Investigating what certificate data is already exposed to Android
Reading subject and issuer fields for the current tab’s certificate
A UI state model with nullable fields, so missing data is represented explicitly
Updating state on navigation, reload, tab switch and security state change
Clearing state when there is no certificate (for example, HTTP pages or internal pages)
Handing the state to tickets 1 to 3 (via store, view model or equivalent, following the existing architecture)
Unit tests for the mapping and state updates

Out of scope

Rendering the data
The QWAC signal
Pref gating
Edge-state UI and behaviour
Focus
Parsing or validating certificates beyond reading the fields already available

Acceptance criteria

The sub-page receives subject (O, L, C, and CN if needed) and issuer (O and CN) values for the current tab’s certificate.
Absent fields are represented as null or empty, not as placeholder strings or crashes.
State updates when the user navigates, reloads or switches tabs, and does not show a previous tab’s certificate.
State is cleared or marked absent for pages with no certificate.
Private browsing tabs behave the same as normal tabs, with no certificate data persisted beyond the session.
The state model is documented, with clear nullability, so downstream tickets can rely on it.
Unit tests cover: all fields present, some missing, no certificate, tab switch, and navigation from HTTPS to HTTP.
If engine-side changes were needed, a linked bug exists for them.

Whiteboard: [fxdroid][android-activation-trust]
Assignee: nobody → lmccracken
Status: NEW → ASSIGNED

Adds the certificate subject and issuer fields to the Trust Panel state and keeps
the security info up to date while the panel is open. The panel is dismissed when
its tab navigates to a different host, since the rest of its state describes the
previous host, and a stale QWAC is cleared when the certificate changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Exposes the subject and issuer fields of the website's certificate so the
certificate details sub-page can display them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Attachment #9672970 - Attachment description: Bug 2082516 - Expose certificate details to the Trust Panel. r?#android-reviewers! → Bug 2082516 - Keep the Trust Panel security info up to date while open. r?#android-reviewers!
Pushed by lmccracken@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/09a764fa691d https://hg.mozilla.org/integration/autoland/rev/bcb9a12bf522 Add a certificate details model to the Trust Panel state. r=android-reviewers,twhite
Pushed by lmccracken@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b1176f2b0be7 https://hg.mozilla.org/integration/autoland/rev/8043e9ba2524 Keep the Trust Panel security info up to date while open. r=android-reviewers,twhite
Status: ASSIGNED → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: