lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

May 2023

  • 1 participants
  • 2583 discussions
[S] Change in libosmocore[master]: osmo_io: Fix sending msgb structures
by daniel 30 May '23

30 May '23
Attention is currently required from: arehbein. daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33084 ) Change subject: osmo_io: Fix sending msgb structures ...................................................................... Patch Set 2: Code-Review-1 (1 comment) This change is ready for review. Patchset: PS2: Re-adding the comments from the private change: > > daniel: > > Can you elaborate on that? Right now the expectation is that the user calls write_enable separately. I guess we could change the behaviour if we never want to enqueue messages that should not be sent immediately. > > > > In that case we should also change the sendmsg function below to behave the same. > arehbein: > A couple of reasons which together strongly suggested to me it should be like this: > > * osmo_stream_srv_send() was broken because the 'write enable' was missing > * The doc for osmo_iofd_write_msgb() says /*! Send a message through a connected socket > * The function name suggests that the write should be caused by it. > > Maybe the last two points are also why the write enable was omitted in osmo_stream_srv_send() . > > Admittedly, I didn't check the equivalent *_cli_* function... > however I'm in favor of renaming the function ( osmo_iofd_write_msgb -> osmo_iofd_append_msgb maybe?) and fixing the doc if we stick with the current approach/the one you are mentioning. I can see that it's confusing as it is right now. Maybe the issue is that we currently require a call to read/write_enable when opening the io_fd. Instead it should probably be the default. If the user calls read/write_disable it's much more obvious that they'll need to call *_enable again. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33084 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie2a9c93f820fa372a1d527c805fd0fe2cff0eb49 Gerrit-Change-Number: 33084 Gerrit-PatchSet: 2 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Comment-Date: Tue, 30 May 2023 13:19:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: libosmogsm: Support authentication with 256-bit K and/or OP/OPc
by Jenkins Builder 30 May '23

30 May '23
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33087 ) Change subject: libosmogsm: Support authentication with 256-bit K and/or OP/OPc ...................................................................... Patch Set 1: (1 comment) File include/osmocom/crypt/auth.h: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-7611): https://gerrit.osmocom.org/c/libosmocore/+/33087/comment/ee98614f_1b49e1f0 PS1, Line 52: uint8_t k_len; /*!< K length (in bytes): 16 or 32 */ please, no space before tabs -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33087 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie775fedba4a3fa12314c0f7c8a369662ef6a40df Gerrit-Change-Number: 33087 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Tue, 30 May 2023 13:10:20 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: osmo-auc-gen: Convert over to osmo_auth_gen_vec*2 API
by laforge 30 May '23

