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( @@ -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: {