diff options
author | Sven Moritz Hallberg <pesco@khjk.org> | 2010-10-04 23:55:18 +0200 |
---|---|---|
committer | Sven Moritz Hallberg <pesco@khjk.org> | 2010-10-04 23:55:18 +0200 |
commit | 3ad80364e4d8aac620120b630df8a164d58dd114 (patch) | |
tree | 0b32f544cac2184a89107c327c3e75d55e68474c /otr.c | |
parent | 88de0c96136313e553113f69cfc6ae544a5f5954 (diff) |
q&a-style smp only affects trust on the asking side
Diffstat (limited to 'otr.c')
-rw-r--r-- | otr.c | 28 |
1 files changed, 15 insertions, 13 deletions
@@ -1128,21 +1128,23 @@ void otr_handle_smp(struct im_connection *ic, const char *handle, OtrlTLV *tlvs) otrl_message_abort_smp(us, ops, u->bu->ic, context); otrl_sm_state_free(context->smstate); } else { - /* SMP3 received, otrl_message_receiving will have sent SMP4 and set fp trust */ - /* as noted above, fp trust SHOULD have been set by libotr. - * however at least version 3.2.0 seems to forget it when - * responding to an smp session that was initiated with SMP1Q - * (question and answer); other cases appear to work fine. - * as a workaround, we explicitly set it below. - */ + /* SMP3 received, otrl_message_receiving will have sent SMP4 */ if(context->smstate->sm_prog_state == OTRL_SMP_PROG_SUCCEEDED) { - otrl_context_set_trust(context->active_fingerprint, "smp"); - irc_usermsg(irc, "smp %s: secrets proved equal, fingerprint trusted", - u->nick); + if(context->smstate->received_question) { + irc_usermsg(irc, "smp %s: correct answer, you are trusted", + u->nick); + } else { + irc_usermsg(irc, "smp %s: secrets proved equal, fingerprint trusted", + u->nick); + } } else { - otrl_context_set_trust(context->active_fingerprint, ""); - irc_usermsg(irc, "smp %s: secrets did not match, fingerprint not trusted", - u->nick); + if(context->smstate->received_question) { + irc_usermsg(irc, "smp %s: wrong answer, you are not trusted", + u->nick); + } else { + irc_usermsg(irc, "smp %s: secrets did not match, fingerprint not trusted", + u->nick); + } } otrl_sm_state_free(context->smstate); /* smp is in back in EXPECT1 */ |