30 May '23
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33090 ) Change subject: osmo-auc-gen: Convert over to osmo_auth_gen_vec*2 API ...................................................................... osmo-auc-gen: Convert over to osmo_auth_gen_vec*2 API This allows the tool to support K/OPc lengths != 128 bit. Let's add more length checks of command-line arguments while we're adding those checks for K/OPc. Change-Id: Iffed02ec0fc9c9a996da6f218d67314e381cbb29 --- M utils/osmo-auc-gen.c 1 file changed, 47 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/33090/1 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index e3e1b43..765ca0b 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -80,7 +80,7 @@ } } -static struct osmo_sub_auth_data test_aud = { +static struct osmo_sub_auth_data2 test_aud = { .type = OSMO_AUTH_TYPE_NONE, .algo = OSMO_AUTH_ALG_NONE, }; @@ -114,6 +114,7 @@ struct osmo_auth_vector *vec = &_vec; uint8_t _rand[16], _auts[14]; uint64_t sqn = 0; + /* 3GPP TS 33.102 6.3.7: "The authentication key (K) shall have a length of 128 bits or 256 bits." */ unsigned int ind = 0; int rc, option_index; int rand_is_set = 0; @@ -174,10 +175,21 @@ case OSMO_AUTH_TYPE_GSM: rc = osmo_hexparse(optarg, test_aud.u.gsm.ki, sizeof(test_aud.u.gsm.ki)); + if (rc != sizeof(test_aud.u.gsm.ki)) { + fprintf(stderr, "Invalid Ki length %d\n", rc); + exit(2); + } break; case OSMO_AUTH_TYPE_UMTS: rc = osmo_hexparse(optarg, test_aud.u.umts.k, sizeof(test_aud.u.umts.k)); + /* 3GPP TS 33.102 6.3.7: "The authentication key (K) shall have a length of + * 128 bits or 256 bits." */ + if (rc != 16 && rc != 32) { + fprintf(stderr, "Invalid K length %d\n", rc); + exit(2); + } + test_aud.u.umts.k_len = rc; break; default: fprintf(stderr, "please specify 2g/3g first!\n"); @@ -190,6 +202,11 @@ } rc = osmo_hexparse(optarg, test_aud.u.umts.opc, sizeof(test_aud.u.umts.opc)); + if (rc != 16 && rc != 32) { + fprintf(stderr, "Invalid OPC length %d\n", rc); + exit(2); + } + test_aud.u.umts.opc_len = rc; test_aud.u.umts.opc_is_op = 0; break; case 'O': @@ -199,6 +216,11 @@ } rc = osmo_hexparse(optarg, test_aud.u.umts.opc, sizeof(test_aud.u.umts.opc)); + if (rc != 16 && rc != 32) { + fprintf(stderr, "Invalid OP length %d\n", rc); + exit(2); + } + test_aud.u.umts.opc_len = rc; test_aud.u.umts.opc_is_op = 1; break; case 'A': @@ -216,6 +238,10 @@ } rc = osmo_hexparse(optarg, test_aud.u.umts.amf, sizeof(test_aud.u.umts.amf)); + if (rc != 2) { + fprintf(stderr, "Invalid AMF length %d\n", rc); + exit(2); + } break; case 's': if (test_aud.type != OSMO_AUTH_TYPE_UMTS) { @@ -242,6 +268,10 @@ break; case 'r': rc = osmo_hexparse(optarg, _rand, sizeof(_rand)); + if (rc != sizeof(_rand)) { + fprintf(stderr, "Invalid RAND length %d\n", rc); + exit(2); + } rand_is_set = 1; break; case 'I': @@ -316,9 +346,9 @@ } if (!auts_is_set) - rc = osmo_auth_gen_vec(vec, &test_aud, _rand); + rc = osmo_auth_gen_vec2(vec, &test_aud, _rand); else - rc = osmo_auth_gen_vec_auts(vec, &test_aud, _auts, _rand, _rand); + rc = osmo_auth_gen_vec_auts2(vec, &test_aud, _auts, _rand, _rand); if (rc < 0) { if (!auts_is_set) fprintf(stderr, "error generating auth vector\n"); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33090 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iffed02ec0fc9c9a996da6f218d67314e381cbb29 Gerrit-Change-Number: 33090 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: libosmogsm: Ensure MILENAGE + XOR-3G K length is 128 bit
by laforge 30 May '23

30 May '23
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33089 ) Change subject: libosmogsm: Ensure MILENAGE + XOR-3G K length is 128 bit ...................................................................... libosmogsm: Ensure MILENAGE + XOR-3G K length is 128 bit Since Change-Id Ie775fedba4a3fa12314c0f7c8a369662ef6a40df we are supporting K-lengths != 128 bit. However, our existing MILENAGE and XOR-3G algorithms only support that key length, so let's add some explicit checks for that. Change-Id: Iae8b93cf059abda087101cdd01bbcf92d355753b --- M src/gsm/auth_milenage.c M src/gsm/auth_xor.c 2 files changed, 33 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/33089/1 diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 84780c6..9e94293 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -19,6 +19,7 @@ * */ +#include <errno.h> #include <osmocom/crypt/auth.h> #include <osmocom/core/bits.h> #include "milenage/common.h" @@ -57,6 +58,11 @@ OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_MILENAGE); + if (aud->u.umts.k_len != 16) + return -EINVAL; + if (aud->u.umts.opc_len != 16) + return -EINVAL; + opc = gen_opc_if_needed(aud, gen_opc); if (!opc) return -1; @@ -154,6 +160,11 @@ OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_MILENAGE); + if (aud->u.umts.k_len != 16) + return -EINVAL; + if (aud->u.umts.opc_len != 16) + return -EINVAL; + opc = gen_opc_if_needed(aud, gen_opc); rc = milenage_auts(opc, aud->u.umts.k, rand_auts, auts, sqn_out); diff --git a/src/gsm/auth_xor.c b/src/gsm/auth_xor.c index c94b02f..a506a03 100644 --- a/src/gsm/auth_xor.c +++ b/src/gsm/auth_xor.c @@ -55,9 +55,11 @@ /* Step 1: xdout = (ki or k) ^ rand */ if (aud->type == OSMO_AUTH_TYPE_GSM) xor(xdout, aud->u.gsm.ki, _rand, sizeof(xdout)); - else if (aud->type == OSMO_AUTH_TYPE_UMTS) + else if (aud->type == OSMO_AUTH_TYPE_UMTS) { + if (aud->u.umts.k_len != 16) + return -EINVAL; xor(xdout, aud->u.umts.k, _rand, sizeof(xdout)); - else + } else return -ENOTSUP; /** @@ -141,9 +143,11 @@ /* Step 1: xdout = (ki or k) ^ rand */ if (aud->type == OSMO_AUTH_TYPE_GSM) xor(xdout, aud->u.gsm.ki, _rand, sizeof(xdout)); - else if (aud->type == OSMO_AUTH_TYPE_UMTS) + else if (aud->type == OSMO_AUTH_TYPE_UMTS) { + if (aud->u.umts.k_len != 16) + return -EINVAL; xor(xdout, aud->u.umts.k, _rand, sizeof(xdout)); - else + } else return -ENOTSUP; /* Step 2: ak = xdout[2-8] */ -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33089 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iae8b93cf059abda087101cdd01bbcf92d355753b Gerrit-Change-Number: 33089 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: libosmogsm: Add OSMO_ASSERT() to ensure correct algorithm
by laforge 30 May '23

