Closed Bug 1750089 Opened 2 years ago Closed 2 years ago

avoid calling nsIX509Cert::GetCert()

Categories

(Core :: Security: PSM, task, P1)

task

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: keeler, Assigned: keeler)

References

(Blocks 1 open bug)

Details

(Whiteboard: [psm-assigned])

Attachments

(2 files)

After bug 1748341, calling nsIX509Cert::GetCert() may cause a CERTCertificate to be instantiated. If this can be avoided, it would be best in terms of performance and stability.

nsIX509Cert::GetCert() may cause a CERTCertificate to be instantiated. Doing so
can have performance and stability implications, so it's best to avoid it.
This patch avoids it where possible.

Depends on D135943

Pushed by dkeeler@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/40bd1975208d
remove weak certificate signature error console message r=necko-reviewers,kershaw
https://hg.mozilla.org/integration/autoland/rev/7ebb345a9293
remove some unnecessary uses of nsIX509Cert::GetCert() r=jschanck

Backed out for causing mochitest failures on browser_webconsole_certificate_messages.js.

Push with failures

Failure log

Backout link

[task 2022-01-19T00:38:12.726Z] 00:38:12     INFO - TEST-START | devtools/client/webconsole/test/browser/browser_webconsole_certificate_messages.js
[task 2022-01-19T00:39:42.757Z] 00:39:42     INFO - TEST-INFO | started process screentopng
[task 2022-01-19T00:39:42.972Z] 00:39:42     INFO - TEST-INFO | screentopng: exit 0
[task 2022-01-19T00:39:42.972Z] 00:39:42     INFO - Buffered messages logged at 00:38:12
[task 2022-01-19T00:39:42.974Z] 00:39:42     INFO - Entering test bound 
[task 2022-01-19T00:39:42.975Z] 00:39:42     INFO - Adding a new tab with URL: data:text/html;charset=utf8,<!DOCTYPE html>Web Console weak crypto warnings test
[task 2022-01-19T00:39:42.976Z] 00:39:42     INFO - Buffered messages logged at 00:38:13
[task 2022-01-19T00:39:42.976Z] 00:39:42     INFO - Tab added and finished loading
[task 2022-01-19T00:39:42.977Z] 00:39:42     INFO - Opening the toolbox
[task 2022-01-19T00:39:42.977Z] 00:39:42     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 511}]
[task 2022-01-19T00:39:42.980Z] 00:39:42     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 511}]
[task 2022-01-19T00:39:42.980Z] 00:39:42     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 62}]
[task 2022-01-19T00:39:42.980Z] 00:39:42     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 511}]
[task 2022-01-19T00:39:42.980Z] 00:39:42     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 511}]
[task 2022-01-19T00:39:42.980Z] 00:39:42     INFO - Console message: [JavaScript Error: "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”)." {file: "chrome" line: 62}]
[task 2022-01-19T00:39:42.980Z] 00:39:42     INFO - Toolbox opened and focused
[task 2022-01-19T00:39:42.980Z] 00:39:42     INFO - Test SHA1 warnings
[task 2022-01-19T00:39:42.981Z] 00:39:42     INFO - Navigating to "https://sha1ee.example.com/browser/devtools/client/webconsole/test/browser/test-certificate-messages.html"
[task 2022-01-19T00:39:42.986Z] 00:39:42     INFO - Waiting for page to be loaded…
[task 2022-01-19T00:39:42.986Z] 00:39:42     INFO - Buffered messages logged at 00:38:14
[task 2022-01-19T00:39:42.987Z] 00:39:42     INFO - → page loaded
[task 2022-01-19T00:39:42.988Z] 00:39:42     INFO - Wait for the toolbox to reload
[task 2022-01-19T00:39:42.988Z] 00:39:42     INFO - Waiting for toolbox commands to be reloaded…
[task 2022-01-19T00:39:42.989Z] 00:39:42     INFO - Waiting for target switch…
[task 2022-01-19T00:39:42.989Z] 00:39:42     INFO - Console message: [JavaScript Error: "[Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIFaviconService.replaceFaviconDataFromDataURL]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: resource:///modules/PlacesUIUtils.jsm :: loadFavicon :: line 215"  data: no]"]
[task 2022-01-19T00:39:42.989Z] 00:39:42     INFO - loadFavicon@resource:///modules/PlacesUIUtils.jsm:215:28
[task 2022-01-19T00:39:42.989Z] 00:39:42     INFO - loadFavicon@resource:///modules/PlacesUIUtils.jsm:421:27
[task 2022-01-19T00:39:42.989Z] 00:39:42     INFO - setIconFromLink@resource:///actors/LinkHandlerParent.jsm:149:23
[task 2022-01-19T00:39:42.990Z] 00:39:42     INFO - receiveMessage@resource:///actors/LinkHandlerParent.jsm:66:14
[task 2022-01-19T00:39:42.990Z] 00:39:42     INFO - JSActor query*load@resource:///modules/FaviconLoader.jsm:562:18
[task 2022-01-19T00:39:42.990Z] 00:39:42     INFO - loadIcons@resource:///modules/FaviconLoader.jsm:657:26
[task 2022-01-19T00:39:42.990Z] 00:39:42     INFO - onPageShow@resource:///modules/FaviconLoader.jsm:694:12
[task 2022-01-19T00:39:42.990Z] 00:39:42     INFO - onHeadParsed@resource:///actors/LinkHandlerChild.jsm:60:24
[task 2022-01-19T00:39:42.991Z] 00:39:42     INFO - handleEvent@resource:///actors/LinkHandlerChild.jsm:177:21
[task 2022-01-19T00:39:42.991Z] 00:39:42     INFO - 
[task 2022-01-19T00:39:42.992Z] 00:39:42     INFO - → switched-target emitted
[task 2022-01-19T00:39:42.992Z] 00:39:42     INFO - Waiting for 'dom-complete' resource…
[task 2022-01-19T00:39:42.993Z] 00:39:42     INFO - → 'dom-complete' resource emitted
[task 2022-01-19T00:39:42.993Z] 00:39:42     INFO - Wait for Responsive UI to reload
[task 2022-01-19T00:39:42.994Z] 00:39:42     INFO - Matched a message with text: "If you haven't seen ssl warnings yet, you won't", all messages received.
[task 2022-01-19T00:39:42.994Z] 00:39:42     INFO - Buffered messages finished
[task 2022-01-19T00:39:42.994Z] 00:39:42     INFO - TEST-UNEXPECTED-FAIL | devtools/client/webconsole/test/browser/browser_webconsole_certificate_messages.js | Test timed out - 
[task 2022-01-19T00:39:43.022Z] 00:39:43     INFO - Removing tab.
[task 2022-01-19T00:39:43.023Z] 00:39:43     INFO - Waiting for event: 'TabClose' on [object XULElement].
[task 2022-01-19T00:39:43.050Z] 00:39:43     INFO - Got event: 'TabClose' on [object XULElement].
[task 2022-01-19T00:39:43.075Z] 00:39:43     INFO - Tab removed and finished closing
[task 2022-01-19T00:39:43.089Z] 00:39:43     INFO - GECKO(1603) | JavaScript error: , line 0: NotFoundError: No such JSWindowActor 'DevToolsFrame'
[task 2022-01-19T00:39:43.105Z] 00:39:43     INFO - Console message: [JavaScript Error: "NotFoundError: No such JSWindowActor 'DevToolsFrame'"]
[task 2022-01-19T00:39:43.112Z] 00:39:43     INFO - TEST-PASS | devtools/client/webconsole/test/browser/browser_webconsole_certificate_messages.js | The main process DevToolsServer has no pending connection when the test ends - 
[task 2022-01-19T00:39:43.121Z] 00:39:43     INFO - GECKO(1603) | MEMORY STAT | vsize 20975612MB | residentFast 1680MB
[task 2022-01-19T00:39:43.123Z] 00:39:43     INFO - TEST-OK | devtools/client/webconsole/test/browser/browser_webconsole_certificate_messages.js | took 90397ms
[task 2022-01-19T00:39:43.180Z] 00:39:43     INFO - checking window state
[task 2022-01-19T00:39:43.231Z] 00:39:43     INFO - TEST-START | devtools/client/webconsole/test/browser/browser_webconsole_checkloaduri_errors.js
Flags: needinfo?(dkeeler)
Flags: needinfo?(dkeeler)
Pushed by dkeeler@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/61000c0f90d1
remove weak certificate signature error console message r=necko-reviewers,kershaw
https://hg.mozilla.org/integration/autoland/rev/f55f6e0e5ca5
remove some unnecessary uses of nsIX509Cert::GetCert() r=jschanck
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: