mirror of
https://github.com/signalapp/libsignal.git
synced 2024-09-20 03:52:17 +02:00
Add the other protos
This commit is contained in:
parent
a318c444cb
commit
3b5bbb2a0b
11
build.rs
11
build.rs
@ -1,4 +1,11 @@
|
||||
fn main() {
|
||||
prost_build::compile_protos(&["src/signal/proto/transfer.proto"], &["src"]).unwrap();
|
||||
println!("cargo:rerun-if-changed=src/signal/proto/transfer.proto");
|
||||
let protos = [
|
||||
"src/signal/proto/fingerprint.proto",
|
||||
"src/signal/proto/storage.proto",
|
||||
"src/signal/proto/wire.proto",
|
||||
];
|
||||
prost_build::compile_protos(&protos, &["src"]).unwrap();
|
||||
for proto in &protos {
|
||||
println!("cargo:rerun-if-changed={}", proto);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ pub mod signal;
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::signal::proto::transfer::SignalMessage;
|
||||
use super::signal::proto::wire::SignalMessage;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
|
@ -1 +1,3 @@
|
||||
pub(crate) mod transfer;
|
||||
pub mod fingerprint;
|
||||
pub mod storage;
|
||||
pub mod wire;
|
||||
|
14
src/signal/proto/fingerprint.proto
Normal file
14
src/signal/proto/fingerprint.proto
Normal file
@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package signal.proto.fingerprint;
|
||||
|
||||
message LogicalFingerprint {
|
||||
bytes content = 1;
|
||||
// bytes identifier = 2;
|
||||
}
|
||||
|
||||
message CombinedFingerprints {
|
||||
uint32 version = 1;
|
||||
LogicalFingerprint localFingerprint = 2;
|
||||
LogicalFingerprint remoteFingerprint = 3;
|
||||
}
|
1
src/signal/proto/fingerprint.rs
Normal file
1
src/signal/proto/fingerprint.rs
Normal file
@ -0,0 +1 @@
|
||||
include!(concat!(env!("OUT_DIR"), "/signal.proto.fingerprint.rs"));
|
111
src/signal/proto/storage.proto
Normal file
111
src/signal/proto/storage.proto
Normal file
@ -0,0 +1,111 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package signal.proto.storage;
|
||||
|
||||
message SessionStructure {
|
||||
message Chain {
|
||||
bytes senderRatchetKey = 1;
|
||||
bytes senderRatchetKeyPrivate = 2;
|
||||
|
||||
message ChainKey {
|
||||
uint32 index = 1;
|
||||
bytes key = 2;
|
||||
}
|
||||
|
||||
ChainKey chainKey = 3;
|
||||
|
||||
message MessageKey {
|
||||
uint32 index = 1;
|
||||
bytes cipherKey = 2;
|
||||
bytes macKey = 3;
|
||||
bytes iv = 4;
|
||||
}
|
||||
|
||||
repeated MessageKey messageKeys = 4;
|
||||
}
|
||||
|
||||
message PendingKeyExchange {
|
||||
uint32 sequence = 1;
|
||||
bytes localBaseKey = 2;
|
||||
bytes localBaseKeyPrivate = 3;
|
||||
bytes localRatchetKey = 4;
|
||||
bytes localRatchetKeyPrivate = 5;
|
||||
bytes localIdentityKey = 7;
|
||||
bytes localIdentityKeyPrivate = 8;
|
||||
}
|
||||
|
||||
message PendingPreKey {
|
||||
uint32 preKeyId = 1;
|
||||
int32 signedPreKeyId = 3;
|
||||
bytes baseKey = 2;
|
||||
}
|
||||
|
||||
uint32 sessionVersion = 1;
|
||||
bytes localIdentityPublic = 2;
|
||||
bytes remoteIdentityPublic = 3;
|
||||
|
||||
bytes rootKey = 4;
|
||||
uint32 previousCounter = 5;
|
||||
|
||||
Chain senderChain = 6;
|
||||
repeated Chain receiverChains = 7;
|
||||
|
||||
PendingKeyExchange pendingKeyExchange = 8;
|
||||
PendingPreKey pendingPreKey = 9;
|
||||
|
||||
uint32 remoteRegistrationId = 10;
|
||||
uint32 localRegistrationId = 11;
|
||||
|
||||
bool needsRefresh = 12;
|
||||
bytes aliceBaseKey = 13;
|
||||
}
|
||||
|
||||
message RecordStructure {
|
||||
SessionStructure currentSession = 1;
|
||||
repeated SessionStructure previousSessions = 2;
|
||||
}
|
||||
|
||||
message PreKeyRecordStructure {
|
||||
uint32 id = 1;
|
||||
bytes publicKey = 2;
|
||||
bytes privateKey = 3;
|
||||
}
|
||||
|
||||
message SignedPreKeyRecordStructure {
|
||||
uint32 id = 1;
|
||||
bytes publicKey = 2;
|
||||
bytes privateKey = 3;
|
||||
bytes signature = 4;
|
||||
fixed64 timestamp = 5;
|
||||
}
|
||||
|
||||
message IdentityKeyPairStructure {
|
||||
bytes publicKey = 1;
|
||||
bytes privateKey = 2;
|
||||
}
|
||||
|
||||
message SenderKeyStateStructure {
|
||||
message SenderChainKey {
|
||||
uint32 iteration = 1;
|
||||
bytes seed = 2;
|
||||
}
|
||||
|
||||
message SenderMessageKey {
|
||||
uint32 iteration = 1;
|
||||
bytes seed = 2;
|
||||
}
|
||||
|
||||
message SenderSigningKey {
|
||||
bytes public = 1;
|
||||
bytes private = 2;
|
||||
}
|
||||
|
||||
uint32 senderKeyId = 1;
|
||||
SenderChainKey senderChainKey = 2;
|
||||
SenderSigningKey senderSigningKey = 3;
|
||||
repeated SenderMessageKey senderMessageKeys = 4;
|
||||
}
|
||||
|
||||
message SenderKeyRecordStructure {
|
||||
repeated SenderKeyStateStructure senderKeyStates = 1;
|
||||
}
|
1
src/signal/proto/storage.rs
Normal file
1
src/signal/proto/storage.rs
Normal file
@ -0,0 +1 @@
|
||||
include!(concat!(env!("OUT_DIR"), "/signal.proto.storage.rs"));
|
@ -1 +0,0 @@
|
||||
include!(concat!(env!("OUT_DIR"), "/signal.proto.transfer.rs"));
|
@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package signal.proto.transfer;
|
||||
package signal.proto.wire;
|
||||
|
||||
message SignalMessage {
|
||||
bytes ratchet_key = 1;
|
1
src/signal/proto/wire.rs
Normal file
1
src/signal/proto/wire.rs
Normal file
@ -0,0 +1 @@
|
||||
include!(concat!(env!("OUT_DIR"), "/signal.proto.wire.rs"));
|
Loading…
Reference in New Issue
Block a user