From f26db4a89ea0a61123a7aa4b70b1d4102a309b2e Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Fri, 1 Oct 2010 22:38:16 +0200 Subject: explicitly handle cheating by smp opponent --- otr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/otr.c b/otr.c index c71ff573..3f7b25cd 100644 --- a/otr.c +++ b/otr.c @@ -1073,6 +1073,14 @@ void otr_handle_smp(struct im_connection *ic, const char *handle, OtrlTLV *tlvs) } nextMsg = context->smstate->nextExpected; + if (context->smstate->sm_prog_state == OTRL_SMP_PROG_CHEATED) { + irc_usermsg(irc, "smp %s: opponent violated protocol, aborting", + u->nick); + otrl_message_abort_smp(us, ops, u->bu->ic, context); + otrl_sm_state_free(context->smstate); + return; + } + tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP1Q); if (tlv) { if (nextMsg != OTRL_SMP_EXPECT1) { -- cgit v1.2.3