Author: bct Date: 2007-08-07 09:42:31 +0200 (Tue, 07 Aug 2007) New Revision: 8463
Modified: branches/e2e_encryption/src/chat_control.py branches/e2e_encryption/src/common/stanza_session.py branches/e2e_encryption/src/gajim.py Log: prompt with SAS during 3 message negotiation
Modified: branches/e2e_encryption/src/chat_control.py =================================================================== --- branches/e2e_encryption/src/chat_control.py 2007-08-07 07:21:29 UTC (rev 8462) +++ branches/e2e_encryption/src/chat_control.py 2007-08-07 07:42:31 UTC (rev 8463) @@ -1957,7 +1957,8 @@ if not self.session: self.session = gajim.connections[self.account].make_new_session(self.contact.jid)
- self.session.negotiate_e2e() + # XXX decide whether to use 4 or 3 message negotiation + self.session.negotiate_e2e(False)
def got_connected(self): ChatControlBase.got_connected(self)
Modified: branches/e2e_encryption/src/common/stanza_session.py =================================================================== --- branches/e2e_encryption/src/common/stanza_session.py 2007-08-07 07:21:29 UTC (rev 8462) +++ branches/e2e_encryption/src/common/stanza_session.py 2007-08-07 07:42:31 UTC (rev 8463) @@ -330,7 +330,7 @@ # if none exists, prompt the user with the SAS if self.sas_algs == 'sas28x5': self.sas = self.sas_28x5(m_a, self.form_b) - + mac_a = self.decrypt(id_a)
form_a2 = self.c7lize_mac_id(form) @@ -357,8 +357,8 @@ content = self.n_s + self.n_o + self.encode_mpi(self.d) + pubkey_b
if sigmai: - form_b = c7l_form - content += form_b + self.form_b = c7l_form + content += self.form_b else: form_b2 = c7l_form content += self.form_b + form_b2 @@ -383,6 +383,9 @@ # if none exists, prompt the user with the SAS if self.sas_algs == 'sas28x5': self.sas = self.sas_28x5(m_a, self.form_b) + + if self.sigmai: + self.check_identity() return (xmpp.DataField(name='identity', value=base64.b64encode(id_a)), \ xmpp.DataField(name='mac', value=base64.b64encode(m_a))) @@ -606,8 +609,6 @@
self.negotiated = negotiated
- self.form_b = ''.join(map(lambda el: xmpp.c14n.c14n(el), form.getChildren())) - accept = xmpp.Message() feature = accept.NT.feature feature.setNamespace(xmpp.NS_FEATURE) @@ -647,7 +648,10 @@ rshashes = [base64.b64encode(rshash) for rshash in rshashes] result.addChild(node=xmpp.DataField(name='rshashes', value=rshashes)) result.addChild(node=xmpp.DataField(name='dhkeys', value=base64.b64encode(self.encode_mpi(e)))) + + self.form_b = ''.join(map(lambda el: xmpp.c14n.c14n(el), form.getChildren()))
+ # MUST securely destroy K unless it will be used later to generate the final shared secret
for datafield in self.make_alices_identity(result, e):
Modified: branches/e2e_encryption/src/gajim.py =================================================================== --- branches/e2e_encryption/src/gajim.py 2007-08-07 07:21:29 UTC (rev 8462) +++ branches/e2e_encryption/src/gajim.py 2007-08-07 07:42:31 UTC (rev 8463) @@ -1765,11 +1765,15 @@ elif session.status == 'requested-e2e' and form.getType() == 'submit': negotiated, not_acceptable, ask_user = session.verify_options_alice(form)
+ if session.sigmai: + session.check_identity = lambda: negotiation.show_sas_dialog(jid, session.sas) + if ask_user: def accept_nondefault_options(widget): dialog.destroy()
negotiated.update(ask_user) + session.accept_e2e_alice(form, negotiated)
def reject_nondefault_options(widget):