30 May '23
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33088 ) Change subject: libosmogsm: Add OSMO_ASSERT() to ensure correct algorithm ...................................................................... libosmogsm: Add OSMO_ASSERT() to ensure correct algorithm Let's make sure that nobody ever ends up calling the algo_impl call-backs with data of a non-matching algorithm. This should never happen at all, as all normal users should go through the auth_core.c:osmo_auth_gen_vec* API, which dispatches based on algorithm. Change-Id: I22b504b6cffb4999b2f14772fffcb2f6f02c198c --- M src/gsm/auth_comp128v1.c M src/gsm/auth_comp128v23.c M src/gsm/auth_milenage.c M src/gsm/auth_xor.c M src/gsm/auth_xor_2g.c 5 files changed, 28 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/33088/1 diff --git a/src/gsm/auth_comp128v1.c b/src/gsm/auth_comp128v1.c index a314dc2..ded3f8a 100644 --- a/src/gsm/auth_comp128v1.c +++ b/src/gsm/auth_comp128v1.c @@ -30,6 +30,7 @@ struct osmo_sub_auth_data2 *aud, const uint8_t *_rand) { + OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_COMP128v1); comp128v1(aud->u.gsm.ki, _rand, vec->sres, vec->kc); vec->auth_types = OSMO_AUTH_TYPE_GSM; diff --git a/src/gsm/auth_comp128v23.c b/src/gsm/auth_comp128v23.c index 697858a..f942bc0 100644 --- a/src/gsm/auth_comp128v23.c +++ b/src/gsm/auth_comp128v23.c @@ -32,6 +32,7 @@ struct osmo_sub_auth_data2 *aud, const uint8_t *_rand) { + OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_COMP128v2); comp128v2(aud->u.gsm.ki, _rand, vec->sres, vec->kc); vec->auth_types = OSMO_AUTH_TYPE_GSM; @@ -49,6 +50,7 @@ struct osmo_sub_auth_data2 *aud, const uint8_t *_rand) { + OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_COMP128v3); comp128v3(aud->u.gsm.ki, _rand, vec->sres, vec->kc); vec->auth_types = OSMO_AUTH_TYPE_GSM; diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 36fbb06..84780c6 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -55,6 +55,8 @@ uint64_t seq_1; int rc; + OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_MILENAGE); + opc = gen_opc_if_needed(aud, gen_opc); if (!opc) return -1; @@ -150,6 +152,8 @@ const uint8_t *opc; int rc; + OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_MILENAGE); + opc = gen_opc_if_needed(aud, gen_opc); rc = milenage_auts(opc, aud->u.umts.k, rand_auts, auts, sqn_out); diff --git a/src/gsm/auth_xor.c b/src/gsm/auth_xor.c index 3552568..c94b02f 100644 --- a/src/gsm/auth_xor.c +++ b/src/gsm/auth_xor.c @@ -50,6 +50,8 @@ uint8_t ak[6], xmac[8]; int i; + OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_XOR_3G); + /* Step 1: xdout = (ki or k) ^ rand */ if (aud->type == OSMO_AUTH_TYPE_GSM) xor(xdout, aud->u.gsm.ki, _rand, sizeof(xdout)); @@ -134,6 +136,8 @@ uint8_t ak[6], xmac[8]; uint8_t sqnms[6]; + OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_XOR_3G); + /* Step 1: xdout = (ki or k) ^ rand */ if (aud->type == OSMO_AUTH_TYPE_GSM) xor(xdout, aud->u.gsm.ki, _rand, sizeof(xdout)); diff --git a/src/gsm/auth_xor_2g.c b/src/gsm/auth_xor_2g.c index 1a96b4a..367c79d 100644 --- a/src/gsm/auth_xor_2g.c +++ b/src/gsm/auth_xor_2g.c @@ -48,6 +48,8 @@ { uint8_t res1[16]; + OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_XOR_2G); + if (aud->type != OSMO_AUTH_TYPE_GSM) return -ENOTSUP; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33088 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I22b504b6cffb4999b2f14772fffcb2f6f02c198c Gerrit-Change-Number: 33088 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: libosmogsm: Support authentication with 256-bit K and/or OP/OPc
by laforge 30 May '23

