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
Unknown Object (File)
Sat, Dec 21, 1:35 AM
Unknown Object (File)
Tue, Dec 17, 5:28 PM
Unknown Object (File)
Tue, Dec 17, 9:03 AM
Unknown Object (File)
Sun, Dec 15, 2:37 AM
Unknown Object (File)
Wed, Dec 11, 5:01 PM
Unknown Object (File)
Wed, Dec 4, 10:48 AM
Unknown Object (File)
Wed, Dec 4, 8:28 AM
Unknown Object (File)
Sat, Nov 23, 1:50 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
Lint Not Applicable
Unit
Tests Not Applicable

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