While preparing to uplift our patch for #18912 (moved), I rebased it to mozilla-central but found one of the mochitests is failing. I then ran the test in the latest tor-browser.git branch (tor-browser-52.6.0esr-8.0-2) and saw the same test failure:
<div style="font-family: monospace; white-space: pre-wrap;">0 INFO TEST-START | Shutdown1 INFO Passed: 302 INFO Failed: 13 INFO Todo: 04 INFO Mode: non-e10s5 INFO SimpleTest FINISHEDThe following tests failed:56 INFO TEST-UNEXPECTED-FAIL | toolkit/mozapps/update/tests/chrome/test_0790_check_certPinning_noUpdate.xul | Checking update.errorCode == MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE - got 2153390067, expected 2153398272SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:271:5checkErrorCode@chrome://mochitests/content/chrome/toolkit/mozapps/update/tests/chrome/test_0790_check_certPinning_noUpdate.xul:61:3defaultCallback@chrome://mochitests/content/chrome/toolkit/mozapps/update/tests/chrome/utils.js:429:5</div>
Somehow we're not getting the desired error code.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
After poking around for a while with a 8.0a1-ish build of Tor Browser, Kathy and I learned that the test is failing due to #18087 (moved). When we run the test using the command below it works (i.e., the expected error code is generated):
Arthur, when you ran the test on mozilla-central was security.nocertdb set to false? I am not sure if the build you are using has the Tor Browser default prefs or not.
I ran some tests with your patch rebased on top of mozilla-central (https://github.com/arthuredelstein/tor-browser/1436226+2). First I ran ./mach run and in the browser console I entered Services.prefs.prefHasUserValue("security.nocertdb") and got false.
TEST-UNEXPECTED-FAIL | toolkit/mozapps/update/tests/chrome/test_0790_check_certPinning_noUpdate.xul | Checking update.errorCode == MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE. If removing or changing this test, please notify tbb-dev@lists.torproject.org - got 2153390067, expected 2153398272SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:312:5checkErrorCode@chrome://mochitests/content/chrome/toolkit/mozapps/update/tests/chrome/test_0790_check_certPinning_noUpdate.xul:61:3
In sum, I think my build does not have Tor Browser pref settings, by default it should be operating equivalent to the pref being set to false. So when security.nocertdb is default or false, I get the unexpected error code of 2153394164 and when security.nocertdb is set to true, I get the unexpected error code of 2153390067. Both error values are different from the expected error code 2153398272.
Next I'm going to try these same set of experiments on tor-browser.git.
So to analyze: my observation in the description tor-browser-52.6.0esr-8.0-2 was irrelevant because I had left security.nocertdb=true (Both branches give the same unexpected error code of 2153390067, but that's not very relevant.). If we look at security.nocertdb=false only, then I see that the test passes for tor-browser-52.6.0esr-8.0-2 but it fails on top of mozilla-central with a different unexpected error code of 2153394164.
So my question is, does it matter that we're getting a different error code? I am wondering whether any error code will do, or if we need MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE specifically. (I'm probably still naive about the design of the test.)
I haven't figured out what this new error code, 2153394164 is intended to mean. I guess the next step for me might be to try to use gdb to track down where the old and new error codes are coming from.
So my question is, does it matter that we're getting a different error code? I am wondering whether any error code will do, or if we need MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE specifically. (I'm probably still naive about the design of the test.)
It probably does not matter too much, although it is designed to look specifically for a pinning failure. Let me think about what to do.
I haven't figured out what this new error code, 2153394164 is intended to mean. I guess the next step for me might be to try to use gdb to track down where the old and new error codes are coming from.
Yes, although I don't know how much work that will be. Let me know if you want me to make an attempt (although I won't get to it until next week at this point). The new error code is 0x805A2FF4 which is SSL_ERROR_BAD_CERT_DOMAIN so it isn't too far off in terms of the expected error. But I think we should dive deep enough to understand what is happening.
After some time in the debugger comparing execution path of Tor Browser vs. a mozilla-central build, I found the problem: to get the correct error code we need to enable strict enforcement for pinning. I will attach a patch for the test which works for me.
Fine with me. To save a round trip I just pushed the patch to tor-browser-52.7.3esr-8.0-1 (commit 292456846d8420e88b19664e36562cb4d6169776) and tor-browser-52.7.3esr-7.5-1 (commit 8592446c194092c93c854611fc7dadd1fd3f3917) mentioning that mcs and brade wrote it. Thanks!
Trac: Status: needs_review to closed Resolution: N/Ato fixed