File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
libs/common/src/tools/send/services Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -477,11 +477,9 @@ describe("SendService", () => {
477477 let encryptedKey : EncString ;
478478
479479 beforeEach ( ( ) => {
480- encryptService . unwrapSymmetricKey . mockResolvedValue (
481- new SymmetricCryptoKey ( new Uint8Array ( 32 ) ) ,
482- ) ;
480+ encryptService . decryptBytes . mockResolvedValue ( new Uint8Array ( 16 ) ) ;
483481 encryptedKey = new EncString ( "Re-encrypted Send Key" ) ;
484- encryptService . wrapSymmetricKey . mockResolvedValue ( encryptedKey ) ;
482+ encryptService . encryptBytes . mockResolvedValue ( encryptedKey ) ;
485483 } ) ;
486484
487485 it ( "returns re-encrypted user sends" , async ( ) => {
Original file line number Diff line number Diff line change @@ -292,8 +292,9 @@ export class SendService implements InternalSendServiceAbstraction {
292292 ) {
293293 const requests = await Promise . all (
294294 sends . map ( async ( send ) => {
295- const sendKey = await this . encryptService . unwrapSymmetricKey ( send . key , originalUserKey ) ;
296- send . key = await this . encryptService . wrapSymmetricKey ( sendKey , rotateUserKey ) ;
295+ // Send key is not a key but a 16 byte seed used to derive the key
296+ const sendKey = await this . encryptService . decryptBytes ( send . key , originalUserKey ) ;
297+ send . key = await this . encryptService . encryptBytes ( sendKey , rotateUserKey ) ;
297298 return new SendWithIdRequest ( send ) ;
298299 } ) ,
299300 ) ;
You can’t perform that action at this time.
0 commit comments