diff options
author | Brendan Taylor <bct@diffeq.com> | 2007-07-04 22:55:53 +0400 |
---|---|---|
committer | Brendan Taylor <bct@diffeq.com> | 2007-07-04 22:55:53 +0400 |
commit | 29c44d8a5e619daa1d825d1d078261fcc348368f (patch) | |
tree | b387b7a7bb236cff167b58ab2ec156bc16a7cb78 | |
parent | 2bed6a522a248f94d54386e692da18fb82c47bbb (diff) |
interface for SAS
-rw-r--r-- | src/common/stanza_session.py | 4 | ||||
-rwxr-xr-x | src/gajim.py | 7 | ||||
-rw-r--r-- | src/negotiation.py | 11 |
3 files changed, 17 insertions, 5 deletions
diff --git a/src/common/stanza_session.py b/src/common/stanza_session.py index edbee3df5..f8fd70867 100644 --- a/src/common/stanza_session.py +++ b/src/common/stanza_session.py @@ -561,7 +561,7 @@ class EncryptedStanzaSession(StanzaSession): # 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 @@ class EncryptedStanzaSession(StanzaSession): # 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) diff --git a/src/gajim.py b/src/gajim.py index 8f2537b20..dcc16e9cd 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -1699,10 +1699,12 @@ class Interface: 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 @@ class Interface: 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) diff --git a/src/negotiation.py b/src/negotiation.py index f7c58852e..73917400c 100644 --- a/src/negotiation.py +++ b/src/negotiation.py @@ -1,6 +1,8 @@ import gtkgui_helpers import dataforms_widget +import dialogs + from common import dataforms from common import gajim from common import xmpp @@ -8,9 +10,14 @@ from common import xmpp 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''' |