diff options
-rw-r--r-- | pyasn1_modules/pem.py | 7 | ||||
-rw-r--r-- | pyasn1_modules/rfc1155.py | 3 | ||||
-rw-r--r-- | pyasn1_modules/rfc1157.py | 3 | ||||
-rwxr-xr-x | tools/ocspclient.py | 2 | ||||
-rwxr-xr-x | tools/pkcs8dump.py | 6 | ||||
-rwxr-xr-x | tools/snmpget.py | 4 |
6 files changed, 16 insertions, 9 deletions
diff --git a/pyasn1_modules/pem.py b/pyasn1_modules/pem.py index 638e74e..e3f8cb6 100644 --- a/pyasn1_modules/pem.py +++ b/pyasn1_modules/pem.py @@ -4,7 +4,8 @@ # Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net> # License: http://pyasn1.sf.net/license.html # -import base64, sys +import base64 +import sys stSpam, stHam, stDump = 0, 1, 2 @@ -13,9 +14,9 @@ stSpam, stHam, stDump = 0, 1, 2 # Return is (marker-index, substrate) def readPemBlocksFromFile(fileObj, *markers): startMarkers = dict(map(lambda x: (x[1], x[0]), - enumerate(map(lambda x: x[0], markers)))) + enumerate(map(lambda y: y[0], markers)))) stopMarkers = dict(map(lambda x: (x[1], x[0]), - enumerate(map(lambda x: x[1], markers)))) + enumerate(map(lambda y: y[1], markers)))) idx = -1 substrate = '' certLines = [] diff --git a/pyasn1_modules/rfc1155.py b/pyasn1_modules/rfc1155.py index f0e39ca..50f002c 100644 --- a/pyasn1_modules/rfc1155.py +++ b/pyasn1_modules/rfc1155.py @@ -15,7 +15,8 @@ from pyasn1.type import univ, namedtype, tag, constraint -class ObjectName(univ.ObjectIdentifier): pass +class ObjectName(univ.ObjectIdentifier): + pass class SimpleSyntax(univ.Choice): diff --git a/pyasn1_modules/rfc1157.py b/pyasn1_modules/rfc1157.py index 30f36b4..36fa0d3 100644 --- a/pyasn1_modules/rfc1157.py +++ b/pyasn1_modules/rfc1157.py @@ -42,7 +42,8 @@ class ErrorStatus(univ.Integer): ) -class ErrorIndex(univ.Integer): pass +class ErrorIndex(univ.Integer): + pass class VarBind(univ.Sequence): diff --git a/tools/ocspclient.py b/tools/ocspclient.py index 0cc430c..8ffd47d 100755 --- a/tools/ocspclient.py +++ b/tools/ocspclient.py @@ -128,6 +128,7 @@ issuerCert, _ = decoder.decode( )[1], asn1Spec=rfc2459.Certificate() ) +# noinspection PyRedeclaration userCert, _ = decoder.decode( pem.readPemBlocksFromFile( sys.stdin, ('-----BEGIN CERTIFICATE-----', '-----END CERTIFICATE-----') @@ -151,6 +152,7 @@ httpRsp = urllib2.urlopen(httpReq).read() # Process OCSP response +# noinspection PyRedeclaration ocspRsp, _ = decoder.decode(httpRsp, asn1Spec=rfc2560.OCSPResponse()) producedAt, certId, certStatus, thisUpdate = parseOcspResponse(ocspRsp) diff --git a/tools/pkcs8dump.py b/tools/pkcs8dump.py index 05db7b1..a9ab073 100755 --- a/tools/pkcs8dump.py +++ b/tools/pkcs8dump.py @@ -21,9 +21,9 @@ cnt = 0 while True: idx, substrate = pem.readPemBlocksFromFile( - sys.stdin, ('-----BEGIN PRIVATE KEY-----', '-----END PRIVATE KEY-----'), - ('-----BEGIN ENCRYPTED PRIVATE KEY-----', - '-----END ENCRYPTED PRIVATE KEY-----') + sys.stdin, + ('-----BEGIN PRIVATE KEY-----', '-----END PRIVATE KEY-----'), + ('-----BEGIN ENCRYPTED PRIVATE KEY-----', '-----END ENCRYPTED PRIVATE KEY-----') ) if not substrate: break diff --git a/tools/snmpget.py b/tools/snmpget.py index 4aeeac9..91d72df 100755 --- a/tools/snmpget.py +++ b/tools/snmpget.py @@ -9,7 +9,8 @@ # from pyasn1.codec.ber import encoder, decoder from pyasn1_modules import rfc1157 -import sys, socket +import sys +import socket if len(sys.argv) != 4: print("""Usage: @@ -37,6 +38,7 @@ sock.sendto(encoder.encode(msg), (sys.argv[2], 161)) substrate, _ = sock.recvfrom(2048) +# noinspection PyRedeclaration rMsg, _ = decoder.decode(substrate, asn1Spec=msg) print('received: %s' % rMsg.prettyPrint()) |