Commit Graph

102 Commits

Author SHA1 Message Date
Richard Newman
901929364b Bug 610914: performance improvements for WeaveCrypto. 2010-12-06 11:52:30 -08:00
Richard Newman
f0b19a496e Bug 603489, 614489: simplified crypto. r=mconnor 2010-11-29 16:41:17 -08:00
Richard Newman
000b5df8db Bug 610749: add pure-JS PBKDF2 implementation. 2010-11-16 11:42:17 -08:00
Philipp von Weitershausen
dc0e75b6ad Bug 600995 - Use a record's "encryption" property only as a fallback, default to the engine's value. [r=mconnor] 2010-10-04 22:39:08 +02:00
Philipp von Weitershausen
981f479bc7 Bug 569968 - Migration requires client to remove absolute URLs in crypto records
Make WBORecord.uri, CryptoWrapper.encryption, PubKey.privateKeyUri, PrivKey.publicKeyUri as well as the CryptoMeta keyring keys relative URLs in the payload.  As a result, all records now *must* know their URI.

Bump storage version from 2 to 3 to trigger reupload of all data and exclude older clients.
2010-08-12 22:19:39 +02:00
Philipp von Weitershausen
c4e977df64 Bug 558963, part 2, UTF-8 encode passphrase and rewrap keys if needed, r=mconnor 2010-07-03 14:13:40 -04:00
Edward Lee
0cbfa6f197 Bug 570636 - Decide how to co-exist as a sync add-on and built-in sync [r=mconnor]
Map the modules directory to services-sync instead of weave and update imports.
2010-06-16 14:30:08 -07:00
Edward Lee
8fd0b69ca3 Bug 568518 - Unhelpful log messages [r=mconnor]
Remove "Server attack" from exceptions.
2010-05-27 11:04:30 -07:00
Edward Lee
6c104ff79a Bug 552134 - Ensure that keyring/symmetric key haven't been tampered with [r=mconnor]
Store a HMAC with the encrypted symmetric key instead of just the wrapped key and verify that the HMAC matches before unwrapping. Test that normal getting works and a tampered payload/HMAC fails but succeeds on restoring the correct HMAC.
2010-03-25 19:23:44 -07:00
Edward Lee
46632f7ac1 Bug 549638 - Ensure that encrypted payloads haven't been tampered with [r=mconnor r=dolske]
Generate a SHA256 HAMC hex string from the base64 ciphertext and base64 symmetric key. Generate a HMAC key from the symmetric key and cache them together when unwrapping. Refactor the Utils.sha1 to share the same digest code.

--HG--
extra : rebase_source : dae973c62317eb3b738306fc30ea19870555c7df
2010-03-16 16:31:56 -07:00
Edward Lee
7379a71033 Bug 547007 - Use a per-record IV instead of one for each symkey [r=mconnor]
Generate a random IV on every encrypt instead of taking it from the CryptoMeta. Don't bother generating a bulkIV per CryptoMeta.
2010-03-16 16:31:56 -07:00
Edward Lee
6e5b14f642 Bug 547048 - Only allow clients to issue delete records [r=mconnor]
Don't specially serialize/not encrypt delete records and store the deleted flag as part of the cleartext payload.
2010-03-16 16:31:56 -07:00
Edward Lee
e057d3a639 Bug 547049 - Verify that encrypted payloads correspond to the requested record [r=mconnor]
Write the record's id to both .data and .cleartext and check that they match when decrypting.
2010-03-16 16:31:56 -07:00
Edward Lee
eb92572129 Bug 549636 - Don't unnecessarily [wrap] cleartext for JSON.stringify [r=mconnor]
Remove the unnecessary indirection now that JSON.stringify can take strings.
2010-03-16 16:31:56 -07:00
Edward Lee
4b77738965 Bug 544069 - Move bookmark parentid into the encrypted payload [r=mconnor]
Tweak the get/setters to refer to the PlacesItem instead of WBORecord.
2010-03-16 16:31:56 -07:00
Edward Lee
cf3fc65766 Bug 551874 - Figure out if we can avoid getting into partial synced state [r=mconnor]
For not-mobile clients, sync everything by specifying Infinity to keep existing math/logic working. Don't add a limit ?query if it's Infinity.
2010-03-19 11:35:01 -07:00
Edward Lee
8c4c90a45d Bug 545764 - Convert constructor -> _init pattern to just use constructor
Inline various _init calls and do super's init with <Super>.call(this, args..). Add various get/set sugar to those missing e.g., meta.keyring. Also simplify crypto record creation by setting cleartext in the parent.

