I have this patch, but am not sure how to test its validity. Looks sane though.
We were passing a uint64_t kc as uint8_t* to:
int gprs_cipher_run(uint8_t *out, uint16_t len, enum gprs_ciph_algo algo,
uint8_t *kc, uint32_t iv, enum gprs_cipher_direction dir);
so instead of passing kc's address, we would pass the kc *as* address.
See attached patch.
Any opinions and/or testers? Why would no-one have noticed this before?
Thanks!
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Holger Freyther, Harald Welte
Review at https://gerrit.osmocom.org/86
Revert "gsm48: move to hex TMSI representation"
This is a "flag" day change. Old OpenBSC break with new libosmocore because suddenly there is the 0x in front. I am afraid we need to find a better solution here.
I think we will need to create a gsm48_mi_to_string variant that takes a mode parameter to enable the TMSI mode and deprecate the old method.
Right now we should not break old versions of OpenBSC.
This reverts commit 78ad042f94afd5bf7de477ae634e9d2fdd9c9dc4.
Change-Id: I2f61e626f2f9088b492e1b643c3dcc9bce77d52b
---
M src/gsm/gsm48.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/86/86/1
diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index d0e050b..8a46f76 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -458,10 +458,11 @@
case GSM_MI_TYPE_NONE:
break;
case GSM_MI_TYPE_TMSI:
+ /* Table 10.5.4.3, reverse generate_mid_from_tmsi */
if (mi_len == GSM48_TMSI_LEN && mi[0] == (0xf0 | GSM_MI_TYPE_TMSI)) {
memcpy(&tmsi, &mi[1], 4);
tmsi = ntohl(tmsi);
- return snprintf(string, str_len, "0x%08X", tmsi);
+ return snprintf(string, str_len, "%u", tmsi);
}
break;
case GSM_MI_TYPE_IMSI:
--
To view, visit https://gerrit.osmocom.org/86
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f61e626f2f9088b492e1b643c3dcc9bce77d52b
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger(a)freyther.de>
>From Vadim Yanitskiy <axilirator(a)gmail.com>:
Vadim Yanitskiy has uploaded a new change for review.
https://gerrit.osmocom.org/62
Change subject: db.c: implemented incremental migration
......................................................................
db.c: implemented incremental migration
In the past, normal migration was possible only if the actual
schema version differed from the version used in DB by 1. For
example, if DB uses an old version 3 and you need to use it
with the code written for version 5, the check_db_revision()
will convert it to 4 and DB will still use incompatible schema
version during Osmo-NITB running time. After next run it will
be converted to version 5.
This patch replaces a set of 'else-if' checks by a 'switch'
without 'break' statements between 'case' labels (waterfall).
It makes you able to migrate from current version to the
latest despite any difference between them.
Change-Id: Ia9c2aa86f96b88ad8a710d0a23879ce219bc82dc
---
M openbsc/src/libmsc/db.c
1 file changed, 35 insertions(+), 18 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/62/1
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index e5017ae..b3235bb 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -374,9 +374,13 @@
{
dbi_result result;
const char *rev_s;
+ int db_rev = 0;
+ /* Make a query */
result = dbi_conn_query(conn,
- "SELECT value FROM Meta WHERE key='revision'");
+ "SELECT value FROM Meta "
+ "WHERE key = 'revision'");
+
if (!result)
return -EINVAL;
@@ -384,33 +388,46 @@
dbi_result_free(result);
return -EINVAL;
}
+
+ /* Fetch the DB schema revision */
rev_s = dbi_result_get_string(result, "value");
if (!rev_s) {
dbi_result_free(result);
return -EINVAL;
}
- if (!strcmp(rev_s, "2")) {
- if (update_db_revision_2()) {
- LOGP(DDB, LOGL_FATAL, "Failed to update database from schema revision '%s'.\n", rev_s);
- dbi_result_free(result);
- return -EINVAL;
- }
- } else if (!strcmp(rev_s, "3")) {
- if (update_db_revision_3()) {
- LOGP(DDB, LOGL_FATAL, "Failed to update database from schema revision '%s'.\n", rev_s);
- dbi_result_free(result);
- return -EINVAL;
- }
- } else if (!strcmp(rev_s, SCHEMA_REVISION)) {
- /* everything is fine */
- } else {
- LOGP(DDB, LOGL_FATAL, "Invalid database schema revision '%s'.\n", rev_s);
+
+ if (!strcmp(rev_s, SCHEMA_REVISION)) {
+ /* Everything is fine */
dbi_result_free(result);
+ return 0;
+ }
+
+ db_rev = atoi(rev_s);
+ dbi_result_free(result);
+
+ /* Incremental migration waterfall */
+ switch (db_rev) {
+ case 2:
+ if (update_db_revision_2())
+ goto error;
+ case 3:
+ if (update_db_revision_3())
+ goto error;
+
+ /* The end of waterfall */
+ break;
+ default:
+ LOGP(DDB, LOGL_FATAL,
+ "Invalid database schema revision '%d'.\n", db_rev);
return -EINVAL;
}
- dbi_result_free(result);
return 0;
+
+error:
+ LOGP(DDB, LOGL_FATAL, "Failed to update database "
+ "from schema revision '%d'.\n", db_rev);
+ return -EINVAL;
}
static int db_configure(void)
--
To view, visit https://gerrit.osmocom.org/62
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9c2aa86f96b88ad8a710d0a23879ce219bc82dc
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator(a)gmail.com>
>From Holger Freyther <holger(a)freyther.de>:
Holger Freyther has uploaded a new change for review.
https://gerrit.osmocom.org/64
Change subject: misc: Drop oRTP dependency as there is nothing using it
......................................................................
misc: Drop oRTP dependency as there is nothing using it
This seems to be a copy of paste of libsomo-abis. Let us just drop
it here and be done with it.
Change-Id: Ia5cb2b572fb5597605284d1c3f657d548aa790f2
---
M configure.ac
M debian/control
2 files changed, 1 insertion(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/64/64/1
diff --git a/configure.ac b/configure.ac
index 19f7d18..64a7a1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,7 +39,6 @@
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0)
dnl FIXME: We depend on libosmoabis by now until we can move LAPD code here
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.0.7)
-PKG_CHECK_MODULES(ORTP, ortp >= 0.15.0)
old_LIBS=$LIBS
AC_SEARCH_LIBS([sctp_send], [sctp], [
diff --git a/debian/control b/debian/control
index c5bcb43..3953414 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@
Section: libs
Priority: optional
Maintainer: Holger Hans Peter Freyther <holger(a)moiji-mobile.com>
-Build-Depends: debhelper (>= 9), autotools-dev, autoconf, automake, libtool, dh-autoreconf, libdpkg-perl, git, libosmocore-dev, libosmo-abis-dev, pkg-config, libortp-dev, libsctp-dev
+Build-Depends: debhelper (>= 9), autotools-dev, autoconf, automake, libtool, dh-autoreconf, libdpkg-perl, git, libosmocore-dev, libosmo-abis-dev, pkg-config, libsctp-dev
Standards-Version: 3.9.6
Vcs-Git: git://git.osmocom.org/libosmo-netif.git
Vcs-Browser: http://git.osmocom.org/gitweb?p=libosmo-netif.git;a=summary
--
To view, visit https://gerrit.osmocom.org/64
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5cb2b572fb5597605284d1c3f657d548aa790f2
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger(a)freyther.de>
>From Holger Freyther <holger(a)freyther.de>:
Holger Freyther has submitted this change and it was merged.
Change subject: todo: Add another of my wishlist items
......................................................................
todo: Add another of my wishlist items
Change-Id: I5a6c473a97d04aecae8101a024edb734bbe24401
Reviewed-on: https://gerrit.osmocom.org/27
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge(a)gnumonks.org>
---
M TODO
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/TODO b/TODO
index 6e39bc9..83f81ae 100644
--- a/TODO
+++ b/TODO
@@ -19,4 +19,6 @@
* Make the max size and rotate file configurable
+* Add a streaming option so one can pipe each packet into tshark
+ or a similar utility.
--
To view, visit https://gerrit.osmocom.org/27
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5a6c473a97d04aecae8101a024edb734bbe24401
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger(a)freyther.de>
Gerrit-Reviewer: Harald Welte <laforge(a)gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger(a)freyther.de>
Gerrit-Reviewer: Jenkins Builder
>From Harald Welte <laforge(a)gnumonks.org>:
Harald Welte has posted comments on this change.
Change subject: todo: Add another of my wishlist items
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/27
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I5a6c473a97d04aecae8101a024edb734bbe24401
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger(a)freyther.de>
Gerrit-Reviewer: Harald Welte <laforge(a)gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger(a)freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No
>From Neels Hofmeyr <nhofmeyr(a)sysmocom.de>:
Neels Hofmeyr has submitted this change and it was merged.
Change subject: api doc: auth_core.c: add \returns, cosmetic
......................................................................
api doc: auth_core.c: add \returns, cosmetic
Add various missing \returns doxygen entries.
In osmo_auth_3g_from_2g(), also adjust two comment-closing instances to
match common style and add a period to end a sentence.
(The recent addition of osmo_auth_3g_from_2g() raised my attention, and I added
more return value docs while at it.)
Change-Id: Iea71eb666bc061acb6b14215f398bd38d17b3ad3
Reviewed-on: https://gerrit.osmocom.org/33
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger(a)freyther.de>
---
M src/gsm/auth_core.c
1 file changed, 9 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
Holger Freyther: Looks good to me, approved
diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c
index b78cdd5..f1ec2ed 100644
--- a/src/gsm/auth_core.c
+++ b/src/gsm/auth_core.c
@@ -43,6 +43,7 @@
/*! \brief Register an authentication algorithm implementation with the core
* \param[in] impl Structure describing implementation and it's callbacks
+ * \returns 0 on success, or a negative error code on failure
*
* This function is called by an authentication implementation plugin to
* register itself with the authentication core.
@@ -64,6 +65,7 @@
/*! \brief Load all available authentication plugins from the given path
* \param[in] path Path name of the directory containing the plugins
+ * \returns number of plugins loaded in case of success, negative in case of error
*
* This function will load all plugins contained in the specified path.
*/
@@ -75,6 +77,7 @@
/*! \brief Determine if a given authentication algorithm is supported
* \param[in] algo Algorithm which should be checked
+ * \returns 1 if algo is supported, 0 if not, negative error on failure
*
* This function is used by an application to determine at runtime if a
* given authentication algorithm is supported or not.
@@ -111,10 +114,12 @@
/*! \brief Generate 3G CK + IK from 2G authentication vector
* \param vec Authentication Vector to be modified
+ * \returns 1 if the vector was changed, 0 otherwise
*
* This function performs the C5 and C4 functions to derive the UMTS key
* material from the GSM key material in the supplied vector, _if_ the input
- * vector doesn't yet have UMTS authentication capability */
+ * vector doesn't yet have UMTS authentication capability.
+ */
int osmo_auth_3g_from_2g(struct osmo_auth_vector *vec)
{
if ((vec->auth_types & OSMO_AUTH_TYPE_GSM) &&
@@ -124,7 +129,7 @@
/* We cannot actually set OSMO_AUTH_TYPE_UMTS as we have no
* AUTN and no RES, and thus can only perform GSM
* authentication with this tuple.
- * */
+ */
return 1;
}
@@ -135,6 +140,7 @@
* \param[out] vec Generated authentication vector
* \param[in] aud Subscriber-specific key material
* \param[in] _rand Random challenge to be used
+ * \returns 0 on success, negative error on failure
*
* This function performs the core cryptographic function of the AUC,
* computing authentication triples/quintuples based on the permanent
@@ -167,6 +173,7 @@
* \param[in] rand_auts RAND value sent by the SIM/MS
* \param[in] auts AUTS value sent by the SIM/MS
* \param[in] _rand Random challenge to be used to generate vector
+ * \returns 0 on success, negative error on failure
*
* This function performs a special variant of the core cryptographic
* function of the AUC: computing authentication triples/quintuples
--
To view, visit https://gerrit.osmocom.org/33
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iea71eb666bc061acb6b14215f398bd38d17b3ad3
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Holger Freyther <holger(a)freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr(a)sysmocom.de>
Hi,
as discussed at OsmoDevCon and the mails from last week. The following list of projects have moved to use gerrit for codereview:
* libosmocore.git
* libosmo-abis.git
* libosmo-netif.git
* libosmo-sccp.git
* libsmpp34.git
* openbsc.git
* osmo-bts.git
* osmo-iuh.git
* osmo-pcu.git
* cellmgr-ng.git
* osmo-sip-connector.git
I have created this[1] page with the minimum to set-up gerrit as git-remote, register, configure the account and then hopefully the most frequently used comments.
kind regards
holger
[1] http://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit