Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove outdated sendExternalJoinProposal method #5841

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import logdown from 'logdown';

import {APIClient} from '@wireapp/api-client';
import {TypedEventEmitter} from '@wireapp/commons';
import {Ciphersuite, CredentialType, ExternalProposalType} from '@wireapp/core-crypto';
import {GenericMessage} from '@wireapp/protocol-messaging';

import {
Expand All @@ -60,7 +59,7 @@ import {

import {MessageTimer, MessageSendingState, RemoveUsersParams} from '../../conversation/';
import {decryptAsset} from '../../cryptography/AssetCryptography';
import {MLSService, optionalToUint8Array} from '../../messagingProtocols/mls';
import {MLSService} from '../../messagingProtocols/mls';
import {isCoreCryptoMLSWrongEpochError} from '../../messagingProtocols/mls/MLSService/CoreCryptoMLSError';
import {getConversationQualifiedMembers, ProteusService} from '../../messagingProtocols/proteus';
import {
Expand Down Expand Up @@ -422,31 +421,6 @@ export class ConversationService extends TypedEventEmitter<Events> {
return this.mlsService.joinByExternalCommit(() => this.apiClient.api.conversation.getGroupInfo(conversationId));
}

/**
* Will send an external proposal for the current device to join a specific conversation.
* In order for the external proposal to be sent correctly, the underlying mls conversation needs to be in a non-established state
* @param groupId The conversation to join
* @param epoch The current epoch of the local conversation
*/
public async sendExternalJoinProposal(groupId: string, epoch: number) {
return sendMessage(async () => {
const groupIdBytes = Decoder.fromBase64(groupId).asBytes;
const externalProposal = await this.mlsService.newExternalProposal(ExternalProposalType.Add, {
epoch,
conversationId: groupIdBytes,
ciphersuite: Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519,
credentialType: CredentialType.Basic,
});
await this.apiClient.api.conversation.postMlsMessage(
//@todo: it's temporary - we wait for core-crypto fix to return the actual Uint8Array instead of regular array
optionalToUint8Array(externalProposal),
);

//We store the info when user was added (and key material was created), so we will know when to renew it
await this.mlsService.resetKeyMaterialRenewal(groupId);
});
}

/**
* Will check if mls group exists locally.
* @param groupId groupId of the conversation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import {
CoreCrypto,
CredentialType,
DecryptedMessage,
ExternalAddProposalArgs,
ExternalProposalType,
ProposalArgs,
ProposalType,
RemoveProposalArgs,
Expand Down Expand Up @@ -287,10 +285,6 @@ export class MLSService extends TypedEventEmitter<Events> {
return Encoder.toBase64(key).asString;
}

public async newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalAddProposalArgs) {
return this.coreCryptoClient.newExternalProposal(externalProposalType, args);
}

public async processWelcomeMessage(welcomeMessage: Uint8Array): Promise<ConversationId> {
return this.coreCryptoClient.processWelcomeMessage(welcomeMessage);
}
Expand Down
Loading