Changeset 944d7a5


Ignore:
Timestamp:
2010-10-01T21:36:44Z (14 years ago)
Author:
Sven Moritz Hallberg <pesco@…>
Branches:
master
Children:
faa75c0e
Parents:
f26db4a8
Message:

libotr forgets to set trust when responding to smpq

File:
1 edited

Legend:

Unmodified
Added
Removed
  • otr.c

    rf26db4a8 r944d7a5  
    11301130                } else {
    11311131                        /* SMP3 received, otrl_message_receiving will have sent SMP4 and set fp trust */
    1132                         const char *trust = context->active_fingerprint->trust;
    1133                         if(!trust || trust[0]=='\0') {
    1134                                 irc_usermsg(irc, "smp %s: secrets did not match, fingerprint not trusted",
     1132                        /* as noted above, fp trust SHOULD have been set by libotr.
     1133                         * however at least version 3.2.0 seems to forget it when
     1134                         * responding to an smp session that was initiated with SMP1Q
     1135                         * (question and answer); other cases appear to work fine.
     1136                         * as a workaround, we explicitly set it below.
     1137                         */
     1138                        if(context->smstate->sm_prog_state == OTRL_SMP_PROG_SUCCEEDED) {
     1139                                otrl_context_set_trust(context->active_fingerprint, "smp");
     1140                                irc_usermsg(irc, "smp %s: secrets proved equal, fingerprint trusted",
    11351141                                        u->nick);
    11361142                        } else {
    1137                                 irc_usermsg(irc, "smp %s: secrets proved equal, fingerprint trusted",
     1143                                otrl_context_set_trust(context->active_fingerprint, "");
     1144                                irc_usermsg(irc, "smp %s: secrets did not match, fingerprint not trusted",
    11381145                                        u->nick);
    11391146                        }
     
    11501157                } else {
    11511158                        /* SMP4 received, otrl_message_receiving will have set fp trust */
    1152                         const char *trust = context->active_fingerprint->trust;
    1153                         if(!trust || trust[0]=='\0') {
    1154                                 irc_usermsg(irc, "smp %s: secrets did not match, fingerprint not trusted",
     1159                        if(context->smstate->sm_prog_state == OTRL_SMP_PROG_SUCCEEDED) {
     1160                                irc_usermsg(irc, "smp %s: secrets proved equal, fingerprint trusted",
    11551161                                        u->nick);
    11561162                        } else {
    1157                                 irc_usermsg(irc, "smp %s: secrets proved equal, fingerprint trusted",
     1163                                irc_usermsg(irc, "smp %s: secrets did not match, fingerprint not trusted",
    11581164                                        u->nick);
    11591165                        }
     
    12021208                otrl_sm_state_free(ctx->smstate);
    12031209        }
    1204        
     1210
    12051211        if(question) {
    12061212                /* this was 'otr smpq', just initiate */
Note: See TracChangeset for help on using the changeset viewer.