Closed Bug 1580923 Opened 5 years ago Closed 5 years ago

Cannot View cert info during import

Categories

(Firefox :: Security, defect, P1)

71 Branch
defect

Tracking

()

VERIFIED FIXED
Firefox 71
Tracking Status
firefox70 --- disabled
firefox71 --- verified

People

(Reporter: kwilson, Assigned: carolina.jimenez.g)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Steps to reproduce in Nightly:

  1. Enter this URL: http://eca.hinet.net/download/HRCA_b64.crt
  2. Click on "View" button to examine cert - nothing happens.

When folks use such a URL to import a cert, they must be able to examine the cert to make sure it is what they are expecting before they trust it.

The problem is that here:

https://searchfox.org/mozilla-central/rev/878bbf3cb8897a208454df27535f3522ab482cf2/security/manager/pki/resources/content/pippki.js#34

The ownerGlobal is that of the import dialog, not the browser window. You can get the actual latest browser window like this: https://searchfox.org/mozilla-central/rev/878bbf3cb8897a208454df27535f3522ab482cf2/browser/base/content/utilityOverlay.js#1005

So this should be easy to fix.

Apparently we have no tests for this, so it would be nice to add a test (maybe add it to the test that we have for opening about:certificate from different sources).

Danielle, Carolina, do you think one of you would be able to take this?

Flags: needinfo?(danielleleb12)
Flags: needinfo?(carolina.jimenez.g)
Priority: -- → P1
Version: 70 Branch → 71 Branch

I can work on this! :)

Flags: needinfo?(carolina.jimenez.g)
Assignee: nobody → carolina.jimenez.g

Thanks!

Status: NEW → ASSIGNED
Flags: needinfo?(danielleleb12)
Keywords: checkin-needed

Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/098d87f4abbc
Fixes problem when opening a certificate from downloadcert.xul.r=johannh

Keywords: checkin-needed

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=098d87f4abbcba44b3c36ef7f2a5f204bc32523a&selectedJob=267994613&searchStr=OS%2CX%2C10.14%2Cdebug%2CMochitests%2Ctest-macosx1014-64%2Fdebug-mochitest-browser-chrome-e10s-8%2CM%28bc8%29

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=267994613&repo=autoland&lineNumber=24120

Backout link: https://hg.mozilla.org/integration/autoland/rev/68dba8038459a5130af3052f90a130e16116449e

