Commit Graph

9 Commits

Author SHA1 Message Date
Harald Welte 212d0c4c76 osmo_sccp_addr_encode(): Catch some more errors and log them
Log errors in case the user provides global title indicators or
nature-of-address indicators that exceed the permitted value range

Change-Id: I493b7810bdc58e448f496565ded36f9dce2c1226
2017-10-27 18:00:12 +02:00
Harald Welte c755c1d1b0 osmo_sccp_addr_encode(): Fix truncation of point codes
In osmo_sccp_addr_encode(), we accidentially truncated all point
codes to 10 bits, where in reality we should have truncated them to
14 bits: One 'f' was missing in the bit-mask.

Closes: OS#2441
Change-Id: Iad67b674b5b5fd41996aa898a131e98900842dd8
2017-10-27 14:36:26 +00:00
Harald Welte 4e1dfa8677 osmo_sccp_addr_encode(): Check for more erroneous situations
... and bail out + log an error.

Change-Id: I2a419343e55edad39c59e763d11046c5a439444d
2017-10-27 14:36:26 +00:00
Neels Hofmeyr 9d1a3f6645 cosmetic: ws in log
Change-Id: If5a56ec170d4e91ce070f6fa9c9cfe5bbc121186
2017-08-09 13:54:44 +02:00
Harald Welte 872c6b2a8e SUA-to-SCCP: Fix use of Called/Calling vs. Src/Dest Address
SUA uses different semantics (source / destination) address, while SCCP
uses Calling/CalledParty. This leads to some confusion.  At least in the
CR/CORE and CREF/COREF case, the CallingParty equals the SRC_ADDR.

Change-Id: I1c641aac7b53c6de7c4e369aaf3004523bd85936
2017-05-04 09:07:21 +02:00
Harald Welte b354652502 osmo_sccp_addr_parse() Fix point code integer precision handling
"(cur[1] << 8) & 0x3f" is always 0 regardless of the values of its
operands.

Change-Id: Ie47e632f4bca490baf4282dc5d55ee55ca7f1ae8
Fixes: coverity CID#166932
2017-04-27 12:31:01 +02:00
Harald Welte bf849e4bf0 sccp2sua: Avoid array overruns in sccp_is_{mandatory,optional}()
Change-Id: Ied76c21e20332514c2ad364eea5fc17e24a3f4c6
Fixes: coverity CID#166943, CID#166980
2017-04-27 10:55:03 +02:00
Harald Welte 7fa3c9972d sua2sccp: Only encode SCCP options permitted for given msg type
The SCCP spec clearly defines which optional information element each of
the messages supports.  We must make sure to not include any other
options when converting from SUA.  SUA has more relaxed rules about
this, and e.g. supports SRC and DEST ADDR in the COAK, while the SCCP CC
only permits a CalledParty, but not CallingParty.

This was found when interoperating against the Ericsson TTCN-3 SCCP
implementation for Eclipse Titan.

Change-Id: I7d9e23dec1d3e786d291abd270a261704593befc
2017-04-13 15:59:52 +02:00
Harald Welte e937532ae9 Add SCCP <-> SUA message transcoding routines
Change-Id: I8151a9b08a0b0ca97b9c73105ad4548512ce3be8
2017-04-10 11:48:34 +02:00