Commit graph imsd/tests/Aka
Author SHA1 Message Date
3754687b0d
aka: the ISIM application of a card, its identity files and the identity they hold
An ISIM holds the parameters a registration starts from (TS 24.229
5.1.1.1A): the private identity in EF_IMPI, the home domain in
EF_DOMAIN and public identities in EF_IMPU (TS 31.103 4.2.2 to 4.2.4),
of which the first record's is the one to register (GSMA IR.92 2.2.1).
TS 23.003 has a UE derive its home domain and a temporary public
identity from the IMSI "if there is no ISIM application" (13.2, 13.4B);
those derived names are the only ones imsd has. This is the part of
reading an ISIM that has no I/O; the daemon does not use it yet.

ParseIsimApp finds the ISIM application of one slot in qmicli's card
status, in whatever state the modem lists it. On the two cards with an
ISIM that a read-only probe read (a US card, 2026-11-23, and a
Norwegian one, 2026-11-21) the Fairphone 6's modem lists the ISIM
`detected` beside the `ready` USIM, and on both a logical channel
opened on it and its identity files were read.

The commands are the ones that probe sent: SELECT by file identifier,
READ BINARY, READ RECORD (TS 102 221 11.1.1, 11.1.3, 11.1.5).
ApduAnswer is a card's answer, '90 00', '91 XX' and '92 XX' its normal
endings (10.2.1.1), and ApduFollowUp the command it asks for next when
the answer brought no data: GET RESPONSE for '61 XX', a command without
data again with the length named for '6C XX' (7.3.1.1.5); an answer
with data is taken for the command's last. HoldsRead takes a read's
data under the warning '62 82' as well (10.2.1.3). ParseIsimValue takes
the value of the data object with tag '80' that a file begins with,
cuts 'FF' bytes from the end of its length as the probe does, and gives
none for a value with a blank or a byte that is not printable ASCII.
IsimIdentity checks the three values before they replace the derived
names: they are written into a quoted string and between the angle
brackets of SIP header fields. It refuses a value with a quote, a
backslash, an angle bracket, a blank, a line break or another byte
outside printable ASCII, a private or a public identity of more than
255 characters, a private identity without an @ between two parts, a
domain that is not labels of letters, digits and inner hyphens, 63
characters a label and 253 in all at most, and a public identity that
does not begin sip: or is that alone.

The two readers of the card status share how they read a line;
ParseCardStatus gives what it gave.

Tested: tests/Aka (the application out of a card status with the US
card's two applications, in either order, and out of a second slot with
the Norwegian card's AID; the commands, the answers and their
follow-ups, the values, the identity and what is refused) and
tests/Messages (the two REGISTERs of an ISIM's identity against the
pinned ones).
2026-11-23 19:32:58 +01:00
460343e578
aka: a command on a logical channel from 4 to 19 carries the extended class byte
The AUTHENTICATE and the GET RESPONSE went out with the channel number
as their class byte. That is the coding of the standard logical
channels, 0 to 3 (ETSI TS 102 221 10.1.1, table 10.3: the channel in
bits b2 and b1). For the extended ones, 4 to 19, table 10.4a has
'01x0 xxxx' with the channel less four in the low four bits: a command
for channel 4 starts with 40. As 04 it is a command for channel 0 with
a secure-messaging bit set.

The channel is the one the modem returns when imsd opens a logical
channel for the AKA run; imsd does not log it, so whether a
registration ever got one above 3 is not on record.

tests/Aka pins the class byte of channels 0, 1, 3, 4, 5 and 19, the
AUTHENTICATE on channels 3 and 4 and the GET RESPONSE on channel 7.
2026-11-23 14:47:32 +01:00
a63132deb8
tests: every suite returns 1 for a failure, not the count
Six suites ended in `return Failures;`. `crafter-build test` takes an
exit status of 77 for a skipped suite and then succeeds, and an exit
status keeps 8 bits: 77 failing checks read as a skip, 256 as a pass.
All nine now return 1 after any failure, as Engine, Sip and Sms did.

Tested with 77 failing checks added to Ipsec, to Messages and to Sdp
in turn (the fp6 journal's 2026-11-20-issues-2-5 capture, exit-status):
before, `crafter-build test` ended `8 passed, 1 skipped` with exit
status 0; now it ends `8 passed, 1 failed` with exit status 1.
2026-11-22 17:35:11 +01:00
910e2594a0
project, docs: the linter goes
The Catcrafts house-style rules (Crafter.LintRules) rode in project.cpp
as a dependency crafter-build cloned once and built on every load; the tree
never passed them (111 findings on the 1.1.0 tree, 156 on an early freeze
of this range (2e87e26), 100 of the 156 the shared naming rule's, each
for a variable whose name begins with a capital — the
fp6 journal's lint captures, lint-tip-2e87e26), CI never ran them,
and AGENTS.md kept a census nobody acted on. Out: the dependency, the
import and the five AddRules calls, the lint-disable comments in 25
files and on 4 lines, §4.2 and the census of §6 — now "Code style", the
three rules that were never the linter's; the cross-compiling section
becomes §4.2 and its six citations — §4.1's sysroot sentence, §9.1, the CI
workflow, the APKBUILD, build-package.sh, make-sysroot.sh — follow. Jorijn, 2026-10-17: "just
remove the linter, we are ignoring it anyway".
2026-11-19 16:43:16 +01:00
6e77823933 imsd 0.2.7 — initial public snapshot
Userspace VoLTE/IMS daemon for mainline Linux phones (developed on the
Fairphone 6): a GLib-free core (SIP, SDP, USIM AKA, IPsec SA setup, RTP
media, call engine) behind a GDBus control daemon, a standalone AMR-WB
media leg, and a Plasma Dialer backend. C++26 modules built with Crafter
Build; the tree is clean under the project's house-style linter
(crafter-build lint) across all three build products.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
2026-07-22 23:04:21 +02:00