From 463c0c1d6ae42221c837117ef96436f7f63359c1 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Mon, 2 Feb 2015 07:56:41 +0100 Subject: [PATCH] Bug fixed when exception is raised (int->str) --- bin/x509/dumpx509subject.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/x509/dumpx509subject.py b/bin/x509/dumpx509subject.py index 4ed889f..409d912 100644 --- a/bin/x509/dumpx509subject.py +++ b/bin/x509/dumpx509subject.py @@ -5,7 +5,7 @@ # # Software is free software released under the GNU General Public License version 3 and later # -# Copyright (c) 2014 Alexandre Dulaunoy - a@foo.be +# Copyright (c) 2014-2015 Alexandre Dulaunoy - a@foo.be import fileinput from M2Crypto import X509 @@ -53,7 +53,7 @@ for cert in fileinput.input(args.r): certb = base64.b64decode(cert.split(",")[1]) except: if args.v: - print "Padding error "+fileinput.lineno() + print "Padding error "+str(fileinput.lineno()) pass if args.k: @@ -71,7 +71,7 @@ for cert in fileinput.input(args.r): try: x509 = X509.load_cert_string(certb, X509.FORMAT_DER) except: - print "At line number "+ str(fileinput.lineno()) + " parsing error" + print "At line number "+str(fileinput.lineno())+" parsing error" pass subject = x509.get_subject().as_text() if subject is not None: @@ -81,5 +81,3 @@ for cert in fileinput.input(args.r): r.sadd(fp, subject) else: sys.exit(1) - -