[task 2019-09-23T17:12:45.132Z] 17:12:45 INFO - TEST-START | toolkit/components/certviewer/tests/browser/browser_openTabAndSendCertInfo.js
[task 2019-09-23T17:12:45.132Z] 17:12:45 INFO - GECKO(1934) | Chrome file doesn't exist: /Users/cltbld/tasks/task_1569257755/build/tests/mochitest/browser/toolkit/components/certviewer/tests/browser/head.js
[task 2019-09-23T17:12:45.133Z] 17:12:45 INFO - GECKO(1934) | ++DOCSHELL 0x11f3d1000 == 7 [pid = 1934] [id = {72d30348-5894-604e-8c54-0b55c8e624b4}]
[task 2019-09-23T17:12:45.133Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 13 (0x10d10f5c0) [pid = 1934] [serial = 14] [outer = 0x0]
[task 2019-09-23T17:12:45.133Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 14 (0x12b6da800) [pid = 1934] [serial = 15] [outer = 0x10d10f5c0]
[task 2019-09-23T17:12:45.138Z] 17:12:45 INFO - GECKO(1934) | [Parent 1934, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /builds/worker/workspace/build/src/dom/base/ThirdPartyUtil.cpp, line 416
[task 2019-09-23T17:12:45.183Z] 17:12:45 INFO - GECKO(1934) | [Parent 1934, Main Thread] WARNING: NS_ENSURE_TRUE(root) failed: file /builds/worker/workspace/build/src/layout/base/nsDocumentViewer.cpp, line 3168
[task 2019-09-23T17:12:45.247Z] 17:12:45 INFO - GECKO(1934) | --DOMWINDOW == 2 (0x1062b3800) [pid = 1938] [serial = 11] [outer = 0x0] [url = about:blank]
[task 2019-09-23T17:12:45.329Z] 17:12:45 INFO - GECKO(1934) | ++DOCSHELL 0x12a7cc000 == 8 [pid = 1934] [id = {959b3bad-6d3c-a242-b9ad-9ab074401701}]
[task 2019-09-23T17:12:45.329Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 15 (0x12cd647a0) [pid = 1934] [serial = 16] [outer = 0x0]
[task 2019-09-23T17:12:45.329Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 16 (0x10d15c800) [pid = 1934] [serial = 17] [outer = 0x12cd647a0]
[task 2019-09-23T17:12:45.340Z] 17:12:45 INFO - GECKO(1934) | --DOCSHELL 0x106243000 == 0 [pid = 1938] [id = {331021e0-b5b3-0f4e-bd91-8d8649f1ed4b}] [url = about:blank]
[task 2019-09-23T17:12:45.382Z] 17:12:45 INFO - GECKO(1934) | [Parent 1934, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /builds/worker/workspace/build/src/dom/base/ThirdPartyUtil.cpp, line 416
[task 2019-09-23T17:12:45.497Z] 17:12:45 INFO - GECKO(1934) | ++DOCSHELL 0x12c81a800 == 9 [pid = 1934] [id = {ec80319b-7818-a44f-8779-aa8a6c72c54a}]
[task 2019-09-23T17:12:45.497Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 17 (0x12c1bc3e0) [pid = 1934] [serial = 18] [outer = 0x0]
[task 2019-09-23T17:12:45.523Z] 17:12:45 INFO - GECKO(1934) | ++DOCSHELL 0x133a88800 == 10 [pid = 1934] [id = {df5f6c6e-d17c-254c-8cb6-0463dc3c7074}]
[task 2019-09-23T17:12:45.523Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 18 (0x12cd645c0) [pid = 1934] [serial = 19] [outer = 0x0]
[task 2019-09-23T17:12:45.565Z] 17:12:45 INFO - GECKO(1934) | [Parent 1934, Main Thread] WARNING: '!mWindow->GetCurrentInnerWindow()', file /builds/worker/workspace/build/src/dom/ipc/nsQueryActor.h, line 20
[task 2019-09-23T17:12:45.565Z] 17:12:45 INFO - GECKO(1934) | [Parent 1934, Main Thread] WARNING: '!mWindow->GetCurrentInnerWindow()', file /builds/worker/workspace/build/src/dom/ipc/nsQueryActor.h, line 20
[task 2019-09-23T17:12:45.668Z] 17:12:45 INFO - GECKO(1934) | ++DOCSHELL 0x106243800 == 1 [pid = 1938] [id = {cc6c8fae-5ac7-bc4c-a644-639a14ad719e}]
[task 2019-09-23T17:12:45.668Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 3 (0x11c23ed40) [pid = 1938] [serial = 15] [outer = 0x0]
[task 2019-09-23T17:12:45.668Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 4 (0x10452a800) [pid = 1938] [serial = 16] [outer = 0x11c23ed40]
[task 2019-09-23T17:12:45.732Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 19 (0x12f72f000) [pid = 1934] [serial = 20] [outer = 0x12c1bc3e0]
[task 2019-09-23T17:12:45.732Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 20 (0x12f72fc00) [pid = 1934] [serial = 21] [outer = 0x12cd645c0]
[task 2019-09-23T17:12:45.874Z] 17:12:45 INFO - GECKO(1934) | ++DOMWINDOW == 5 (0x106460c00) [pid = 1938] [serial = 17] [outer = 0x11c23ed40]
[task 2019-09-23T17:12:45.999Z] 17:12:45 INFO - GECKO(1934) | [Parent 1934, Main Thread] WARNING: Ignoring duplicate observer.: file /builds/worker/workspace/build/src/modules/libpref/Preferences.cpp, line 2696
[task 2019-09-23T17:12:45.999Z] 17:12:45 INFO - TEST-INFO | started process screencapture
[task 2019-09-23T17:12:46.202Z] 17:12:46 INFO - TEST-INFO | screencapture: exit 0
[task 2019-09-23T17:12:46.202Z] 17:12:46 INFO - Buffered messages logged at 17:12:45
[task 2019-09-23T17:12:46.202Z] 17:12:46 INFO - Entering test bound openFromPopUp
[task 2019-09-23T17:12:46.202Z] 17:12:46 INFO - Testing openFromPopUp
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Console message: OpenGL compositor Initialized Succesfully.
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Version: 2.1 INTEL-12.9.22
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Vendor: Intel Inc.
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Renderer: Intel Iris OpenGL Engine
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - FBO Texture Target: TEXTURE_2D
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Console message: OpenGL compositor Initialized Succesfully.
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Version: 2.1 INTEL-12.9.22
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Vendor: Intel Inc.
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Renderer: Intel Iris OpenGL Engine
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - FBO Texture Target: TEXTURE_2D
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Console message: OpenGL compositor Initialized Succesfully.
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Version: 2.1 INTEL-12.9.22
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Vendor: Intel Inc.
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Renderer: Intel Iris OpenGL Engine
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - FBO Texture Target: TEXTURE_2D
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Buffered messages finished
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - TEST-UNEXPECTED-FAIL | toolkit/components/certviewer/tests/browser/browser_openTabAndSendCertInfo.js | about:certificate was opened - false == true - JS frame :: chrome://mochitests/content/browser/toolkit/components/certviewer/tests/browser/browser_openTabAndSendCertInfo.js :: checkSpec :: line 25
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - Stack trace:
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - chrome://mochitests/content/browser/toolkit/components/certviewer/tests/browser/browser_openTabAndSendCertInfo.js:checkSpec:25
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - chrome://mochitests/content/browser/toolkit/components/certviewer/tests/browser/browser_openTabAndSendCertInfo.js:openFromPopUp:87
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1350
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1385
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1213
[task 2019-09-23T17:12:46.203Z] 17:12:46 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:805
[task 2019-09-23T17:12:46.213Z] 17:12:46 INFO - TEST-PASS | toolkit/components/certviewer/tests/browser/browser_openTabAndSendCertInfo.js | We received an base64 string - "null" == "null" -

Flags: needinfo?(carolina.jimenez.g)

Uhm, that's strange. I ran that test multiple times locally and I see sometimes it passes and sometimes it doesn't. I have no clue what should be going wrong here, Johann, do you have any insights on it? Thank you

Flags: needinfo?(carolina.jimenez.g) → needinfo?(jhofmann)

Hi Carolina, great question! I think what you're seeing here is an early "about:blank" load that can happen before the actual about:certificate page is laoded (for various complicated reasons). So about:blank loads and the waitForNewWindow function picks up on it because we told it to return on the first load in the new window. Luckily waitForNewWindow takes a "url" parameter that can be a string or a function which will check if the url that's loaded is the correct one and only return then.

I've made a small change to your test that looks like this:

https://hg.mozilla.org/try/rev/e3d1959914058f838b01f4902a0b1f08995dcabf

And pushed to try to see if that's successful:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=285d68034a23ef2295fa9687cbe60b56b2cb38ab

If that works you can just incorporate that change into your original patch and try to land again.

Thanks!

Flags: needinfo?(jhofmann)

Thanks a lot Johann!

Keywords: checkin-needed

Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/91bd65bd68a6
Fixes problem when opening a certificate from downloadcert.xul.r=johannh

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71

I've managed to reproduce this issue using Firefox 71.0a1 (20190912215412).
This is verified fixed using Firefox 71.0a1 (20191007215350) on the following OSes: Windows 10x64, Ubuntu 18.04x64 and macOS 10.13.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: