Page MenuHomePhabricator

[web][native] Encrypt QR auth messages with AES
ClosedPublic

Authored by bartek on Mar 14 2024, 10:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 12, 9:44 AM
Unknown Object (File)
Thu, Apr 25, 8:38 AM
Unknown Object (File)
Thu, Apr 25, 8:37 AM
Unknown Object (File)
Thu, Apr 25, 7:23 AM
Unknown Object (File)
Apr 3 2024, 2:28 AM
Unknown Object (File)
Apr 3 2024, 2:27 AM
Unknown Object (File)
Apr 3 2024, 2:27 AM
Unknown Object (File)
Apr 1 2024, 3:29 PM
Subscribers

Details

Summary

Refactored functions for composing and parsing Tunnelbroker QR auth messages to use AES-256 encryption, instead of plaintext JSON stringify/parse.

This required separating them for web/native, due to platform-specific implementations of AES encryption. Also needed to implement some minor helpers for web that were already present on native.

Depends on D11331

Test Plan

Still able to perform QR code auth on both web and native. Added unit tests for helpers on web.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Mar 18 2024, 12:33 AM

Exciting!!

lib/components/qr-auth-handler.react.js
23–33 ↗(On Diff #38131)

Would be good to make all of these props read-only

kamil added inline comments.
native/qr-code/qr-code-utils.js
49 ↗(On Diff #38131)

shouldn't we reject here?

This revision is now accepted and ready to land.Mar 19 2024, 5:57 AM
native/qr-code/qr-code-utils.js
49 ↗(On Diff #38131)

I think not. We intentionally return null to ignore such messages. This simplifies backward compatibility when adding more message types in the future