libosmocore.git branch neels/ctrl_parsing updated. 0.10.2-72-g41dcec81

gitosis at gitosis at
Mon Dec 18 04:28:41 UTC 2017

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "An utility library for Open Source Mobile Communications".

The branch, neels/ctrl_parsing has been updated
  discards  179f3a01446556d0d8eeb816c0c2b68034495180 (commit)
  discards  c16258365ea80c9d35558e38eaa7f482eb357f24 (commit)
  discards  e56600fa42e0a229a1a5bcf95fc8d3b9a4c053ac (commit)
  discards  b61510abaeec814dfdf6f33ff5534c6ac1d6020f (commit)
  discards  4602cbff6231d7c106b880c5a4f45c2fca6e640f (commit)
  discards  0e759be493086f13ad476e08e5ba4c70b5a2c689 (commit)
  discards  4dbc6fca9a177941af2a3d3f8e3cabfb0825e80d (commit)
  discards  62feb5389c06f9fec19d21ba623195c59a2864cd (commit)
  discards  414901b2cd688783f56fced6311d5d7abfaaa98f (commit)
  discards  976214df85b004310ab49708d9170a1f5d14a039 (commit)
  discards  7fe60fe3d0576adbbd82919f43cfbb431a8d0c6a (commit)
  discards  65caf44d917c3bfa6c7fa2269aaa81d94981aad4 (commit)
  discards  62cc9bfee0c1cf30647d7f97261cc02519c797e9 (commit)
       via  41dcec816eb56d69dc69120e6bac06365d783a0a (commit)
       via  e554429d04bceaac626165d13b69948477482e06 (commit)
       via  ff1713e115789f1fff7f6fdc7f34b321fab27064 (commit)
       via  c4eaafd6a195491d93161b165ecd7af5456267d5 (commit)
       via  29ed24daee0351f5bd1947a74d0a7c40fdf96d7f (commit)
       via  41eec760c14a594042daab768e85e4a04d20dfc4 (commit)
       via  6115231b49382c6b21677c8ec985f61af93383c3 (commit)
       via  3ddb493599b61fcbe7dddb29ab6ed3a13914648c (commit)
       via  86f9b1902cb0294a2b3c096dce88a15439d1d661 (commit)
       via  32c8f8ac9999a0fa0791a7ef1bdd87210876e15f (commit)
       via  d8ad45804a605d9c0f22725aecf9a38450a35e31 (commit)
       via  5674c182b620bd7cb2c5a175382f8e72cecea1cf (commit)
       via  937ddea6cce45f3f6dcb8177ea86162f15ecb5f9 (commit)
       via  e5a2bdbc5501b892605a6a1fe7e30fb2f1546d42 (commit)
       via  3ef14a241afc123560e9a50d17948b040481b299 (commit)
       via  62e40855c2b1b50627dba5b187be8869e2cb2054 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (179f3a01446556d0d8eeb816c0c2b68034495180)
             N -- N -- N (41dcec816eb56d69dc69120e6bac06365d783a0a)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------

commit 41dcec816eb56d69dc69120e6bac06365d783a0a
Author: Neels Hofmeyr <neels at>
Date:   Mon Dec 18 03:12:01 2017 +0100

    add osmo_auth_c3(): separate from gsm_milenage()
    To send a Ciphering Mode Command, we may need to derive a Kc from UMTS AKA
    tokens. gsm_milenage() derives Kc from 3G tokens, but also derives an SRES.
    For SRES, it requires an OPC, which may need to be derived from OP first. All
    we need is a Kc, so we could feed a zero OPC ...  but to simplify the function
    call for cases where just a Kc is required, separate the c3 function out from
    gsm_milenage(), as osmo_auth_c3(). Obviously call osmo_auth_c3() from
    gsm_milenage() (meaning that osmo-hlr's 55.205 derived auc tests still cover
    exactly that implementation).
    Prepares: If04e405426c55a81341747a9b450a69188525d5c (osmo-msc)
    Related: OS#2745
    Change-Id: I85a1d6ae95ad9e5ce9524ef7fc06414848afc2aa

commit e554429d04bceaac626165d13b69948477482e06
Author: Neels Hofmeyr <neels at>
Date:   Sat Dec 16 01:18:53 2017 +0100

    ctrl: separate handling of GET_REPLY, SET_REPLY and TRAP
    So far, error reporting just says "Trap/Reply", more accurately report 'GET
    REPLY', 'SET REPLY' and 'TRAP' as appropriate.
    Change-Id: Ic25a251502499aeda4e2952ec4190a1fa0bebb01

commit ff1713e115789f1fff7f6fdc7f34b321fab27064
Author: Neels Hofmeyr <neels at>
Date:   Tue Sep 26 14:21:44 2017 +0200

    ctrl: tighten CTRL input parsing
    Validate that incoming CTRL commands...
    - have decimal IDs,
    - return error on trailing characters,
    - have invalid characters in variable identifiers,
    - send detailed error messages as reply to the requestor.
    Adjust ctrl_test.{c,ok}, which best show the change in behavior.
    Message handling causes log messages on stderr; previously, stderr was empty.
    Add '[ignore]' in so that the nonempty stderr doesn't cause test
    Change-Id: I96a9b6b6a3a5e0b80513aa9eaa727ae8c9c7d7a1

commit c4eaafd6a195491d93161b165ecd7af5456267d5
Author: Neels Hofmeyr <neels at>
Date:   Sat Dec 16 01:12:35 2017 +0100

    ctrl: on parse errors, return a detailed message to sender
    The recently added ctrl_cmd_parse2() returns non-NULL cmd with error messages
    upon parsing errors. In handle_control_read(), use ctrl_cmd_parse2() and send
    those back to the CTRL command sender as reply.
    Retain the previous "Command parser error" reply only in case ctrl_cmd_parse2()
    should return NULL, which shouldn't actually happen at all.
    Change-Id: Ie35a02555b76913bb12734a76fc40fde7ffb244d

