changeset c7a32812c477 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=c7a32812c477
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 ccef4ef8fe6b -r c7a32812c477 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]:
_______________________________________________
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to