From 51fa1866a9d5dd44bbcd57eea89d261bd1deec53 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 15 May 2024 15:58:24 +0100 Subject: [PATCH] Wire up verification cancel & mismatch for rust crypto (#4202) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/rust-crypto/verification.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rust-crypto/verification.ts b/src/rust-crypto/verification.ts index 424945cb7..d25e6b26d 100644 --- a/src/rust-crypto/verification.ts +++ b/src/rust-crypto/verification.ts @@ -710,10 +710,16 @@ export class RustSASVerifier extends BaseRustVerifer implem } }, mismatch: (): void => { - throw new Error("impl"); + const request = this.inner.cancelWithCode("m.mismatched_sas"); + if (request) { + this.outgoingRequestProcessor.makeOutgoingRequest(request); + } }, cancel: (): void => { - throw new Error("impl"); + const request = this.inner.cancelWithCode("m.user"); + if (request) { + this.outgoingRequestProcessor.makeOutgoingRequest(request); + } }, }; this.emit(VerifierEvent.ShowSas, this.callbacks);