Introduce registration-time ID for detecting stale sessions.

1) At registration time, a client generates a random ID and
   transmits to the the server.

2) The server provides that registration ID to any client
   that requests a prekey.

3) Clients include that registration ID in any
   PreKeyWhisperMessage.

4) Clients include that registration ID in their sendMessage
   API call to the server.

5) The server verifies that the registration ID included in
   an API call is the same as the current registration ID
   for the destination device.  Otherwise, it notifies the
   sender that their session is stale.
This commit is contained in:
Moxie Marlinspike
2014-02-18 12:48:20 -08:00
parent abce678cb4
commit 3999171377
23 changed files with 435 additions and 100 deletions

View File

@@ -51,6 +51,9 @@ message SessionStructure {
optional PendingKeyExchange pendingKeyExchange = 8;
optional PendingPreKey pendingPreKey = 9;
optional uint32 remoteRegistrationId = 10;
optional uint32 localRegistrationId = 11;
}
message PreKeyRecordStructure {