From 15fcedaab8d00001395b44d6d500312b2b0a06e3 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 20 May 2018 15:18:24 +0300 Subject: [PATCH] Optionally disallow BER in utility --- pyderasn.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- 2.44.0