commit 29ed24daee0351f5bd1947a74d0a7c40fdf96d7f
Author: Neels Hofmeyr <neels at>
Date:   Sat Dec 16 01:05:25 2017 +0100

    add ctrl_cmd_parse2() to return parsing errors
    If a control command fails to parse, we so far discard specific error messages
    and instead send just "Command parser error".
    In ctrl_cmd_parse() we actually compose detailed error replies, but in the end
    simply talloc_free() them and return NULL.
    A first step to report these errors to the ctrl command issuer is to not return
    NULL and instead return the cmd with type = CTRL_TYPE_ERROR. Add
    ctrl_cmd_parse2() to return such instead of NULL.
    To stay API compatible, provide ctrl_cmd_parse2() to return a cmd on errors.
    ctrl_cmd_parse() retains identical behavior but becomes just a simple wrapper
    around ctrl_cmd_parse2() which discards the cmd on error.
    No need really to deprecate ctrl_cmd_parse() yet; especially as long as
    compiler warnings might break jenkins builds.
    Change-Id: I5047c9f977d70b03eea77cbcfd2b96d43ea46880

commit 41eec760c14a594042daab768e85e4a04d20dfc4
Author: Neels Hofmeyr <neels at>
Date:   Fri Dec 15 20:41:28 2017 +0100

    ctrl_test: add two more current parsing bugs to prep for fix
    Change-Id: Id11bc326be2f0bc2746a928354e416495a18baf7

commit 6115231b49382c6b21677c8ec985f61af93383c3
Author: Neels Hofmeyr <neels at>
Date:   Sat Dec 16 04:05:21 2017 +0100

    ctrl: fix mem leak when handling GET_REPLY and SET_REPLY
    In ctrl_handle_msg() (code recently propagated from handle_control_read()),
    talloc_free() the parsed ctrl_cmd in all code paths. In particular, a free was
    missing in case ctrl_cmd_handle() returns CTRL_CMD_HANDLED.
    CTRL_CMD_HANDLED is triggered by GET_REPLY / SET_REPLY parsing, as show by
    ctrl_test.c. With the memleak fixed, adjust expected test output and make a
    detected mem leak abort the test immediately.
    Change-Id: Id583b413f8b8bd16e5cf92a8a9e8663903646381

commit 3ddb493599b61fcbe7dddb29ab6ed3a13914648c
Author: Neels Hofmeyr <neels at>
Date:   Sat Dec 16 04:01:54 2017 +0100

    ctrl_test: show memleak when receiving GET_REPLY and SET_REPLY commands
    The "memleak!" output shows messages that lack a talloc_free() of the parsed
    ctrl command buffer. The leak shall be fixed in a subsequent patch.
    Change-Id: I2c3e4d08b769b9cd77593362ea36a28d681cd042

commit 86f9b1902cb0294a2b3c096dce88a15439d1d661
Author: Neels Hofmeyr <neels at>
Date:   Sat Dec 16 05:38:37 2017 +0100

    ctrl_test: expand to test message handling and detect mem leaks
    Subsequent patches that tighten CTRL input validation will make the results
    more interesting.
    Change-Id: Idd4cc7d193db1a7d761f72ed33ed46eea450a78f

commit 32c8f8ac9999a0fa0791a7ef1bdd87210876e15f
Author: Neels Hofmeyr <neels at>
Date:   Sat Dec 16 03:57:56 2017 +0100

    ctrl: prep test: separate new ctrl_handle_msg() from handle_control_read()
    In order to allow unit testing the ctrl iface msgb handling, have a separate
    msgb entry point function from the actual fd read function.
    An upcoming patch will prove a memory leak in CTRL msgb handling by a unit test
    that needs this separation.
    Change-Id: Ie09e39db668b866eeb80399b82e7b04b8f5ad7c3

commit d8ad45804a605d9c0f22725aecf9a38450a35e31
Author: Neels Hofmeyr <neels at>
Date:   Sat Dec 16 01:03:37 2017 +0100

    ctrl_test.c: replace print_escaped() with new osmo_escape_str()
    Change-Id: I12d3828dcc925f97fde11c360f1d60f3bd8cad8b

commit 5674c182b620bd7cb2c5a175382f8e72cecea1cf
Author: Neels Hofmeyr <neels at>
Date:   Sat Dec 16 00:54:52 2017 +0100

    utils: add osmo_escape_str()
    To report invalid characters in identifiers, it is desirable to escape any
    weird characters. Otherwise we might print stray newlines or control characters
    in the log output.
    ctrl_test.c already uses a print_escaped() function, which will be replaced by
    osmo_escape_str() in a subsequent patch.
    control_cmd.c will use osmo_escape_str() to log invalid identifiers.
    Change-Id: Ic685eb63dead3967d01aaa4f1e9899e5461ca49a


Summary of changes:
 include/osmocom/crypt/auth.h |  2 ++
 src/gsm/auth_core.c          | 13 +++++++++++++
 src/gsm/gsm0808.c            |  3 ++-
 src/gsm/       |  1 +
 src/gsm/milenage/milenage.c  |  3 +--
 src/rate_ctr.c               |  3 +++
 src/utils.c                  |  6 +++---
 tests/ctrl/ctrl_test.c       |  1 -
 tests/gsm0808/gsm0808_test.c |  2 +-
 tests/stats/stats_test.c     |  7 ++++++-
 10 files changed, 32 insertions(+), 9 deletions(-)

An utility library for Open Source Mobile Communications

More information about the osmocom-commitlog mailing list