Project

General

Profile

Bug #4001

osmo-mgw: Make sure non-sdp MGCP text is handled case-insensitive

Added by pespin 5 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
05/14/2019
Due date:
% Done:

100%


Description

MGCP RFC 3435 (https://tools.ietf.org/html/rfc3435) states almost all text has to be handled in a case-insensitive way, except SDP parts:

Commands and responses SHALL be encoded in accordance with the grammar, which, per RFC 2234, is case-insensitive except for the SDP part.

And even more explicitly in 3.2 section:

Unless otherwise noted or dictated by other referenced standards (e.g., SDP), each component in the command header is case insensitive.  This goes for verbs as well as parameters and values, and hence all comparisons MUST treat upper and lower case as well as combinations of these as being equal.

However, grepping for "casecmp" (str{n}casecmp) in osmo-mgw shows almost no use:

$ ag casecmp
src/libosmo-mgcp/mgcp_codec.c
287:    if (strcasecmp(codec_name, codec->subtype_name) == 0)

While grepping for str{n}cmp shows a lot more use. That means we need o switch to str{n}casecmp in some of them.

History

#1 Updated by pespin 5 months ago

Pushed this one to gerrit to fix the issue for X-Osmux:
https://gerrit.osmocom.org/#/c/osmo-mgw/+/14043 mgw, mgcp-li: Handle X-Osmux param name as case insensitive

other params/verbs/etc. still need to be fixed too.

#2 Updated by pespin 5 months ago

Similar fix provided in osmo-bsc_nat from openbsc.git:
https://gerrit.osmocom.org/#/c/openbsc/+/14131 mgcp: Handle CI ad X-Osmux param name as case insensitive

#3 Updated by pespin 4 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 90

Provided several patches for osmo-mgw with all case-sensitive parts I found that apply (no SDP):

91b971fd mgw: Allow receiving uppercase noanswer keyword
e4aaa176 mgw: Allow receiving lowercase X-Osmo-Ign Callid field
cd671a87 mgw: Allow receiving lowercase MGCP header keyword
c117155a mgw: Make check of duplicated LCO fields case insensitive
a1d5df1c mgw: Support receiving lowercase LCO codec
26dd0b49 mgw: Support receiving uppercase connection mode
2902f8e0 mgcp-cli: Support uppercase header parameters
938d3ae4 mgw: Support uppercase header parameters
0dfd31be mgw: Support uppercase LCO options

Once merged, we can close the ticket.

#4 Updated by pespin 4 months ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

Merged, closing.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)