aboutsummaryrefslogtreecommitdiffstats
path: root/otr.c
diff options
context:
space:
mode:
authorSven Moritz Hallberg <pesco@khjk.org>2010-10-01 22:38:16 +0200
committerSven Moritz Hallberg <pesco@khjk.org>2010-10-01 22:38:16 +0200
commitf26db4a89ea0a61123a7aa4b70b1d4102a309b2e (patch)
tree9a5ab5cbcc6389af85eb71c09fc79f3c431d130c /otr.c
parent7c91392c8525486876fe381b33f21b7dd508477c (diff)
explicitly handle cheating by smp opponent
Diffstat (limited to 'otr.c')
-rw-r--r--otr.c8
1 files changed, 8 insertions, 0 deletions
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) {