Skip to content
Snippets Groups Projects
Commit 29c44d8a authored by Brendan Taylor's avatar Brendan Taylor
Browse files

interface for SAS

parent 2bed6a52
No related branches found
No related tags found
No related merge requests found
......@@ -561,7 +561,7 @@ def accept_e2e_alice(self, form, negotiated):
# check for a retained secret
# if none exists, prompt the user with the SAS
if self.sas_algs == 'sas28x5':
print "sas: %s" % self.sas_28x5(m_a, self.form_b)
self.sas = self.sas_28x5(m_a, self.form_b)
result.addChild(node=xmpp.DataField(name='identity', value=base64.b64encode(id_a)))
result.addChild(node=xmpp.DataField(name='mac', value=base64.b64encode(m_a)))
......@@ -629,7 +629,7 @@ def accept_e2e_bob(self, form):
# check for a retained secret
# if none exists, prompt the user with the SAS
if self.sas_algs == 'sas28x5':
print "sas: %s" % self.sas_28x5(m_a, self.form_b)
self.sas = self.sas_28x5(m_a, self.form_b)
k = self.sha256(k + self.srs + oss)
......
......@@ -1699,10 +1699,12 @@ def reject_nondefault_options(widget):
if ask_user:
def accept_nondefault_options(widget):
dialog.destroy()
negotiated.update(ask_user)
session.accept_e2e_alice(form, negotiated)
dialog.destroy()
negotiation.show_sas_dialog(jid, session.sas)
def reject_nondefault_options(widget):
session.reject_negotiation()
......@@ -1714,10 +1716,13 @@ def reject_nondefault_options(widget):
on_response_no = reject_nondefault_options)
else:
session.accept_e2e_alice(form, negotiated)
negotiation.show_sas_dialog(jid, session.sas)
return
elif session.status == 'responded-e2e' and form.getType() == 'result':
session.accept_e2e_bob(form)
negotiation.show_sas_dialog(jid, session.sas)
return
elif session.status == 'identified-alice' and form.getType() == 'result':
session.final_steps_alice(form)
......
import gtkgui_helpers
import dataforms_widget
import dialogs
from common import dataforms
from common import gajim
from common import xmpp
......@@ -8,9 +10,14 @@
def describe_features(features):
'''a human-readable description of the features that have been negotiated'''
if features['logging'] == 'may':
return '- messages will be logged'
return _('- messages will be logged')
elif features['logging'] == 'mustnot':
return '- messages will not be logged'
return _('- messages will not be logged')
def show_sas_dialog(jid, sas):
dialogs.InformationDialog(_('''Verify the remote client's identity'''), _('''You've begun an encrypted session with %s, but it can't be guaranteed that you're talking directly to the person you think you are.
You should speak with them directly (in person or on the phone) and confirm that their Short Authentication String is identical to this one: %s''') % (jid, sas))
class FeatureNegotiationWindow:
'''FeatureNegotiotionWindow class'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment