mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 504387 - Cache keys after creating/PUTting them instead of after GETting. r=thunder
Set the record manager for CryptoMetas, PubKeys, PrivKeys after uploading keys.
This commit is contained in:
parent
fd0528fc6b
commit
baa48207f2
@ -297,6 +297,9 @@ SyncEngine.prototype = {
|
||||
meta.addUnwrappedKey(pubkey, symkey);
|
||||
let res = new Resource(meta.uri);
|
||||
res.put(meta.serialize());
|
||||
|
||||
// Cache the cryto meta that we just put on the server
|
||||
CryptoMetas.set(meta.uri, meta);
|
||||
}
|
||||
|
||||
// first sync special case: upload all items
|
||||
|
@ -712,7 +712,10 @@ WeaveSvc.prototype = {
|
||||
let keys = PubKeys.createKeypair(passphrase, PubKeys.defaultKeyUri,
|
||||
PrivKeys.defaultKeyUri);
|
||||
try {
|
||||
// Upload and cache the keypair
|
||||
PubKeys.uploadKeypair(keys);
|
||||
PubKeys.set(keys.pubkey.uri, keys.pubkey);
|
||||
PrivKeys.set(keys.privkey.uri, keys.privkey);
|
||||
return true;
|
||||
} catch (e) {
|
||||
this._setSyncFailure(KEYS_UPLOAD_FAIL);
|
||||
|
Loading…
Reference in New Issue
Block a user