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", () => {
477
477
let encryptedKey : EncString ;
478
478
479
479
beforeEach ( ( ) => {
480
- encryptService . unwrapSymmetricKey . mockResolvedValue (
481
- new SymmetricCryptoKey ( new Uint8Array ( 32 ) ) ,
482
- ) ;
480
+ encryptService . decryptBytes . mockResolvedValue ( new Uint8Array ( 16 ) ) ;
483
481
encryptedKey = new EncString ( "Re-encrypted Send Key" ) ;
484
- encryptService . wrapSymmetricKey . mockResolvedValue ( encryptedKey ) ;
482
+ encryptService . encryptBytes . mockResolvedValue ( encryptedKey ) ;
485
483
} ) ;
486
484
487
485
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 {
292
292
) {
293
293
const requests = await Promise . all (
294
294
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 ) ;
297
298
return new SendWithIdRequest ( send ) ;
298
299
} ) ,
299
300
) ;
You can’t perform that action at this time.
0 commit comments