Git Product home page Git Product logo

Comments (5)

acetcom avatar acetcom commented on June 1, 2024

As I know, OPc can be derived from K and OP value like the src/hss/milenage.c

void milenage_opc(const c_uint8_t *k, const c_uint8_t *op,  c_uint8_t *opc)
{
    int i;

    aes_128_encrypt_block(k,  op, opc);

    for (i = 0; i < 16; i++)
    {
        opc[i] ^= op[i];
    }
}

I have no experience how EPC is deployed. So I'm not sure which value is good to store database.

I've assumed it as follows.

  1. Operator order USIM with global OP, K, and AMF
  2. USIM manufacturer provide the chip with individual OPc, K, and AMF
    (Individual OPc is derived from OP and K).
  3. Operator add new subscriber with global OP, K, and AMF.

And also, there is one more operator in this system. So, I've stored OP in the Subscriber database.

At this point, I don't know whether the above scenario is right or not. If operator also want to use the individual OPc that is not derived from global OP, I'll change OP to OPc field in Web User Interface.

from open5gs.

laf0rge avatar laf0rge commented on June 1, 2024

Both scenarios exist. It is up to the agreement between SIM card manufacturer and operator whether they use global OP or card-individual OPC. In OsmoHLR, we have prepared the database for both variants. I know it adds complexity, but it's unfortunately the only solution to cover both common cases.

For my immediate testing, I've reprogrammed my card to use global OP instead of OPc and authentication via USIM-UE-ENB-MME-HSS is now working with nextepc. So I can make progress right now, but I guess sooner or later somebody will have this issue and not be able to reprogram the card[s].

Regarding your assumption that the card would always contain an OPc: This is unfortunately not correct. We know of at least one widely-used CardOS / USIM application which actually stores the global OP on each card in case of "global OP" case, and only a card-individual OPc in case of card-individual OPc.

from open5gs.

anoveth avatar anoveth commented on June 1, 2024

Sukchan, we should cover both scenarios, regarding pratical use-cases at least. It seems that real USIMs might be provided not only with 'OP' + 'K', but also with 'OPc' + 'K' although 'OPc' is derived from 'OP' and 'K' by the 'Milenage' algorithm framework. And please refer to the following about "OPc computed off the USIM":

(From ETSI TS 135 206)
5.1 OPC computed on or off the USIM?

Recall that OP is an Operator Variant Algorithm Configuration Field. It is expected that each operator will define a value of OP which will then be used for all its subscribers. (It is up to operators to decide how to manage OP. The value of OP used for new batches of USIMs could be changed occasionally; or perhaps a different value could be given to each different USIM supplier. OP could even be given a different value for every subscriber if desired, but that is not really the intention.)
It will be seen in section 4.1 that OPC is computed from OP and K, and that it is only OPC, not OP, that is ever used in subsequent computations. This gives two alternative options for implementation of the algorithms on the USIM:

(a) OPC computed off the USIM: OPC is computed as part of the USIM prepersonalisation process, and OPC is stored on the USIM. OP itself is not stored on the USIM.
(b) OPC computed on the USIM: OP is stored on the USIM (it may be considered as a hard-coded part of the algorithm if preferred). OPC is recomputed each time the algorithms are called.

The SAGE Task Force recommends that OPC be computed off the USIM if possible, since this gives the following benefits:

  • The complexity of the algorithms run on the USIM is reduced.
  • It is more likely that OP can be kept secret. (If OP is stored on the USIM, it only takes one USIM to be reverse engineered for OP to be discovered and published. But it should be difficult for someone who has discovered even a large number of (OPC, K) pairs to deduce OP. That means that the OPC associated with any other value of K will be unknown, which may make it harder to mount some kinds of cryptanalytic and forgery attacks. The algorithms are designed to be secure whether or not OP is known to the attacker, but a secret OP is one more hurdle in the attacker's path.)

from open5gs.

acetcom avatar acetcom commented on June 1, 2024

It's good discussion. Let me add OPc field in nextepc database.

On the HSS aspect,

  • If there is OPc value in the database, HSS will use it directly without calculation at first.
  • If there is no OPc value, HSS will try to find OP value in the database, and if there is OP value, HSS will derive OPc value from K and OP value.

And also, I will update WebUI for supporting these two value.

Thanks!

from open5gs.

acetcom avatar acetcom commented on June 1, 2024

I've updated WebUI and HSS for supporting OPc in r0.2 branch.

Even though database stores both OP and OPc, End-User enter only one of OP and OPc in the WebUI.

Thanks!

from open5gs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.