30 May '23
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33087 ) Change subject: libosmogsm: Support authentication with 256-bit K and/or OP/OPc ...................................................................... libosmogsm: Support authentication with 256-bit K and/or OP/OPc 3GPP TS 33.102 Section 6.3.7 states that K can be 128 or 256 bits, while our 'struct osmo_sub_auth_data' had a fixed-size 128bit field. This means we cannot use our auth_core for algorithms with larger key sizes, such as TUAK. Let's introduce osmo_sub_auth_data2 for larger (and variable) sized K and OP[c]. K and OP[c] can even have diffeent sizes in TUAK, where OP[c] is always 256bit, but K can bei 128 or 256 bits. So we need separate length fields for K and OP[c]. I'm adding backwards-compatibility API wrappers, so old applications just continue to work as they always did. However, I'm not adding compatibility wrappers for the plug-in API that can be used to register additional authentication implementations at runtime. We don't know of any user of that API outside of libosmocore, so the function signatures of the 'struct osmo_auth_impl' are modified in an incompatible way. Change-Id: Ie775fedba4a3fa12314c0f7c8a369662ef6a40df --- M include/osmocom/crypt/auth.h M src/gsm/auth_comp128v1.c M src/gsm/auth_comp128v23.c M src/gsm/auth_core.c M src/gsm/auth_milenage.c M src/gsm/auth_xor.c M src/gsm/auth_xor_2g.c M src/gsm/libosmogsm.map 8 files changed, 180 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/87/33087/1 diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index d872f64..2715164 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -40,6 +40,30 @@ #define OSMO_AUTH_ALG_XOR OSMO_AUTH_ALG_XOR_3G /*! permanent (secret) subscriber auth data */ +struct osmo_sub_auth_data2 { + enum osmo_sub_auth_type type; + enum osmo_auth_algo algo; + union { + struct { + /* See 3GPP TS 33.102 Section 9.3.7 Length of authentication parameters */ + uint8_t opc[32]; /*!< operator invariant value */ + uint8_t opc_len; /*!< OPc length (in bytes): 16 or 32 */ + uint8_t k[32]; /*!< secret key of the subscriber */ + uint8_t k_len; /*!< K length (in bytes): 16 or 32 */ + uint8_t amf[2]; + uint64_t sqn; /*!< sequence number (in: prev sqn; out: used sqn) */ + int opc_is_op; /*!< is the OPC field OPC (0) or OP (1) ? */ + unsigned int ind_bitlen; /*!< nr of bits not in SEQ, only SQN */ + unsigned int ind; /*!< which IND slot to use an SQN from */ + uint64_t sqn_ms; /*!< sqn from AUTS (output value only) */ + } umts; + struct { + uint8_t ki[OSMO_A5_MAX_KEY_LEN_BYTES]; /*!< secret key */ + } gsm; + } u; +}; + +/* deprecated older structure without support for 32-byte K/OP[c] */ struct osmo_sub_auth_data { enum osmo_sub_auth_type type; enum osmo_auth_algo algo; @@ -67,7 +91,7 @@ uint8_t ck[OSMO_A5_MAX_KEY_LEN_BYTES]; /*!< ciphering key */ uint8_t ik[OSMO_A5_MAX_KEY_LEN_BYTES]; /*!< integrity key */ uint8_t res[16]; /*!< authentication result */ - uint8_t res_len; /*!< length (in bytes) of res */ + uint8_t res_len; /*!< length (in bytes) of res: 8..16 bytes */ uint8_t kc[8]; /*!< Kc for GSM encryption (A5) */ uint8_t sres[4]; /*!< authentication result for GSM */ uint32_t auth_types; /*!< bitmask of OSMO_AUTH_TYPE_* */ @@ -82,12 +106,12 @@ /*! callback for generate authentication vectors */ int (*gen_vec)(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, + struct osmo_sub_auth_data2 *aud, const uint8_t *_rand); - /* callback for generationg auth vectors + re-sync */ + /*! callback for generating auth vectors + re-sync */ int (*gen_vec_auts)(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, + struct osmo_sub_auth_data2 *aud, const uint8_t *auts, const uint8_t *rand_auts, const uint8_t *_rand); }; @@ -95,11 +119,19 @@ int osmo_auth_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand); +int osmo_auth_gen_vec2(struct osmo_auth_vector *vec, + struct osmo_sub_auth_data2 *aud, const uint8_t *_rand); + int osmo_auth_gen_vec_auts(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *auts, const uint8_t *rand_auts, const uint8_t *_rand); +int osmo_auth_gen_vec_auts2(struct osmo_auth_vector *vec, + struct osmo_sub_auth_data2 *aud, + const uint8_t *auts, const uint8_t *rand_auts, + const uint8_t *_rand); + int osmo_auth_register(struct osmo_auth_impl *impl); int osmo_auth_load(const char *path); diff --git a/src/gsm/auth_comp128v1.c b/src/gsm/auth_comp128v1.c index ba3cf60..a314dc2 100644 --- a/src/gsm/auth_comp128v1.c +++ b/src/gsm/auth_comp128v1.c @@ -27,7 +27,7 @@ */ static int c128v1_gen_vec(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, + struct osmo_sub_auth_data2 *aud, const uint8_t *_rand) { comp128v1(aud->u.gsm.ki, _rand, vec->sres, vec->kc); diff --git a/src/gsm/auth_comp128v23.c b/src/gsm/auth_comp128v23.c index 91fb259..697858a 100644 --- a/src/gsm/auth_comp128v23.c +++ b/src/gsm/auth_comp128v23.c @@ -29,7 +29,7 @@ */ static int c128v2_gen_vec(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, + struct osmo_sub_auth_data2 *aud, const uint8_t *_rand) { comp128v2(aud->u.gsm.ki, _rand, vec->sres, vec->kc); @@ -46,7 +46,7 @@ }; static int c128v3_gen_vec(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, + struct osmo_sub_auth_data2 *aud, const uint8_t *_rand) { comp128v3(aud->u.gsm.ki, _rand, vec->sres, vec->kc); diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index ce6ba7d..7ccdbc8 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -1,4 +1,4 @@ -/* (C) 2010-2012 by Harald Welte <laforge(a)gnumonks.org> +/* (C) 2010-2023 by Harald Welte <laforge(a)gnumonks.org> * * All Rights Reserved * @@ -36,6 +36,35 @@ static LLIST_HEAD(osmo_auths); +/* generate auth_data2 from auth_data (for legacy API/ABI compatibility */ +static int auth_data2auth_data2(struct osmo_sub_auth_data2 *out, const struct osmo_sub_auth_data *in) +{ + out->type = in->type; + out->algo = in->algo; + switch (in->type) { + case OSMO_AUTH_TYPE_NONE: + return 0; + case OSMO_AUTH_TYPE_GSM: + memcpy(out->u.gsm.ki, in->u.gsm.ki, sizeof(out->u.gsm.ki)); + break; + case OSMO_AUTH_TYPE_UMTS: + memcpy(out->u.umts.opc, in->u.umts.opc, sizeof(in->u.umts.opc)); + out->u.umts.opc_len = sizeof(in->u.umts.opc); + memcpy(out->u.umts.k, in->u.umts.k, sizeof(in->u.umts.k)); + out->u.umts.k_len = sizeof(in->u.umts.k); + memcpy(out->u.umts.amf, in->u.umts.amf, sizeof(out->u.umts.amf)); + out->u.umts.sqn = in->u.umts.sqn; + out->u.umts.opc_is_op = in->u.umts.opc_is_op; + out->u.umts.ind_bitlen = in->u.umts.ind_bitlen; + out->u.umts.ind = in->u.umts.ind; + out->u.umts.sqn_ms = in->u.umts.sqn_ms; + break; + default: + return -EINVAL; + } + return 0; +} + static struct osmo_auth_impl *selected_auths[_OSMO_AUTH_ALG_NUM]; /*! Register an authentication algorithm implementation with the core @@ -149,9 +178,9 @@ * by the AUC via HLR and VLR to the MSC which will then be able to * invoke authentication with the MS */ -int osmo_auth_gen_vec(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, - const uint8_t *_rand) +int osmo_auth_gen_vec2(struct osmo_auth_vector *vec, + struct osmo_sub_auth_data2 *aud, + const uint8_t *_rand) { struct osmo_auth_impl *impl = selected_auths[aud->algo]; int rc; @@ -168,6 +197,68 @@ return 0; } +/*! Generate authentication vector + * \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 + * subscriber data and a random value. The result is what is forwarded + * by the AUC via HLR and VLR to the MSC which will then be able to + * invoke authentication with the MS + */ +int osmo_auth_gen_vec(struct osmo_auth_vector *vec, + struct osmo_sub_auth_data *aud, + const uint8_t *_rand) +{ + struct osmo_sub_auth_data2 aud2; + int rc; + + auth_data2auth_data2(&aud2, aud); + rc = osmo_auth_gen_vec2(vec, &aud2, _rand); + if (aud->type == OSMO_AUTH_TYPE_UMTS) + aud->u.umts.sqn = aud2.u.umts.sqn; + + return rc; +} + +/*! Generate authentication vector and re-sync sequence + * \param[out] vec Generated authentication vector + * \param[in] aud Subscriber-specific key material + * \param[in] auts AUTS value sent by the SIM/MS + * \param[in] rand_auts RAND 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 + * based on the permanent subscriber data, a random value as well as the + * AUTS and RAND values returned by the SIM/MS. This special variant is + * needed if the sequence numbers between MS and AUC have for some + * reason become different. + */ +int osmo_auth_gen_vec_auts2(struct osmo_auth_vector *vec, + struct osmo_sub_auth_data2 *aud, + const uint8_t *auts, const uint8_t *rand_auts, + const uint8_t *_rand) +{ + struct osmo_auth_impl *impl = selected_auths[aud->algo]; + int rc; + + if (!impl || !impl->gen_vec_auts) + return -ENOENT; + + rc = impl->gen_vec_auts(vec, aud, auts, rand_auts, _rand); + if (rc < 0) + return rc; + + memcpy(vec->rand, _rand, sizeof(vec->rand)); + + return 0; +} + /*! Generate authentication vector and re-sync sequence * \param[out] vec Generated authentication vector * \param[in] aud Subscriber-specific key material @@ -188,19 +279,17 @@ const uint8_t *auts, const uint8_t *rand_auts, const uint8_t *_rand) { - struct osmo_auth_impl *impl = selected_auths[aud->algo]; + struct osmo_sub_auth_data2 aud2; int rc; - if (!impl || !impl->gen_vec_auts) - return -ENOENT; + auth_data2auth_data2(&aud2, aud); + rc = osmo_auth_gen_vec_auts2(vec, &aud2, auts, rand_auts, _rand); + if (aud->type == OSMO_AUTH_TYPE_UMTS) { + aud->u.umts.sqn = aud2.u.umts.sqn; + aud->u.umts.sqn_ms = aud2.u.umts.sqn_ms; + } - rc = impl->gen_vec_auts(vec, aud, auts, rand_auts, _rand); - if (rc < 0) - return rc; - - memcpy(vec->rand, _rand, sizeof(vec->rand)); - - return 0; + return rc; } static const struct value_string auth_alg_vals[] = { diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 4a430b3..36fbb06 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -28,7 +28,7 @@ * @{ */ -static const uint8_t *gen_opc_if_needed(const struct osmo_sub_auth_data *aud, uint8_t *gen_opc) +static const uint8_t *gen_opc_if_needed(const struct osmo_sub_auth_data2 *aud, uint8_t *gen_opc) { int rc; @@ -43,7 +43,7 @@ } static int milenage_gen_vec(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, + struct osmo_sub_auth_data2 *aud, const uint8_t *_rand) { size_t res_len = sizeof(vec->res); @@ -141,7 +141,7 @@ } static int milenage_gen_vec_auts(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, + struct osmo_sub_auth_data2 *aud, const uint8_t *auts, const uint8_t *rand_auts, const uint8_t *_rand) { diff --git a/src/gsm/auth_xor.c b/src/gsm/auth_xor.c index 81076bd..3552568 100644 --- a/src/gsm/auth_xor.c +++ b/src/gsm/auth_xor.c @@ -43,7 +43,7 @@ /* 3GPP TS 34.108, section 8.1.2.1 */ static int xor_gen_vec(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, + struct osmo_sub_auth_data2 *aud, const uint8_t *_rand) { uint8_t xdout[16], cdout[8]; @@ -125,7 +125,7 @@ /* 3GPP TS 34.108, section 8.1.2.2 */ static int xor_gen_vec_auts(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, + struct osmo_sub_auth_data2 *aud, const uint8_t *auts, const uint8_t *rand_auts, const uint8_t *_rand) diff --git a/src/gsm/auth_xor_2g.c b/src/gsm/auth_xor_2g.c index 9efe5cc..1a96b4a 100644 --- a/src/gsm/auth_xor_2g.c +++ b/src/gsm/auth_xor_2g.c @@ -43,8 +43,8 @@ /* GSM XOR-2G algorithm as specified in Annex 4 (A.4.1.2) of 3GPP TS 51.010-1. */ static int xor2g_gen_vec(struct osmo_auth_vector *vec, - struct osmo_sub_auth_data *aud, - const uint8_t *_rand) + struct osmo_sub_auth_data2 *aud, + const uint8_t *_rand) { uint8_t res1[16]; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 003d6e8..8de3b54 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -554,7 +554,9 @@ osmo_auth_alg_name; osmo_auth_alg_parse; osmo_auth_gen_vec; +osmo_auth_gen_vec2; osmo_auth_gen_vec_auts; +osmo_auth_gen_vec_auts2; osmo_auth_3g_from_2g; osmo_auth_load; osmo_auth_register; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33087 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie775fedba4a3fa12314c0f7c8a369662ef6a40df Gerrit-Change-Number: 33087 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-ci[master]: Fix failing Osmocom-release-manuals job
by laforge 30 May '23

