3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications
aszlig 8fb49973ce
firefox: Add patch to fix AES GCM IV bit size
Regression introduced by bce5268a21.

The bit size of the initialisation vector for AES GCM has been
introduced in NSS version 3.52 in the CK_GCM_PARMS struct via the
ulIvBits field.

Unfortunately, Firefox 68.8.0 and 76.0 do not set this field and thus it
gets initialised to zero, which in turn causes IV generation to fail.

I found out about this because WebRTC stopped working after updating to
NSS 3.52 and so I started bisecting.

Since there wasn't an obvious error in Firefox hinting towards NSS but
instead just the video stream ended up as a "null" stream, I didn't
suspect the NSS update to be the culprit at first. So I verified a few
times and then also started bisecting the actual commit in NSS that
caused the issue.

This turned out to be the problematic change:

https://phabricator.services.mozilla.com/D63241

> One notable change was caused by an inconsistancy between the spec and
> the released headers in PKCS#11 v2.40. CK_GCM_PARAMS had an extra
> field in the header that was not in the spec. OASIS considers the
> header file to be normative, so PKCS#11 v3.0 resolved the issue in
> favor of the header file definition.

Since the test I've used[1] was a bit flaky, I still didn't believe the
result of the bisect to be accurate, but after running the test several
times leading same results I dug through the above change line by line
to get more clues.

It fortunately didn't take that long to stumble upon the ulIvBits change
(which is actually documented in the NSS 3.52 release notes[4], but I
managed to blatantly ignore it for some reason) and started checking the
Firefox source tree for changes regarding that field.

Initialisation of that new field has been introduced[2] in preparation
for the 76 release, but subsequently got reverted[3] prior to the
release, because Firefox 76 is expected to be shipped with NSS 3.51,
which didn't have the ulIvBits field.

The patch I'm adding here is just a reintroduction of that change,
because we're using NSS 3.52. Not initialising that field will break
WebRTC and WebCrypto, which I think the former seems to gain in
popularity these days ;-)

Tested the change against the mentioned VM test[1] and also by testing
manually using Jitsi Meet and Nextcloud Talk.

[1]: https://github.com/aszlig/avonc/tree/884315838b6f0ebb32b/tests/talk
[2]: https://hg.mozilla.org/mozilla-central/rev/3ed30e6b6de1
[3]: https://hg.mozilla.org/mozilla-central/rev/665137da70ee
[4]: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.52_release_notes

Signed-off-by: aszlig <aszlig@nix.build>
2020-05-13 02:23:12 +02:00
..
accessibility contrast: 0.0.2 -> 0.0.3 2020-04-19 13:09:15 -04:00
audio Merge pull request #86610 from prusnak/sooperlooper 2020-05-10 23:14:01 +02:00
backup treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
blockchains Merge pull request #85646 from nyanloutre/ledger_live_2_2_4 2020-05-11 20:14:24 -04:00
display-managers Merge pull request #84255 from prikhi/lightdm-mini-greeter-040 2020-04-14 08:38:23 -04:00
editors emacsPackages.emacspeak: Fix meta 2020-05-12 17:53:43 +01:00
gis saga: explicitly use opencv2 2020-05-05 10:32:14 +03:00
graphics Merge pull request #87282 from symphorien/krop-desktop-file 2020-05-12 23:30:28 +02:00
kde kdeApplications.kdegraphics-thumbnailers: Fix 404ing patch url 2020-05-12 17:35:10 +01:00
misc Merge pull request #86446 from gnidorah/cpu-x 2020-05-13 00:56:06 +02:00
networking firefox: Add patch to fix AES GCM IV bit size 2020-05-13 02:23:12 +02:00
office treewide: remove the-kenny from maintainers 2020-05-09 10:28:57 +01:00
qubes/qubes-core-vchan-xen
radio xlog: 2.0.17 -> 2.0.19 2020-05-11 01:36:12 +00:00
science Merge pull request #82634 from evils/kicad 2020-05-11 10:27:18 +01:00
search treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
system github username: kjuvi -> xiorcale 2020-05-09 09:08:18 +02:00
version-management Merge pull request #87587 from filalex77/gitui-0.2.2 2020-05-11 23:06:07 -05:00
video makemkv: 1.15.0 -> 1.15.1 2020-05-12 08:26:43 +02:00
virtualization Merge pull request #87314 from matthewbauer/bazel-flat 2020-05-11 15:27:48 -05:00
window-managers Merge pull request #87288 from AndersonTorres/tinywm-upload 2020-05-11 21:31:41 -03:00