Commit Graph

16 Commits (f7581cf4ebee13edb51e6372e9903c5e8745d0e9)

Author SHA1 Message Date
Audric Ackermann f7581cf4eb
increase prettier maxWidth to 100 3 years ago
Audric Ackermann 5d21b21fb6
cleanup account_manager unused code 4 years ago
Scott Nonnenberg e4babdaef0 Updates to backup infrastructure 6 years ago
Scott Nonnenberg 47f834cf5c Encrypt device name on account create, on first launch if needed 6 years ago
Scott Nonnenberg dbf0be2db5 eslintify all test files 6 years ago
Scott Nonnenberg a7d78c0e9b Sealed Sender support
https://signal.org/blog/sealed-sender/
6 years ago
Daniel Gasienica 1dd87ad197 Format all source code using Prettier 6 years ago
Scott Nonnenberg cea42bde7d
Encryption support for backup and restore
Also moved to the _ prefix in backup.js for all private methods exported
for testing.
6 years ago
Matt Corallo 899d756469 Split tests between libtextsecure and main 10 years ago
Matt Corallo 2d41385369 Remove last \t in crypto_test.js 10 years ago
lilia db69bacff1 Do fewer string conversions in tests 10 years ago
lilia a1a528ccdd Finish abstracting native client
Firstly, don't initialize textsecure.nativclient unless the browser
supports it. The mimetype-check trick is hewn from nacl-common.js.

Secondly, nativeclient crypto functions will all automatically wait for
the module to load before sending messages, so we needn't register any
onload callbacks outside nativeclient.js. (Previously, if you wanted to
do crypto with native client, you would have to register a call back and
wait for the module to load.) Now that the native client crypto is
encapsulated behind a nice interface, it can handle all that
onload-callback jazz internally: if the module isn't loaded when you
call a nativeclient function, return a promise that waits for the load
callback, and eventually resolves with the result of the requested
command. This removes the need for textsecure.registerOnLoadCallback.

Finally, although native client has its quirks, it's significantly
faster than the alternative (emscripten compiled js), so this commit
also lets the crypto backend use native client opportunistically, if
it's available, falling back to js if not, which should make us
compatible with older versions of chrome and chromium.
10 years ago
lilia b4f4f87a7c Add emscripten-compiled curve25519 module
Build with `grunt compile && grunt concat:curve25519` after installing
emscripten.

Enable by either (a) not loading nativeclient.js or (b) setting
`textsecure.NATIVE_CLIENT = false` before loading nativeclient.js.
10 years ago
lilia df0e52a893 Split crypto_test into crypto, protocol and helpers tests 10 years ago
lilia 9f676af9bb Refactor crypto.js and native client interface
NB: this diff is best viewed with --ignore-whitespace

Distills crypto.js down to the hard cryptoey bones. It pulls from
webcrypto for aes and hmac, and from native client for curve25519 stuff
or potentially another object implementing the handful of needed
curve25519 functions.

Everything else formerly known as crypto, including session storage and
management, axolotl, etc.. is now protocol.js. The separation is not
quite perfect, but it's a big step.

nativeclient.js now enables talking to the native client module through
a high level interface as well as registering callbacks that will be
executed once the module is loaded. And it has tests!

Finally, this commit removes all references to the "testing_only"
object, preferring to run tests on textsecure.crypto instead.
10 years ago
lilia df0eaf622a Clean up test files
Moved all test code into /test. Renamed test.js to crypto_test.js.
(Let's try to keep test files topical.) Merged test_views.html and
test.html into a single test/index.html.

Todo: use Grunt to generate test/index.html from index.html and files
found in /test. Also, write more tests.
10 years ago