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)
Sun, May 5, 3:51 AM
Unknown Object (File)
Sun, May 5, 3:51 AM
Unknown Object (File)
Sun, May 5, 3:51 AM
Unknown Object (File)
Sun, May 5, 3:51 AM
Unknown Object (File)
Sun, May 5, 3:05 AM
Unknown Object (File)
Apr 5 2024, 3:22 AM
Unknown Object (File)
Apr 5 2024, 3:18 AM
Unknown Object (File)
Mar 7 2024, 2:20 AM
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