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 = tShape({ 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( 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 @@ -168,13 +168,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, @@ -207,17 +200,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 @@ -173,13 +173,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); }; @@ -212,17 +205,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: {