changeset 734d02e7be50 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=734d02e7be50
description: prevent traceback when a wrong certificate is being checked. Fixes #7242
diffstat:
src/common/check_X509.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diffs (17 lines):
diff -r 1571a300a583 -r 734d02e7be50 src/common/check_X509.py
--- a/src/common/check_X509.py Sat Oct 06 19:07:48 2012 +0200
+++ b/src/common/check_X509.py Mon Oct 08 11:14:47 2012 +0200
@@ -133,7 +133,12 @@
for i in range(0, cnt):
ext = cert.get_extension(i)
if ext.get_short_name() == 'subjectAltName':
- r = _parse_asn1(ext.get_data())
+ try:
+ r = _parse_asn1(ext.get_data())
+ except:
+ log.error('Wrong data in certificate: subjectAltName=%s' % \
+ ext.get_data())
+ continue
if 'otherName' in r:
if oid_xmppaddr in r['otherName']:
for host in r['otherName'][oid_xmppaddr]:
changeset a61b09fd9534 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=a61b09fd9534
description: handle disconnection while doing SASL as a sasl failure rather than a connection error. Fixes #3343
diffstat:
src/common/xmpp/client_nb.py | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diffs (45 lines):
diff -r 6e033f839fb3 -r a61b09fd9534 src/common/xmpp/client_nb.py
--- a/src/common/xmpp/client_nb.py Tue Sep 18 17:24:51 2012 +0200
+++ b/src/common/xmpp/client_nb.py Wed Sep 19 17:20:45 2012 +0200
@@ -85,6 +85,7 @@
log.info('Disconnecting NBClient: %s' % message)
+ sasl_failed = False
if 'NonBlockingRoster' in self.__dict__:
self.NonBlockingRoster.PlugOut()
if 'NonBlockingBind' in self.__dict__:
@@ -92,7 +93,12 @@
if 'NonBlockingNonSASL' in self.__dict__:
self.NonBlockingNonSASL.PlugOut()
if 'SASL' in self.__dict__:
- self.SASL.PlugOut()
+ if self.SASL.startsasl == 'failure-in-process':
+ sasl_failed = True
+ self.SASL.startsasl = 'failure'
+ self._on_start_sasl()
+ else:
+ self.SASL.PlugOut()
if 'NonBlockingTCP' in self.__dict__:
self.NonBlockingTCP.PlugOut()
if 'NonBlockingHTTP' in self.__dict__:
@@ -111,7 +117,9 @@
self.disconnecting = True
log.debug('Client disconnected..')
- if connected == '':
+ # Don't call any callback when it's a SASL failure.
+ # SASL handler is already called
+ if connected == '' and not sasl_failed:
# if we're disconnecting before connection to XMPP sever is opened,
# we don't call disconnect handlers but on_connect_failure callback
if self.proxy:
@@ -121,7 +129,7 @@
else:
log.debug('calling on_connect_failure cb')
self.on_connect_failure()
- else:
+ elif not sasl_failed:
# we are connected to XMPP server
if not stream_started:
# if error occur before XML stream was opened, e.g. no response on