diff --git a/lib/app/components/crypto/crypto.js b/lib/app/components/crypto/crypto.js index af7746f68..33d2c2d6c 100644 --- a/lib/app/components/crypto/crypto.js +++ b/lib/app/components/crypto/crypto.js @@ -33,12 +33,6 @@ export default class Env { res = await this.#storage.init(); if ( !res.ok ) return res; - // XXX - setTimeout( async () => { - const res = await this.changeMasterKey(); - console.log( "---", res ); - }, 5000 ); - return result( 200 ); } diff --git a/lib/app/components/crypto/crypto/storage.js b/lib/app/components/crypto/crypto/storage.js index 57cf8476b..a7160fdba 100644 --- a/lib/app/components/crypto/crypto/storage.js +++ b/lib/app/components/crypto/crypto/storage.js @@ -93,6 +93,11 @@ export default class CryptoStorage { masterKey = res.data; } + masterKey = { + "id": MASTER_KEY_ID, + "key": masterKey, + }; + res = await this._rewrapKeys( masterKey ); if ( !res.ok ) return res; @@ -100,7 +105,7 @@ export default class CryptoStorage { this.clear(); return result( 200, { - "masterKey": masterKey + "masterKey": masterKey.key .export( { "format": "buffer", } )