Attention is currently required from: Hoernchen.
osmith has uploaded a new patch set (#2) to the change originally created by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27342?usp=email )
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: simtrace emulation: check that port is connected to prevent errors due to delayed msg
......................................................................
simtrace emulation: check that port is connected to prevent errors due to delayed msg
Change-Id: I5d5dda0cf1443223b2615f1059cfdcf698f1acae
---
M library/SIMTRACE_Emulation.ttcn
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/27342/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27342?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5d5dda0cf1443223b2615f1059cfdcf698f1acae
Gerrit-Change-Number: 27342
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Attention is currently required from: Hoernchen.
osmith has uploaded a new patch set (#2) to the change originally created by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27341?usp=email )
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: octsim: initial commit
......................................................................
octsim: initial commit
This testsuite is for the sysmoOCTSIM.
Related: https://www.sysmocom.de/products/sim/sysmooctsim/
Tweaked-by: Eric Wild <ewild(a)sysmocom.de>
Tweaked-by: Oliver Smith <osmith(a)sysmocom.de>
Change-Id: Iada6422d694eb5fc862477c8b43b8642c8d96692
---
M Makefile
A octsim/OCTSIM_Tests.cfg
A octsim/OCTSIM_Tests.default
A octsim/OCTSIM_Tests.ttcn
A octsim/README.md
A octsim/gen_links.sh
A octsim/regen_makefile.sh
7 files changed, 313 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/41/27341/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27341?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iada6422d694eb5fc862477c8b43b8642c8d96692
Gerrit-Change-Number: 27341
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Attention is currently required from: Hoernchen, laforge.
osmith has uploaded a new patch set (#2) to the change originally created by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27343?usp=email )
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Verified-1 by Jenkins Builder
Change subject: simtrace emulation: set usb configuration
......................................................................
simtrace emulation: set usb configuration
Tweaked-by: Oliver Smith <osmith(a)sysmocom.de>
Change-Id: I9def79343b4d2575f8b1bc7b9c9c8170b631ed49
---
M deps/Makefile
M library/SIMTRACE_Emulation.ttcn
2 files changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/43/27343/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27343?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I9def79343b4d2575f8b1bc7b9c9c8170b631ed49
Gerrit-Change-Number: 27343
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: dexter, laforge.
Hoernchen has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/40464?usp=email )
Change subject: smdpp: add proper tls support, cert generation FOR TESTING
......................................................................
Patch Set 6:
(7 comments)
File contrib/generate_smdpp_certs.py:
https://gerrit.osmocom.org/c/pysim/+/40464/comment/339f62a9_c8663cc1?usp=em… :
PS5, Line 2:
> To me this looks like an independent tool. […]
no, this is the tool and these are the options, these things belong together and make absolutely no sense as single commits with random mystery options and useless certs.
File osmo-smdpp.py:
https://gerrit.osmocom.org/c/pysim/+/40464/comment/4382ca7d_ea805b69?usp=em… :
PS5, Line 26: from pathlib import Path
> You have moved a lot of those imports from another code location. […]
Done
https://gerrit.osmocom.org/c/pysim/+/40464/comment/bc8c1331_3407f1b1?usp=em… :
PS5, Line 53:
> We now support SSL and we have means to point to different certificate sub directories. […]
not related to this patch at all, we cann add stuff if we need it later.
https://gerrit.osmocom.org/c/pysim/+/40464/comment/6ee98918_c7b38b8d?usp=em… :
PS5, Line 586: parser.add_argument("-p", "--port", help="TCP port to bind HTTP to", default=8000)
> Maybe 8443, since we now support SSL?
no, because that is being used by something else on my system, we really do not want to default to a port commonly used for anything like https for a toy smdpp.
https://gerrit.osmocom.org/c/pysim/+/40464/comment/3817ef0e_da2c40d3?usp=em… :
PS5, Line 587: parser.add_argument("-c", "--certpath", help=f"cert subdir relative to {DATA_DIR}", default="certs")
> I think --certpath is a bit irritating as one may thing that it is possible to provide an absolute p […]
Done .. the help line literally explains that it is relative
https://gerrit.osmocom.org/c/pysim/+/40464/comment/a7b3dcc9_fe1f3390?usp=em… :
PS5, Line 588: parser.add_argument("-s", "--nossl", help="do NOT use ssl", action='store_true', default=False)
> I wonder if this may break anything when osmo-smdpp suddenly supports SSL by default. […]
The number of users is probably... low.. anyway.
https://gerrit.osmocom.org/c/pysim/+/40464/comment/f5aa1340_7306aee3?usp=em… :
PS5, Line 591: common_cert_path = os.path.join(DATA_DIR, args.certpath)
> (see above) Maybe having DATA_DIR as a commandline parameter would be a good idea.
I dont't need it, and it is not related to this patch either.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/40464?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I84b2666422b8ff565620f3827ef4d4d7635a21be
Gerrit-Change-Number: 40464
Gerrit-PatchSet: 6
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 25 Jun 2025 08:51:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/40526?usp=email )
Change subject: smdpp: fix asn1tool OBJECT IDENTIFIER decoding
......................................................................
smdpp: fix asn1tool OBJECT IDENTIFIER decoding
Change-Id: Ic678e6c4a4c1a01de87a8dce26f4a5e452e8562a
---
M osmo-smdpp.py
1 file changed, 87 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/26/40526/1
diff --git a/osmo-smdpp.py b/osmo-smdpp.py
index 41c3562..1bdc533 100755
--- a/osmo-smdpp.py
+++ b/osmo-smdpp.py
@@ -17,6 +17,93 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# asn1tools issue https://github.com/eerimoq/asn1tools/issues/194
+# must be first here
+import asn1tools
+import asn1tools.codecs.ber
+import asn1tools.codecs.der
+# do not move the code
+def fix_asn1_oid_decoding():
+ fix_asn1_schema = """
+ TestModule DEFINITIONS ::= BEGIN
+ TestOid ::= SEQUENCE {
+ oid OBJECT IDENTIFIER
+ }
+ END
+ """
+
+ fix_asn1_asn1 = asn1tools.compile_string(fix_asn1_schema, codec='der')
+ fix_asn1_oid_string = '2.999.10'
+ fix_asn1_encoded = fix_asn1_asn1.encode('TestOid', {'oid': fix_asn1_oid_string})
+ fix_asn1_decoded = fix_asn1_asn1.decode('TestOid', fix_asn1_encoded)
+
+ if (fix_asn1_decoded['oid'] != fix_asn1_oid_string):
+ # ASN.1 OBJECT IDENTIFIER Decoding Issue:
+ #
+ # In ASN.1 BER/DER encoding, the first two arcs of an OBJECT IDENTIFIER are
+ # combined into a single value: (40 * arc0) + arc1. This is encoded as a base-128
+ # variable-length quantity (and commonly known as VLQ or base-128 encoding)
+ # as specified in ITU-T X.690 §8.19, it can span multiple bytes if
+ # the value is large.
+ #
+ # For arc0 = 0 or 1, arc1 must be in [0, 39]. For arc0 = 2, arc1 can be any non-negative integer.
+ # All subsequent arcs (arc2, arc3, ...) are each encoded as a separate base-128 VLQ.
+ #
+ # The decoding bug occurs when the decoder does not properly split the first
+ # subidentifier for arc0 = 2 and arc1 >= 40. Instead of decoding:
+ # - arc0 = 2
+ # - arc1 = (first_subidentifier - 80)
+ # it may incorrectly interpret the first_subidentifier as arc0 = (first_subidentifier // 40),
+ # arc1 = (first_subidentifier % 40), which is only valid for arc1 < 40.
+ #
+ # This patch handles it properly for all valid OBJECT IDENTIFIERs
+ # with large second arcs, by applying the ASN.1 rules:
+ # - if first_subidentifier < 40: arc0 = 0, arc1 = first_subidentifier
+ # - elif first_subidentifier < 80: arc0 = 1, arc1 = first_subidentifier - 40
+ # - else: arc0 = 2, arc1 = first_subidentifier - 80
+ #
+ # This problem is not uncommon, see for example https://github.com/randombit/botan/issues/4023
+
+ def fixed_decode_object_identifier(data, offset, end_offset):
+ """Decode ASN.1 OBJECT IDENTIFIER from bytes to dotted string, fixing large second arc handling."""
+ def read_subidentifier(data, offset):
+ value = 0
+ while True:
+ b = data[offset]
+ value = (value << 7) | (b & 0x7F)
+ offset += 1
+ if not (b & 0x80):
+ break
+ return value, offset
+
+ subid, offset = read_subidentifier(data, offset)
+ if subid < 40:
+ first = 0
+ second = subid
+ elif subid < 80:
+ first = 1
+ second = subid - 40
+ else:
+ first = 2
+ second = subid - 80
+ arcs = [first, second]
+
+ while offset < end_offset:
+ subid, offset = read_subidentifier(data, offset)
+ arcs.append(subid)
+
+ return '.'.join(str(x) for x in arcs)
+
+ asn1tools.codecs.ber.decode_object_identifier = fixed_decode_object_identifier
+ asn1tools.codecs.der.decode_object_identifier = fixed_decode_object_identifier
+
+ # test our patch
+ asn1 = asn1tools.compile_string(fix_asn1_schema, codec='der')
+ decoded = asn1.decode('TestOid', fix_asn1_encoded)['oid']
+ assert fix_asn1_oid_string == str(decoded)
+
+fix_asn1_oid_decoding()
+
from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature, encode_dss_signature
from cryptography import x509
from cryptography.exceptions import InvalidSignature
@@ -37,7 +124,6 @@
from base64 import b64decode
from klein import Klein
from twisted.web.iweb import IRequest
-import asn1tools
from osmocom.utils import h2b, b2h, swap_nibbles
@@ -140,8 +226,6 @@
if isinstance(ext_der, bytes):
try:
- import asn1tools
-
permitted_eins_schema = """
PermittedEins DEFINITIONS ::= BEGIN
PermittedEins ::= SEQUENCE OF PrintableString
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/40526?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic678e6c4a4c1a01de87a8dce26f4a5e452e8562a
Gerrit-Change-Number: 40526
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>