From c0ea1495558d380ee6d8f74524885a6607fa0ab6 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 6 Jul 2024 11:26:14 +0200 Subject: [PATCH] pySim.esim: Allow calling compile_asn1_subdir() with non-DER coddec this isn't needed for the on-wire format, but can be useful for debug output in GSER or JER. Change-Id: I1de4b9506a92d60f582c328a180760332584f9e4 --- pySim/esim/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pySim/esim/__init__.py b/pySim/esim/__init__.py index 1f7ea160..fbb90b90 100644 --- a/pySim/esim/__init__.py +++ b/pySim/esim/__init__.py @@ -3,7 +3,7 @@ from typing import Optional from importlib import resources -def compile_asn1_subdir(subdir_name:str): +def compile_asn1_subdir(subdir_name:str, codec='der'): """Helper function that compiles ASN.1 syntax from all files within given subdir""" import asn1tools asn_txt = '' @@ -14,7 +14,7 @@ def compile_asn1_subdir(subdir_name:str): asn_txt += "\n" #else: #print(resources.read_text(__name__, 'asn1/rsp.asn')) - return asn1tools.compile_string(asn_txt, codec='der') + return asn1tools.compile_string(asn_txt, codec=codec) # SGP.22 section 4.1 Activation Code