Page MenuHomePhabricator

D12204.diff
No OneTemporary

D12204.diff

diff --git a/lib/types/request-types.js b/lib/types/request-types.js
--- a/lib/types/request-types.js
+++ b/lib/types/request-types.js
@@ -276,13 +276,13 @@
export type OlmSessionInitializationInfo = {
+prekey: string,
+prekeySignature: string,
- +oneTimeKey: string,
+ +oneTimeKey: ?string,
};
export const olmSessionInitializationInfoValidator: TInterface<OlmSessionInitializationInfo> =
tShape<OlmSessionInitializationInfo>({
prekey: t.String,
prekeySignature: t.String,
- oneTimeKey: t.String,
+ oneTimeKey: t.maybe(t.String),
});
export type GetOlmSessionInitializationDataResponse = {
diff --git a/lib/utils/crypto-utils.js b/lib/utils/crypto-utils.js
--- a/lib/utils/crypto-utils.js
+++ b/lib/utils/crypto-utils.js
@@ -73,10 +73,6 @@
}
const recipientDeviceID = primaryIdentityPublicKeys.ed25519;
- if (!keys.contentInitializationInfo.oneTimeKey) {
- console.log(`One-time key is missing for device ${recipientDeviceID}`);
- continue;
- }
try {
const { sessionVersion, encryptedData } =
await olmAPI.contentOutboundSessionCreator(
@@ -141,10 +137,6 @@
const { primaryIdentityPublicKeys } = keys.identityKeysBlob;
const recipientDeviceID = primaryIdentityPublicKeys.ed25519;
- if (!keys.contentInitializationInfo.oneTimeKey) {
- throw new Error(`One-time key is missing for device ${recipientDeviceID}`);
- }
-
const { sessionVersion, encryptedData } =
await olmAPI.contentOutboundSessionCreator(
primaryIdentityPublicKeys,
diff --git a/native/identity-service/identity-service-context-provider.react.js b/native/identity-service/identity-service-context-provider.react.js
--- a/native/identity-service/identity-service-context-provider.react.js
+++ b/native/identity-service/identity-service-context-provider.react.js
@@ -172,13 +172,6 @@
payloadSignature: resultObject?.payloadSignature,
};
- if (!keyserverKeys.contentInitializationInfo.oneTimeKey) {
- throw new Error('Missing content one time key');
- }
- if (!keyserverKeys.notifInitializationInfo.oneTimeKey) {
- throw new Error('Missing notif one time key');
- }
-
return assertWithValidator(
keyserverKeys,
deviceOlmOutboundKeysValidator,
@@ -211,17 +204,6 @@
const deviceID =
identityKeysBlob.primaryIdentityPublicKeys.ed25519;
- if (
- !outboundKeysInfo.oneTimeContentPrekey ||
- !outboundKeysInfo.oneTimeNotifPrekey
- ) {
- console.log(`Missing one time key for device ${deviceID}`);
- return {
- deviceID,
- keys: null,
- };
- }
-
const deviceKeys = {
identityKeysBlob,
contentInitializationInfo: {
diff --git a/web/grpc/identity-service-client-wrapper.js b/web/grpc/identity-service-client-wrapper.js
--- a/web/grpc/identity-service-client-wrapper.js
+++ b/web/grpc/identity-service-client-wrapper.js
@@ -180,13 +180,6 @@
payloadSignature: identityInfo?.getPayloadSignature(),
};
- if (!keyserverKeys.contentInitializationInfo.oneTimeKey) {
- throw new Error('Missing content one time key');
- }
- if (!keyserverKeys.notifInitializationInfo.oneTimeKey) {
- throw new Error('Missing notif one time key');
- }
-
return assertWithValidator(keyserverKeys, deviceOlmOutboundKeysValidator);
};
@@ -219,17 +212,6 @@
return null;
}
- if (
- !outboundKeysInfo.oneTimeContentPrekey ||
- !outboundKeysInfo.oneTimeNotifPrekey
- ) {
- console.log(`Missing one time key for device ${deviceID}`);
- return {
- deviceID,
- keys: null,
- };
- }
-
const deviceKeys = {
identityKeysBlob: payload ? JSON.parse(payload) : null,
contentInitializationInfo: {

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 12:29 PM (21 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2584710
Default Alt Text
D12204.diff (3 KB)

Event Timeline