From a568ab96b3b567f1640fcb6ee5499e56b3fa3334 Mon Sep 17 00:00:00 2001 From: Dakota Brink Date: Fri, 18 Oct 2024 12:34:16 -0400 Subject: [PATCH 1/7] rename message history request -> device sync request --- proto/mls/message_contents/content.proto | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/proto/mls/message_contents/content.proto b/proto/mls/message_contents/content.proto index c074b03..59a1d88 100644 --- a/proto/mls/message_contents/content.proto +++ b/proto/mls/message_contents/content.proto @@ -61,10 +61,10 @@ message PlaintextEnvelope { oneof message_type { // Expected to be EncodedContent bytes content = 2; - // Initiator sends a request to receive message history - MessageHistoryRequest request = 3; - // Some other authorized installation sends a reply - MessageHistoryReply reply = 4; + // Initiator sends a request to receive sync payload + DeviceSyncRequest request = 3; + // Some other authorized installation sends a reply with a link to payload + DeviceSyncReply reply = 4; } } @@ -76,26 +76,26 @@ message PlaintextEnvelope { } } -// Initiator or new installation id requesting a history will send a request -message MessageHistoryRequest { +// Initiator or new installation id requesting a sync payload send a request +message DeviceSyncRequest { // Unique identifier for each request string request_id = 1; // Ensures a human is in the loop string pin_code = 2; } -// Pre-existing installation id capable of supplying a history sends this reply -message MessageHistoryReply { +// Pre-existing installation id capable of supplying a sync payload sends this reply +message DeviceSyncReply { // Must match an existing request_id from a message history request string request_id = 1; // Where the messages can be retrieved from string url = 2; // Generated input 'secret' for the AES Key used to encrypt the message-bundle - MessageHistoryKeyType encryption_key = 3; + DeviceSyncKeyType encryption_key = 3; } // Key used to encrypt the message-bundle -message MessageHistoryKeyType { +message DeviceSyncKeyType { oneof key { bytes chacha20_poly1305 = 1; } From cf0cb9dcd64ea95c9ea502de35245e290ddbf6c5 Mon Sep 17 00:00:00 2001 From: Dakota Brink Date: Mon, 21 Oct 2024 13:31:32 -0400 Subject: [PATCH 2/7] sync type --- proto/mls/message_contents/content.proto | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proto/mls/message_contents/content.proto b/proto/mls/message_contents/content.proto index 59a1d88..f9be7ba 100644 --- a/proto/mls/message_contents/content.proto +++ b/proto/mls/message_contents/content.proto @@ -82,6 +82,8 @@ message DeviceSyncRequest { string request_id = 1; // Ensures a human is in the loop string pin_code = 2; + // request type + DeviceSyncType type = 3; } // Pre-existing installation id capable of supplying a sync payload sends this reply @@ -100,3 +102,8 @@ message DeviceSyncKeyType { bytes chacha20_poly1305 = 1; } } + +enum DeviceSyncType { + MESSAGE_HISTORY = 0; + CONSENT = 1; +} From 88c8b88e09b8431aa9d7047d2950d2470e45ef38 Mon Sep 17 00:00:00 2001 From: Dakota Brink Date: Mon, 21 Oct 2024 13:39:05 -0400 Subject: [PATCH 3/7] type -> kind --- proto/mls/message_contents/content.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/mls/message_contents/content.proto b/proto/mls/message_contents/content.proto index f9be7ba..25d576a 100644 --- a/proto/mls/message_contents/content.proto +++ b/proto/mls/message_contents/content.proto @@ -82,8 +82,8 @@ message DeviceSyncRequest { string request_id = 1; // Ensures a human is in the loop string pin_code = 2; - // request type - DeviceSyncType type = 3; + // request kind + DeviceSyncKind kind = 3; } // Pre-existing installation id capable of supplying a sync payload sends this reply @@ -103,7 +103,7 @@ message DeviceSyncKeyType { } } -enum DeviceSyncType { +enum DeviceSyncKind { MESSAGE_HISTORY = 0; CONSENT = 1; } From b023ce7def4559e114914393c832ee22042dd0dd Mon Sep 17 00:00:00 2001 From: Dakota Brink Date: Thu, 24 Oct 2024 15:36:05 -0400 Subject: [PATCH 4/7] lint --- proto/mls/message_contents/content.proto | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proto/mls/message_contents/content.proto b/proto/mls/message_contents/content.proto index 25d576a..a6a5ed3 100644 --- a/proto/mls/message_contents/content.proto +++ b/proto/mls/message_contents/content.proto @@ -103,7 +103,9 @@ message DeviceSyncKeyType { } } +// The kind of device sync payload being sent enum DeviceSyncKind { - MESSAGE_HISTORY = 0; - CONSENT = 1; + DEVICE_SYNC_KIND_UNSPECIFIED = 0; + DEVICE_SYNC_KIND_MESSAGE_HISTORY = 1; + DEVICE_SYNC_KIND_CONSENT = 2; } From 63c34b958ab355a4c17bc3a567d071a6f83c99b8 Mon Sep 17 00:00:00 2001 From: Dakota Brink Date: Mon, 28 Oct 2024 09:14:56 -0400 Subject: [PATCH 5/7] add timestamp to reply --- proto/mls/message_contents/content.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proto/mls/message_contents/content.proto b/proto/mls/message_contents/content.proto index a6a5ed3..db85d13 100644 --- a/proto/mls/message_contents/content.proto +++ b/proto/mls/message_contents/content.proto @@ -94,6 +94,8 @@ message DeviceSyncReply { string url = 2; // Generated input 'secret' for the AES Key used to encrypt the message-bundle DeviceSyncKeyType encryption_key = 3; + // ns unix timestamp of when the reply was sent + uint64 timestamp_ns = 4; } // Key used to encrypt the message-bundle From 49e634e179ea730067f0962c4e286f2e90d24ebb Mon Sep 17 00:00:00 2001 From: Dakota Brink Date: Mon, 28 Oct 2024 09:33:15 -0400 Subject: [PATCH 6/7] add kind to device sync reply --- proto/mls/message_contents/content.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proto/mls/message_contents/content.proto b/proto/mls/message_contents/content.proto index db85d13..430f7aa 100644 --- a/proto/mls/message_contents/content.proto +++ b/proto/mls/message_contents/content.proto @@ -96,6 +96,8 @@ message DeviceSyncReply { DeviceSyncKeyType encryption_key = 3; // ns unix timestamp of when the reply was sent uint64 timestamp_ns = 4; + // request kind + DeviceSyncKind kind = 5; } // Key used to encrypt the message-bundle From 3a8421dc611452fa8045a31090c95ec4c1285463 Mon Sep 17 00:00:00 2001 From: Dakota Brink Date: Mon, 28 Oct 2024 15:04:14 -0400 Subject: [PATCH 7/7] update enc schema --- proto/mls/message_contents/content.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/mls/message_contents/content.proto b/proto/mls/message_contents/content.proto index 430f7aa..53dc925 100644 --- a/proto/mls/message_contents/content.proto +++ b/proto/mls/message_contents/content.proto @@ -103,7 +103,7 @@ message DeviceSyncReply { // Key used to encrypt the message-bundle message DeviceSyncKeyType { oneof key { - bytes chacha20_poly1305 = 1; + bytes aes_256_gcm = 1; } }