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

added option for esession autonegotiation

added option for modp groups to use in a negotiation
parent e4b4d839
No related branches found
No related tags found
No related merge requests found
......@@ -1155,9 +1155,10 @@ def __init__(self, parent_win, contact, acct, session, resource = None):
self.session and self.session.is_loggable(), True)
# then try E2E
# XXX: Once we have fallback to disco, remove notexistant check
elif not e2e_is_active and \
gajim.capscache.is_supported(contact, NS_ESESSION) and \
not gajim.capscache.is_supported(contact, 'notexistant'):
elif not e2e_is_active and gajim.HAVE_PYCRYPTO \
and gajim.config.get('autonegotiate_esessions') \
and gajim.capscache.is_supported(contact, NS_ESESSION) \
and not gajim.capscache.is_supported(contact, 'notexistant'):
self.begin_e2e_negotiation()
self.status_tooltip = gtk.Tooltips()
......
......@@ -191,7 +191,8 @@ class Config:
'tabs_border': [opt_bool, False, _('Show tabbed notebook border in chat windows?')],
'tabs_close_button': [opt_bool, True, _('Show close button in tab?')],
'log_encrypted_sessions': [opt_bool, True, _('When negotiating an encrypted session, should Gajim assume you want your messages to be logged?')],
'e2e_public_key': [opt_bool, False, _('When negotiating an encrypted session, should Gajim prefer to use public keys for identification?')],
'autonegotiate_esessions': [opt_bool, True, _('Should Gajim automatically start an encrypted session when possible?')],
'esession_modp': [opt_str, '5,14', _('A list of modp groups to use in a Diffie-Hellman, highest preference first, separated by commas. Valid groups are 1, 2, 5, 14, 15, 16, 17 and 18. Higher numbers are more secure, but take longer to calculate when you start a session.')],
'chat_avatar_width': [opt_int, 52],
'chat_avatar_height': [opt_int, 52],
'roster_avatar_width': [opt_int, 32],
......
......@@ -483,7 +483,7 @@ def negotiate_e2e(self, sigmai):
x.addChild(node=xmpp.DataField(name='my_nonce', value=base64.b64encode(self.n_s), typ='hidden'))
modp_options = [ 5, 14, 2, 1 ]
modp_options = [ int(g) for g in gajim.config.get('esession_modp').split(',') ]
x.addChild(node=xmpp.DataField(name='modp', typ='list-single', options=map(lambda x: [ None, x ], modp_options)))
......
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