mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-12 03:04:20 +00:00
926d3c929f
1) Modify SessionRecord to store a list of "previous" sessions in addition to the current active session. Previous sessions can be used for receiving messages, but not for sending messages. 2) When a possible "simultaneous initiate" is detected, push the current session onto the "previous session" stack instead of clearing it and starting over. 3) Additionally, mark the new session created on a received possible "simultaneous initiate" as stale for sending. The next outgoing message would trigger a full prekey refresh. 4) Work to do: outgoing messages on the SMS transport should probably not use the existing session if it's marked stale for sending. These messages need to fail and notify the user, similar to how we'll handle SMS fallback to push users before a prekey session is created.
70 lines
1.8 KiB
Protocol Buffer
70 lines
1.8 KiB
Protocol Buffer
package textsecure;
|
|
|
|
option java_package = "org.whispersystems.textsecure.storage";
|
|
option java_outer_classname = "StorageProtos";
|
|
|
|
message SessionStructure {
|
|
message Chain {
|
|
optional bytes senderEphemeral = 1;
|
|
optional bytes senderEphemeralPrivate = 2;
|
|
|
|
message ChainKey {
|
|
optional uint32 index = 1;
|
|
optional bytes key = 2;
|
|
}
|
|
|
|
optional ChainKey chainKey = 3;
|
|
|
|
message MessageKey {
|
|
optional uint32 index = 1;
|
|
optional bytes cipherKey = 2;
|
|
optional bytes macKey = 3;
|
|
}
|
|
|
|
repeated MessageKey messageKeys = 4;
|
|
}
|
|
|
|
message PendingKeyExchange {
|
|
optional uint32 sequence = 1;
|
|
optional bytes localBaseKey = 2;
|
|
optional bytes localBaseKeyPrivate = 3;
|
|
optional bytes localEphemeralKey = 4;
|
|
optional bytes localEphemeralKeyPrivate = 5;
|
|
optional bytes localIdentityKey = 7;
|
|
optional bytes localIdentityKeyPrivate = 8;
|
|
}
|
|
|
|
message PendingPreKey {
|
|
optional uint32 preKeyId = 1;
|
|
optional bytes baseKey = 2;
|
|
}
|
|
|
|
optional uint32 sessionVersion = 1;
|
|
optional bytes localIdentityPublic = 2;
|
|
optional bytes remoteIdentityPublic = 3;
|
|
|
|
optional bytes rootKey = 4;
|
|
optional uint32 previousCounter = 5;
|
|
|
|
optional Chain senderChain = 6;
|
|
repeated Chain receiverChains = 7;
|
|
|
|
optional PendingKeyExchange pendingKeyExchange = 8;
|
|
optional PendingPreKey pendingPreKey = 9;
|
|
|
|
optional uint32 remoteRegistrationId = 10;
|
|
optional uint32 localRegistrationId = 11;
|
|
|
|
optional bool needsRefresh = 12;
|
|
}
|
|
|
|
message RecordStructure {
|
|
optional SessionStructure currentSession = 1;
|
|
repeated SessionStructure previousSessions = 2;
|
|
}
|
|
|
|
message PreKeyRecordStructure {
|
|
optional uint32 id = 1;
|
|
optional bytes publicKey = 2;
|
|
optional bytes privateKey = 3;
|
|
} |