--HG--
extra : rebase_source : 6c9a9f210f8f46ac338adb84188538e7353c9673
2010-02-11 15:25:31 -08:00
Edward Lee
5a569bea45 Bug 536596 - Don't force garbage collections on every record processed
Remove the forceGC at the end of each onProgress from Collections and let normal actions trigger GC.
2010-01-06 09:57:05 -08:00
Edward Lee
54ac58d5e4 Remove unused prefs and imports. (Bug 524916)
--HG--
extra : rebase_source : 074e542f63ee840b61db7fe63a6c3540c13a31a5
2009-11-25 17:49:15 -08:00
Edward Lee
fb89ee1b60 Add limit as a param to Collection. Make requesting guids the default. 2009-09-10 14:18:31 -07:00
Edward Lee
a364a3c310 Merge weave to weave-partial-view. 2009-09-10 12:42:29 -07:00
Edward Lee
554e7266d1 Bug 515676 - Allow giving objects to PUT/POST without Filters to avoid stringify([parse(stringify(stringify(obj)))])
Get rid of Filters and automatically JSON.stringify PUT/POST data that aren't strings, so plain Records can be passed in to PUT and POST. This leverages toJSON of Records to provide an object that can be serialized. Fix up client record serialize/deserialize to still escape/unescape non-ASCII.
2009-09-10 11:05:13 -07:00
Edward Lee
e95c1122bc Switch to 0.5 server API for deleting multiple ids from a collection. 2009-08-31 18:30:44 -07:00
Edward Lee
f03e1375ea Bug 512637 - Use newlines instead of JSON collection for incremental parsing. r=thunder
Switch to newline mode when using a collection record handler, and look for newlines! Easy! Update test to provide newline-separated strings instead of JSON.
2009-08-26 18:09:41 -07:00
Edward Lee
e12767d926 Land weave-0.5-api on weave. r=thunder. 2009-08-26 18:03:52 -07:00
Edward Lee
f1ce6f3fb7 Remove old modified arg for collections. 2009-08-26 17:52:46 -07:00
Edward Lee
e082c52844 Save an exception/catch when failing to import a record. 2009-08-26 17:49:23 -07:00
Edward Lee
771c9805e7 Bug 511746 - Resource.foo shouldn't throw except in exceptional cases. r=thunder
Get rid of lastChannel and return a String object from _request with additional properties of status, succeeded, headers -- even if the response was handled by cache. Update engines to check for non-success and throw the failure. Update tests to use these additional properties instead of lastChannel, etc.
2009-08-26 15:32:46 -07:00
Edward Lee
e355170c90 Remove unused alias for wbo/identity. 2009-08-25 08:52:52 -07:00
Edward Lee
23814e9c87 Use the plain get/set for wbo.modified because it's not needed anymore and was causing JS strict warnings: reference undefined property. 2009-08-20 17:10:14 -07:00
Edward Lee
783223115f Get rid of depth and sort on index instead. 2009-08-15 00:56:27 -07:00
Edward Lee
0658441e64 Bug 506302 - Shorten stack traces
Trim the full path from JS stacks and just show the file and convert nsIException traces to look like js stacks: func()@file:line. Only difference is js stacks show arguments while nsIException always shows just (). Fix up some places where we print the exception instead of the fixed up string.
2009-07-24 15:28:42 -07:00
Edward Lee
ac355ae207 Bug 485573 - Fennec runs out of memory and crashes if too many history items to sync. r=thunder
Incrementally process records as the collection finds record boundaries and converts them to records for the engine to use. Get rid of the collection iterator and original RecordParser. Add tests for incremental record parsing and remove old iter tests.
2009-07-22 16:38:34 -07:00
Edward Lee
c1367f888b Bug 504212 - Have javascript stack traces show [object Object] for various CryptoWrapper functions
Also update createKeypair for keys to pass around the passphrase object and update the tests to pass around an object.
2009-07-14 19:04:32 -07:00
Edward Lee
21ad9fd3dc Bug 504212 - Have javascript stack traces show [object Object] for various CryptoWrapper functions
Pass the ID object instead of reading out the password and passing it in to encrypt/decrypt.
2009-07-14 16:51:04 -07:00
Edward Lee
4ac23d2cab Remove async.js and wrap.js and remove remaining references to Async.sugar, etc. 2009-06-06 18:24:30 -05:00
Edward Lee
559b28340d CryptoMeta_addKey: async + async/yield -> sync. (Unused?) 2009-06-06 18:24:23 -05:00
Edward Lee
5c9e893d99 merge weave 2009-06-05 11:03:19 -07:00
Dan Mills
cadd0295cb partially revert d6cac1e80da9 - use id from the body; add additional tests to catch more errors 2009-06-05 10:39:51 -07:00
Edward Lee
a242dd68b6 CollectionIterator_next: async + async/yield -> sync. 2009-06-05 00:38:23 -07:00
Edward Lee
8f9a249f1f CryptoWrapper_decrypt: async + async/yield -> sync. Fix up bookmark/client decrypt. 2009-06-04 19:06:57 -07:00
Edward Lee
e7babd76eb CryptoWrapper_encrypt: async + async/yield -> sync. 2009-06-04 17:58:37 -07:00
Edward Lee
9dec09e21c Bug 496455 - CryptoMeta__addUnwrappedKey always gets undefined new_pubkey
yield for PubKeys.get() when passed a string uri

--HG--
extra : rebase_source : d81bcbc7ba8fc45e83fb395dc93653f2749b3eed
2009-06-04 17:42:22 -07:00
Edward Lee
26e278509c CryptoMeta_addUnwrappedKey: async + async/yield -> sync. 2009-06-04 17:36:34 -07:00
Edward Lee
a8da9674ba CryptoMeta_getKey: async + async/yield -> sync. 2009-06-04 17:21:42 -07:00
Edward Lee
f928973409 Remove Async.sugar from keys.js. 2009-06-04 17:10:25 -07:00
Edward Lee
3fd601509a PubKeyManager_uploadKeypair: async + async/yield -> sync. 2009-06-04 17:09:32 -07:00
Edward Lee
18ddfe6cf0 PubKeyManager_getDefaultKey: async + async/yield -> sync. 2009-06-04 17:04:51 -07:00
Edward Lee
d30f38a715 Remove Async.sugar from wbo.js. 2009-06-04 16:52:28 -07:00
Edward Lee
de24904b92 RecordMgr_get: async + async/yield -> sync. 2009-06-04 16:50:57 -07:00