Page MenuHomePhabricator

D7671.diff
No OneTemporary

D7671.diff

diff --git a/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs b/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs
--- a/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs
+++ b/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs
@@ -32,7 +32,7 @@
payload_signature: signed_identity_keys_blob.signature,
social_proof: None,
}),
- identity_upload: Some(identity_client::PreKey {
+ content_upload: Some(identity_client::PreKey {
pre_key: String::new(),
pre_key_signature: String::new(),
}),
@@ -40,7 +40,7 @@
pre_key: String::new(),
pre_key_signature: String::new(),
}),
- onetime_identity_prekeys: Vec::new(),
+ onetime_content_prekeys: Vec::new(),
onetime_notif_prekeys: Vec::new(),
};
let registration_start_request = Request::new(RegistrationStartRequest {
diff --git a/services/identity/src/client_service.rs b/services/identity/src/client_service.rs
--- a/services/identity/src/client_service.rs
+++ b/services/identity/src/client_service.rs
@@ -66,9 +66,9 @@
pub device_id_key: String,
pub key_payload: String,
pub key_payload_signature: String,
- pub identity_prekey: String,
- pub identity_prekey_signature: String,
- pub identity_onetime_keys: Vec<String>,
+ pub content_prekey: String,
+ pub content_prekey_signature: String,
+ pub content_onetime_keys: Vec<String>,
pub notif_prekey: String,
pub notif_prekey_signature: String,
pub notif_onetime_keys: Vec<String>,
@@ -112,17 +112,17 @@
payload_signature,
social_proof: _social_proof,
}),
- identity_upload:
+ content_upload:
Some(client_proto::PreKey {
- pre_key: identity_prekey,
- pre_key_signature: identity_prekey_signature,
+ pre_key: content_prekey,
+ pre_key_signature: content_prekey_signature,
}),
notif_upload:
Some(client_proto::PreKey {
pre_key: notif_prekey,
pre_key_signature: notif_prekey_signature,
}),
- onetime_identity_prekeys,
+ onetime_content_prekeys,
onetime_notif_prekeys,
}),
} = message
@@ -139,9 +139,9 @@
device_id_key: key_info.primary_identity_public_keys.ed25519,
key_payload: payload,
key_payload_signature: payload_signature,
- identity_prekey,
- identity_prekey_signature,
- identity_onetime_keys: onetime_identity_prekeys,
+ content_prekey,
+ content_prekey_signature,
+ content_onetime_keys: onetime_content_prekeys,
notif_prekey,
notif_prekey_signature,
notif_onetime_keys: onetime_notif_prekeys,
@@ -319,17 +319,17 @@
payload_signature,
social_proof: _social_proof,
}),
- identity_upload:
+ content_upload:
Some(client_proto::PreKey {
- pre_key: identity_prekey,
- pre_key_signature: identity_prekey_signature,
+ pre_key: content_prekey,
+ pre_key_signature: content_prekey_signature,
}),
notif_upload:
Some(client_proto::PreKey {
pre_key: notif_prekey,
pre_key_signature: notif_prekey_signature,
}),
- onetime_identity_prekeys,
+ onetime_content_prekeys,
onetime_notif_prekeys,
}),
} = message
@@ -353,9 +353,9 @@
device_id_key: key_info.primary_identity_public_keys.ed25519,
key_payload: payload,
key_payload_signature: payload_signature,
- identity_prekey,
- identity_prekey_signature,
- identity_onetime_keys: onetime_identity_prekeys,
+ content_prekey,
+ content_prekey_signature,
+ content_onetime_keys: onetime_content_prekeys,
notif_prekey,
notif_prekey_signature,
notif_onetime_keys: onetime_notif_prekeys,
@@ -451,17 +451,17 @@
payload_signature,
social_proof: Some(social_proof),
}),
- identity_upload:
+ content_upload:
Some(client_proto::PreKey {
- pre_key: identity_prekey,
- pre_key_signature: identity_prekey_signature,
+ pre_key: content_prekey,
+ pre_key_signature: content_prekey_signature,
}),
notif_upload:
Some(client_proto::PreKey {
pre_key: notif_prekey,
pre_key_signature: notif_prekey_signature,
}),
- onetime_identity_prekeys,
+ onetime_content_prekeys,
onetime_notif_prekeys,
}),
} = message
@@ -473,9 +473,9 @@
device_id_key: key_info.primary_identity_public_keys.ed25519,
key_payload: payload,
key_payload_signature: payload_signature,
- identity_prekey,
- identity_prekey_signature,
- identity_onetime_keys: onetime_identity_prekeys,
+ content_prekey,
+ content_prekey_signature,
+ content_onetime_keys: onetime_content_prekeys,
notif_prekey,
notif_prekey_signature,
notif_onetime_keys: onetime_notif_prekeys,
diff --git a/services/identity/src/constants.rs b/services/identity/src/constants.rs
--- a/services/identity/src/constants.rs
+++ b/services/identity/src/constants.rs
@@ -54,11 +54,11 @@
"keyPayload";
pub const USERS_TABLE_DEVICES_MAP_KEY_PAYLOAD_SIGNATURE_ATTRIBUTE_NAME: &str =
"keyPayloadSignature";
-pub const USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_ATTRIBUTE_NAME: &str =
+pub const USERS_TABLE_DEVICES_MAP_CONTENT_PREKEY_ATTRIBUTE_NAME: &str =
"identityPreKey";
-pub const USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_SIGNATURE_ATTRIBUTE_NAME:
+pub const USERS_TABLE_DEVICES_MAP_CONTENT_PREKEY_SIGNATURE_ATTRIBUTE_NAME:
&str = "identityPreKeySignature";
-pub const USERS_TABLE_DEVICES_MAP_IDENTITY_ONETIME_KEYS_ATTRIBUTE_NAME: &str =
+pub const USERS_TABLE_DEVICES_MAP_CONTENT_ONETIME_KEYS_ATTRIBUTE_NAME: &str =
"identityOneTimeKeys";
pub const USERS_TABLE_DEVICES_MAP_NOTIF_PREKEY_ATTRIBUTE_NAME: &str = "preKey";
pub const USERS_TABLE_DEVICES_MAP_NOTIF_PREKEY_SIGNATURE_ATTRIBUTE_NAME: &str =
diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs
--- a/services/identity/src/database.rs
+++ b/services/identity/src/database.rs
@@ -24,10 +24,10 @@
ACCESS_TOKEN_TABLE_VALID_ATTRIBUTE, NONCE_TABLE,
NONCE_TABLE_CREATED_ATTRIBUTE, NONCE_TABLE_PARTITION_KEY, USERS_TABLE,
USERS_TABLE_DEVICES_ATTRIBUTE,
+ USERS_TABLE_DEVICES_MAP_CONTENT_ONETIME_KEYS_ATTRIBUTE_NAME,
+ USERS_TABLE_DEVICES_MAP_CONTENT_PREKEY_ATTRIBUTE_NAME,
+ USERS_TABLE_DEVICES_MAP_CONTENT_PREKEY_SIGNATURE_ATTRIBUTE_NAME,
USERS_TABLE_DEVICES_MAP_DEVICE_TYPE_ATTRIBUTE_NAME,
- USERS_TABLE_DEVICES_MAP_IDENTITY_ONETIME_KEYS_ATTRIBUTE_NAME,
- USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_ATTRIBUTE_NAME,
- USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_SIGNATURE_ATTRIBUTE_NAME,
USERS_TABLE_DEVICES_MAP_KEY_PAYLOAD_ATTRIBUTE_NAME,
USERS_TABLE_DEVICES_MAP_KEY_PAYLOAD_SIGNATURE_ATTRIBUTE_NAME,
USERS_TABLE_DEVICES_MAP_NOTIF_ONETIME_KEYS_ATTRIBUTE_NAME,
@@ -820,19 +820,19 @@
AttributeValue::S(flattened_device_key_upload.key_payload_signature),
),
(
- USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_ATTRIBUTE_NAME.to_string(),
- AttributeValue::S(flattened_device_key_upload.identity_prekey),
+ USERS_TABLE_DEVICES_MAP_CONTENT_PREKEY_ATTRIBUTE_NAME.to_string(),
+ AttributeValue::S(flattened_device_key_upload.content_prekey),
),
(
- USERS_TABLE_DEVICES_MAP_IDENTITY_PREKEY_SIGNATURE_ATTRIBUTE_NAME
+ USERS_TABLE_DEVICES_MAP_CONTENT_PREKEY_SIGNATURE_ATTRIBUTE_NAME
.to_string(),
- AttributeValue::S(flattened_device_key_upload.identity_prekey_signature),
+ AttributeValue::S(flattened_device_key_upload.content_prekey_signature),
),
(
- USERS_TABLE_DEVICES_MAP_IDENTITY_ONETIME_KEYS_ATTRIBUTE_NAME.to_string(),
+ USERS_TABLE_DEVICES_MAP_CONTENT_ONETIME_KEYS_ATTRIBUTE_NAME.to_string(),
AttributeValue::L(
flattened_device_key_upload
- .identity_onetime_keys
+ .content_onetime_keys
.into_iter()
.map(AttributeValue::S)
.collect(),
diff --git a/shared/protos/identity_client.proto b/shared/protos/identity_client.proto
--- a/shared/protos/identity_client.proto
+++ b/shared/protos/identity_client.proto
@@ -39,13 +39,14 @@
// Called by clients to get all device keys associated with a user in order
// to open a new channel of communication on any of their devices.
// Specially, this will return the following per device:
- // - Identity keys
+ // - Identity keys (both Content and Notif Keys)
// - PreKey (including preKey signature)
// - One-time PreKey
rpc GetOutboundKeysForUser(OutboundKeysForUserRequest) returns
(OutboundKeysForUserResponse) {}
// Called by receivers of a communication request. The reponse will only
- // return identity and prekeys per device, but will not contain one-time keys.
+ // return identity keys (both content and notif keys) and related prekeys per
+ // device, but will not contain one-time keys.
rpc GetInboundKeysForUser(InboundKeysForUserRequest) returns
(InboundKeysForUserResponse) {}
// Called by clients to get required keys for opening a connection
@@ -76,14 +77,14 @@
// Key information needed for starting a X3DH session
message IdentityKeyInfo {
- // JSON payload containing Olm Identity keys
- // Sessions for users will contain both IdentityKeys and NotifKeys
- // For keyservers, this will only contain IdentityKeys
+ // JSON payload containing Olm keys
+ // Sessions for users will contain both ContentKeys and NotifKeys
+ // For keyservers, this will only contain ContentKeys
string payload = 1;
// Payload signed with the signing ed25519 key
string payloadSignature = 2;
// Signed message used for SIWE
- // This correlates a given wallet with the identity of a device
+ // This correlates a given wallet with a device's content key
optional string socialProof = 3;
}
@@ -99,9 +100,9 @@
// Bundle of information needed for creating an initial message using X3DH
message DeviceKeyUpload {
IdentityKeyInfo deviceKeyInfo = 1;
- PreKey identityUpload = 2;
+ PreKey contentUpload = 2;
PreKey notifUpload = 3;
- repeated string onetimeIdentityPrekeys = 4;
+ repeated string onetimeContentPrekeys = 4;
repeated string onetimeNotifPrekeys = 5;
}
@@ -235,15 +236,15 @@
// Information needed when establishing communication to someone else's device
message OutboundKeyInfo {
IdentityKeyInfo identityInfo = 1;
- PreKey identityPrekey = 2;
+ PreKey contentPrekey = 2;
PreKey notifPrekey = 3;
- optional string onetimeIdentityPrekey = 4;
+ optional string onetimeContentPrekey = 4;
optional string onetimeNotifPrekey = 5;
}
// Information needed by a device to establish communcation when responding
// to a request.
-// The device receiving a request only needs the identity and prekeys.
+// The device receiving a request only needs the content key and prekey.
message OutboundKeysForUserRequest {
oneof identifier {
string username = 1;
@@ -260,7 +261,7 @@
message InboundKeyInfo {
IdentityKeyInfo identityInfo = 1;
- PreKey identityPrekey = 2;
+ PreKey contentPrekey = 2;
PreKey notifPrekey = 3;
}
@@ -281,8 +282,8 @@
// Information needed when establishing communication to a keyserver
message KeyserverSessionInfo {
IdentityKeyInfo identityInfo = 1;
- PreKey identityPrekeys = 2;
- optional string onetimeIdentityPrekey = 3;
+ PreKey contentPrekeys = 2;
+ optional string onetimeContentPrekey = 3;
}
// All keyserver must be registered with an existing user.

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 1, 2:52 AM (18 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2603421
Default Alt Text
D7671.diff (11 KB)

Event Timeline