30 May '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/33086 ) Change subject: Fix failing Osmocom-release-manuals job ...................................................................... Fix failing Osmocom-release-manuals job Add a workaround that upgrades the osmocom-nightly package before installing build dependencies for the given package. This is not very elegant, it would make more sense if the docker image we use here did not have the nightly Osmocom repository configured in the first place (as this job is about creating manuals for tagged releases). But the image is used by jenkins build verification too and I don't think it's a good use of time to change this right now. Fix for: + apt-get -y build-dep /build Note, using directory '/build' to get the build dependencies Reading package lists... Building dependency tree... Reading state information... Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: osmo-gsm-manuals-dev : Depends: osmocom-nightly (= 202305300026) but 202305290026 is to be installed Change-Id: If28a34d3e5b07216c5310b19623fcc42692f65c3 --- M scripts/manuals/publish-manuals-for-tags.sh 1 file changed, 39 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/scripts/manuals/publish-manuals-for-tags.sh b/scripts/manuals/publish-manuals-for-tags.sh index 99e117c..49a3d43 100755 --- a/scripts/manuals/publish-manuals-for-tags.sh +++ b/scripts/manuals/publish-manuals-for-tags.sh @@ -354,6 +354,12 @@ sh -ex -c " apt-get update + # The docker image has the nightly repository + # configured, in which packages can't be installed from + # different build dates. Upgrade osmocom-nightly first + # to prevent errors in apt-get build-dep below. + apt-get -y upgrade osmocom-nightly + # Install dependencies case $repo in *) -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/33086 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: If28a34d3e5b07216c5310b19623fcc42692f65c3 Gerrit-Change-Number: 33086 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ci[master]: Fix failing Osmocom-release-manuals job
by laforge 30 May '23

