From: Sergey Matveev Date: Sun, 20 May 2018 12:18:24 +0000 (+0300) Subject: Optionally disallow BER in utility X-Git-Tag: 3.7~13 X-Git-Url: http://www.git.cypherpunks.ru/?p=pyderasn.git;a=commitdiff_plain;h=15fcedaab8d00001395b44d6d500312b2b0a06e3 Optionally disallow BER in utility --- diff --git a/pyderasn.py b/pyderasn.py index ac74adc..ffc788c 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -5037,6 +5037,11 @@ def main(): # pragma: no cover "--defines-by-path", help="Python path to decoder's defines_by_path", ) + parser.add_argument( + "--nobered", + action='store_true', + help="Disallow BER encoding", + ) parser.add_argument( "DERFile", type=argparse.FileType("rb"), @@ -5053,7 +5058,7 @@ def main(): # pragma: no cover pprinter = partial(pprint, big_blobs=True) else: schema, pprinter = generic_decoder() - ctx = {"bered": True} + ctx = {"bered": not args.nobered} if args.defines_by_path is not None: ctx["defines_by_path"] = obj_by_path(args.defines_by_path) obj, tail = schema().decode(der, ctx=ctx)