UICC version 4 can use any ADM code, nevertheless you have to provide one (any 8 figures value) to overwrite the telecom values.
The adm code is on our UICC invoices for UICC before serial OC004000.
If you enter 8 successive times a wrong ADM, the card update will be locked: the IMSI/Ki/… update won’t be possible anymore.
OP and OPc
OPc is the result of a operation between OP (means operator key) and Ki (user key)
The OP is never used in the telecom protocol.
So, if you specify a OP in the file hss.conf and in our option ‘–xx’, they should compute the same OPc
program_uicc displays the computed OPc if you pass option –xx
The HSS updates all OPc values in the database if you specify the OP in hss.conf (else set it to the empty string: “”)
Either you never use OP and set directly OPc in both HSS and program_uicc, or you use OP: both are fine.
SQN (3GPP sequence number)
In the uicc, the SQN increments by +32 after each successful authentication, the HSS must do the same.
If the SQN is not correct, the uicc will detect it and refuse the authentication challenge.
3GPP defines a authorized gap, to not block a UICC if some failure occurs: the UICC accepts SQN greater than the current one, for at least 10*32 range (so any value between curennt_value+32 and current_value+32 is ok).
Our uicc starts at 0, we test all of them before shipping, so SQN is usually set to 32 when they are new.
If the synchronization is lost, there is a way to know the current SQN in a uicc (assuming you have the OPc and the Ki).
Program_uicc offers to discover the current SQN: add –authenticate option.
This option do a authentication trial (as do the UE+HSS when the UE attaches to the network) with a SQN that is likely wrong.
Authentication should fail (as the SQN is not good), but the UICC answer allows to decode the SQN.
program_uicc verifies the correct SQN doing a correct authentication and displays the result (the SQN to set in HSS database).
If your HSS require to set it, the value is 0x8000
This value is hard coded inside OAI HSS, it is the right value for regular UICC from any brand.