diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-03-27 17:53:38 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-03-28 15:18:36 +0100 |
commit | 23bb7b362798d7459929d5eca1a913f94ad77453 (patch) | |
tree | 15e2ba5ebbc7a374c8c2b1c71ccadea0f9d6be8f /openbsc/tests/vty_test_runner.py | |
parent | 4087e066547b1377f743c884e8950acf7c0d82c5 (diff) |
Replace broken ipa_ccm_idtag APIs with new ipa_ccm_id ones
ipa_ccm_idtag_parse_off is broken, and can only be used with
len_offset=1 on ID Request messages, otherwise won't work correctly.
Modify ipa_ccm_idtag_parse to at least parse those correctly, and
document the limitations.
Those two functions are already deprecated and only used in openbsc by 3
callers:
* ipa_ccm_idtag_parse in ussd_read_cb(): Broken, that function can only
work for Requests and it's used to parse a Response.
* ipa_ccm_idtag_parse_off in forward_sccp_to_msc (NAT): Broken, it can
only be used to parse Requests and it's used to parse a Response.
Furthermore, len_offset=2 is passed which makes no sense and most
probably it fails always, or can even make the program crash.
* ipa_ccm_idtag_parse_off in (answer_challenge): This one is fine and
could actually be replaced with ipa_ccm_id_get_parse after libosmocore
commit (see below) is merged.
See libosmocore I6efc852dfc041192f554e41a58290a0f63298021 for more information.
As a consequence of the fixes, osmo-bsc-nat now parses messages sent
from VTY test correctly and thus it goes into processing them instead of
silently dropping them. As a result, some VTY tests fail because they
are sending incorrect format (missing NULL char in unit id strings) and
osmo-bsc-nat closses its connection (due to bad auth).
Change-Id: I3b995f8ef0b48c0a5b3375e42926641934359cd2
Diffstat (limited to 'openbsc/tests/vty_test_runner.py')
-rw-r--r-- | openbsc/tests/vty_test_runner.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 5afcd2ebd..ca0b8794a 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -922,8 +922,8 @@ class TestVTYNAT(TestVTYGenericBSC): self.assertEqual(data, "\x00\x01\xfe\x04") print "Going to send ID_RESP response" - res = ussdSocket.send(IPA().id_resp(IPA().tag_name('key'))) - self.assertEqual(res, 10) + res = ussdSocket.send(IPA().id_resp(IPA().tag_name('key'+'\0'))) + self.assertEqual(res, 11) # initiating PING/PONG cycle to know, that the ID_RESP message has been processed @@ -1072,7 +1072,7 @@ def ipa_handle_resp(x, tk, verbose = False, proc=None): while True: print "\tsending IPA identity(%s) at %s" % (tk, time.strftime("%T")) try: - x.send(IPA().id_resp(IPA().identity(name = tk.encode('utf-8')))) + x.send(IPA().id_resp(IPA().identity(name = (tk+'\0').encode('utf-8')))) print "\tdone sending IPA identity(%s) at %s" % (tk, time.strftime("%T")) break |