30 May '23
Attention is currently required from: osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/33086 ) Change subject: Fix failing Osmocom-release-manuals job ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/33086 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: If28a34d3e5b07216c5310b19623fcc42692f65c3 Gerrit-Change-Number: 33086 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 30 May 2023 12:10:51 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ci[master]: Fix failing Osmocom-release-manuals job
by osmith 30 May '23

30 May '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/33086 ) Change subject: Fix failing Osmocom-release-manuals job ...................................................................... Fix failing Osmocom-release-manuals job Add a workaround that upgrades the osmocom-nightly package before installing build dependencies for the given package. This is not very elegant, it would make more sense if the docker image we use here did not have the nightly Osmocom repository configured in the first place (as this job is about creating manuals for tagged releases). But the image is used by jenkins build verification too and I don't think it's a good use of time to change this right now. Fix for: + apt-get -y build-dep /build Note, using directory '/build' to get the build dependencies Reading package lists... Building dependency tree... Reading state information... Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: osmo-gsm-manuals-dev : Depends: osmocom-nightly (= 202305300026) but 202305290026 is to be installed Change-Id: If28a34d3e5b07216c5310b19623fcc42692f65c3 --- M scripts/manuals/publish-manuals-for-tags.sh 1 file changed, 39 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/86/33086/1 diff --git a/scripts/manuals/publish-manuals-for-tags.sh b/scripts/manuals/publish-manuals-for-tags.sh index 99e117c..49a3d43 100755 --- a/scripts/manuals/publish-manuals-for-tags.sh +++ b/scripts/manuals/publish-manuals-for-tags.sh @@ -354,6 +354,12 @@ sh -ex -c " apt-get update + # The docker image has the nightly repository + # configured, in which packages can't be installed from + # different build dates. Upgrade osmocom-nightly first + # to prevent errors in apt-get build-dep below. + apt-get -y upgrade osmocom-nightly + # Install dependencies case $repo in *) -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/33086 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: If28a34d3e5b07216c5310b19623fcc42692f65c3 Gerrit-Change-Number: 33086 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bts[master]: osmo-bts-trx: tch_dl_dequeue(): do not drop CSD frames
by fixeria 30 May '23

