Commit Graph

36 Commits

Author SHA1 Message Date
lilia
b0ed2e5e4f Fix check for session equivalence
This check didn't work, which resulted in closing and then immediately
reopening the current session. Not that big a deal, since it merely
flips a flag off and back on again just before saving the session
record, but does result in spurious log statements.
2017-04-12 11:54:11 -07:00
lilia
b77842c30e Promote old session states 2017-03-27 19:17:33 -07:00
lilia
b01ac22eb9 Fix bad mac on repeated deliveries
`MessageCounterError` is the expected result of repeated deliveries.
Error handling in decryptWithSessionList should immediately return such
an error if it occurs. Previous to this change, a Bad MAC error to be
returned instead of a MessageCounterError, if the message in question
was encrypted for a closed session.
2017-03-27 17:01:56 -07:00
lilia
3c0d6dc24b Normalize whitespace 2017-03-05 20:36:26 -08:00
lilia
963a424451 Fix test for presence of registrationId 2017-02-20 18:08:15 -08:00
lilia
17fdde0091 Remove unused argument 2017-02-20 18:08:04 -08:00
lilia
538c7aecce Fix crashes when no preKey is present
Adds a test identical to the 'basic prekey v3' test with the addition of
`delete preKeyBundle.preKey` where appropriate.
2017-02-09 10:53:53 -08:00
lilia
8334fa5699 Double the max old ratchet list length
Attempt to mitigate Bad MAC errors due to repeated ciphertext from more
than 5 exchanges ago.
2016-11-16 21:29:39 +01:00
lilia
7bc356ac15 Rename variable 2016-11-16 15:57:59 +01:00
lilia
861fc80580 Open sessions must have registrationIds 2016-10-05 21:57:01 +09:00
lilia
8df967ab64 Debug logging on migration failures 2016-10-05 21:56:15 +09:00
lilia
34eeb93470 Better debug output when JSON encoding fails 2016-10-05 21:22:25 +09:00
lilia
5043fb5fb8 Add support for migrating old SessionRecords
Attempt to upgrade old SessionRecords based on their version.
You only need this if you must support existing data.
2016-09-19 20:26:02 -07:00
lilia
7b21a4bed4 Add version field to SessionRecord
The session state format changed. Make a note of it.
2016-09-19 20:24:32 -07:00
lilia
ddba403ef5 Move registrationId from session record to session state
This was mostly used internally by SessionRecord to flag the lack of an
open session, but that can be replaced with an actual check for an open
session.
2016-09-19 20:21:53 -07:00
lilia
ffd60c7d94 Remove duplicate identityKey from SessionRecord
This is redundant to the identity key store, and only used to check
internal consistency between sessions and the 'current' remote identity,
though there's no particular reason we can't keep sessions from previous
identity keys.
2016-09-19 20:21:53 -07:00
lilia
081b27daac Remove unused constant
Also tidy up a nearby scope leak.
2016-09-19 20:17:41 -07:00
lilia
8c5c6b6bb0 Add support for numeric fingerprints 2016-08-23 16:05:53 -07:00
lilia
dd4e8375cd Include remote registrationId in encryption result
The signal service requires this field to accompany outgoing ciphertexts.
With this change we can likely remove the correspinding getter from
SessionCipher.
2016-08-11 15:52:27 -07:00
lilia
fbc6554d6f Decrypt against previous sessions
In congruence with the java implementation, attempt to decrypt against
previous session states if decryption fails using the open session.
2016-08-01 12:40:23 -07:00
lilia
bea0c3b792 Don't disable ratcheting when closing a session
It is possible to receive a ratchet-step message for a closed session,
in which case we need these keys around to decrypt it.
2016-07-31 23:20:57 -07:00
lilia
a42fa1e6e1 Fix vim header comment 2016-07-31 23:20:57 -07:00
lilia
c17c1bfa9d Bump version 2016-06-30 12:40:14 -07:00
lilia
162bb9989a Add more debug logging 2016-06-30 12:39:02 -07:00
lilia
374d7115b9 Fix vim header comments 2016-06-30 12:37:44 -07:00
lilia
2977295f80 Increase number of sessions retained
For consistency with the java lib (SessionRecord.java#L18), retain 40
previous sessions states instead of 20.
2016-06-23 21:03:41 -07:00
lilia
312f784a23 Add more detail to log statement 2016-06-23 20:09:08 -07:00
lilia
3815665275 Bump version 2016-06-23 14:15:45 -07:00
lilia
5f890f42d6 Increase number of chains retained
For consistency with the java lib (SessionState.java#L221), retain 5
chains instead of 4.

// FREEBIE
2016-06-23 11:25:15 -07:00
lilia
7a62016387 Remove unused function
Not used since removal of padding operations in 312efe2.
2016-06-21 15:52:07 -07:00
Timothy Cyrus
15acd6ea00 Update README.md
Add code blocks and JavaScript syntax highlighting
2016-06-21 15:50:03 -07:00
lilia
34ea0f6c96 Remove duplicate verifyMAC function 2016-06-21 15:47:59 -07:00
lilia
8e97de2701 Add travis 2016-06-15 13:17:10 -07:00
lilia
352ad16c2c Bump version 2016-06-14 19:30:04 -07:00
lilia
312efe24a2 Remove padding/unpadding operations
These should be handled at the service/application level.
2016-06-14 19:28:55 -07:00
lilia
bfdf169ad2 Version 1.0.0 2016-06-14 17:36:31 -07:00