Page MenuHomePhabricator

[keyserver] Split blob encryption and upload into separate functions
ClosedPublic

Authored by tomek on Nov 21 2023, 5:55 AM.
Tags
None
Referenced Files
F3523104: D9940.id33580.diff
Mon, Dec 23, 8:23 AM
F3523103: D9940.id33577.diff
Mon, Dec 23, 8:23 AM
F3523102: D9940.id33549.diff
Mon, Dec 23, 8:23 AM
F3523101: D9940.id33456.diff
Mon, Dec 23, 8:23 AM
F3523089: D9940.id.diff
Mon, Dec 23, 8:22 AM
F3523075: D9940.diff
Mon, Dec 23, 8:19 AM
Unknown Object (File)
Sat, Dec 21, 1:35 AM
Unknown Object (File)
Tue, Dec 17, 5:28 PM
Subscribers

Details

Summary

A caller of the Blob API should be able to choose what needs to be uploaded, e.g. if the payload should be encrypted. This diff allows more flexibility while the old behavior isn't changed.

Depends on D9937

Test Plan

Flow.

Check if calling the new function has the same result as the old one (using some console logs, with the same initialization vectors).

Also tested if throwing exceptions while uploading produces the correct result.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested review of this revision.Nov 21 2023, 6:15 AM
keyserver/src/push/utils.js
391 ↗(On Diff #33456)

What if encryption step throws? I have an intuition that we should put it inside try{} catch{} statement.

keyserver/src/push/utils.js
391 ↗(On Diff #33456)

In the original code, it was outside the try-catch block, but I guess it won't hurt to put it inside.

Move encrypting inside try-catch block

This revision is now accepted and ready to land.Nov 23 2023, 6:51 AM