30 May '23
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33073 ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: osmo-bts-trx: tch_dl_dequeue(): do not drop CSD frames ...................................................................... osmo-bts-trx: tch_dl_dequeue(): do not drop CSD frames Change-Id: I382b9994db01d58515c89c8de6250cd3239b8861 Related: OS#1572 --- M src/osmo-bts-trx/sched_lchan_tchf.c 1 file changed, 12 insertions(+), 2 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c index 7c2a05f..f065803 100644 --- a/src/osmo-bts-trx/sched_lchan_tchf.c +++ b/src/osmo-bts-trx/sched_lchan_tchf.c @@ -374,8 +374,8 @@ int8_t sti, cmi; bool amr_is_cmr; - if (rsl_cmode != RSL_CMOD_SPD_SPEECH) { - LOGL1SB(DL1P, LOGL_NOTICE, l1ts, br, "Dropping speech frame, " + if (OSMO_UNLIKELY(rsl_cmode == RSL_CMOD_SPD_SIGN)) { + LOGL1SB(DL1P, LOGL_NOTICE, l1ts, br, "Dropping a TCH frame, " "because we are not in speech mode\n"); goto free_bad_msg; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33073 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I382b9994db01d58515c89c8de6250cd3239b8861 Gerrit-Change-Number: 33073 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • ...
  • 259
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.