X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pyderasn.py;h=f611efa195369727b2a2a20455a8c5b796431389;hb=df4edf45ae38fdde82784de40a95f6f0279f5e89;hp=7ce0565e5da91bd6d57c454752f0a329bc17e3d9;hpb=a8f8eb8f0bf0395b8fc94a1cad063def57729a90;p=pyderasn.git diff --git a/pyderasn.py b/pyderasn.py index 7ce0565..f611efa 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -20,7 +20,7 @@ """Python ASN.1 DER/BER codec with abstract structures This library allows you to marshal various structures in ASN.1 DER -format, unmarshal them in BER/CER/DER ones. +format, unmarshal BER/CER/DER ones. >>> i = Integer(123) >>> raw = i.encode() @@ -1193,7 +1193,7 @@ except ImportError: # pragma: no cover def colored(what, *args, **kwargs): return what -__version__ = "7.4" +__version__ = "7.5" __all__ = ( "agg_octet_string", @@ -7486,6 +7486,8 @@ def browse(raw, obj, oid_maps=()): If you press **d**, then current element will be saved in the current directory under its decode path name (adding ".0", ".1", etc suffix if such file already exists). **D** will save it with explicit tag. + + You can also invoke it with ``--browse`` command line argument. """ from copy import deepcopy from os.path import exists as path_exists @@ -7537,6 +7539,9 @@ def browse(raw, obj, oid_maps=()): [("header", "[TLV]len: "), "%d/%d/%d" % ( pp.tlen, pp.llen, pp.vlen, )], + [("header", "TLVlen: "), "%d" % sum(( + pp.tlen, pp.llen, pp.vlen, + ))], [("header", "Slice: "), "[%d:%d]" % ( pp.offset, pp.offset + pp.tlen + pp.llen + pp.vlen, )], @@ -7556,6 +7561,9 @@ def browse(raw, obj, oid_maps=()): lines.append([" [TLV]len: %d/%d/%d" % ( pp.expl_tlen, pp.expl_llen, pp.expl_vlen, )]) + lines.append([" TLVlen: %d" % sum(( + pp.expl_tlen, pp.expl_llen, pp.expl_vlen, + ))]) lines.append([" Slice: [%d:%d]" % ( pp.expl_offset, pp.expl_offset + pp.expl_tlen + pp.expl_llen + pp.expl_vlen,