imsd/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf d6d7ba100a
sms, engine: a class 2 message is refused, not acknowledged, unless it is a short message type 0
OnSmsMessage acknowledged every SMS-DELIVER it could parse with an
RP-ACK and handed it to the bus, whatever its class. For a class 2
message the acknowledgement said more than was done: TS 23.038 4 has the
MS "ensure that the message has been transferred to the SMS data field
in the (U)SIM before sending an acknowledgement to the SC", and TS
23.040 9.2.3.9 has a (U)SIM data download — TP-PID 0x7F with a class 2
coding — passed to the (U)SIM. imsd writes nothing to the card, so the
network had an acknowledgement for something that had not happened
(issue #4).

imsd has no way to the card for such a message yet. TS 23.038 4 names
the answer of an MS that cannot store a class 2 message in the (U)SIM
while other storage is free, "protocol error, unspecified", and excepts
only a download on an MS that supports the (U)SIM Application Toolkit,
which imsd does not. The delivery report of a class 2 message, a
segment of a set included, is now an RP-ERROR with that cause, 111, and
the TP-FCS 0xFF, unspecified error cause; the message is neither stored
nor handed to the bus, and the journal has its sender, service centre
and time. A short message type 0 (TP-PID 0x40) with a class 2 coding is
no part of this: 9.2.3.9 has it received "irrespective of whether there
is memory available in the (U)SIM or ME or not". TP-PID 0x7F without a
class 2 coding stays a message like any other, and so do classes 0, 1
and 3.

What this changes for a consumer: no `Received` comes for a refused
class 2 message, a text of that class among them, which 1.2.0 stored
and handed over (Jorijn, 2026-11-21: the refusal is kept). The
interface's members, keys and words are as they were.

Still open of issue #4: the way to the card itself — TS 31.111 7.1.1's
ENVELOPE (SMS-PP DOWNLOAD) for a download, an EF_SMS record for any
other class 2 message — and with it an acknowledgement made from the
card's answer. Read from the dev phone for it (the fp6 journal's
2026-11-20-issues-2-5 capture, phone): the KPN USIM's service table
lists 28 (data download via SMS-PP) and 10 (short message storage),
EF_SMS holds ten records of 176 bytes, the modem's route table has a
class 2 message it receives itself stored on the card, and qmicli has
the APDU route AKA takes and no toolkit command. Whether the modem lets
an ENVELOPE through that route has not been tried.

Tested by tests/Engine. On the dev phone the daemon, the binary of this
range's last commit, refused five class 2 deliveries that the phone sent
to its own protected server port — answered 200, the journal's line,
nothing stored, and no report, since they named no gateway — and took
six deliveries from KPN as before (the capture's phone-form6).
2026-11-22 17:35:13 +01:00
..
Aka tests: every suite returns 1 for a failure, not the count 2026-11-22 17:35:11 +01:00
Engine sms, engine: a class 2 message is refused, not acknowledged, unless it is a short message type 0 2026-11-22 17:35:13 +01:00
Ipsec tests: every suite returns 1 for a failure, not the count 2026-11-22 17:35:11 +01:00
Messages sip, messages, imsd: the client flow answers a request datagram cut short of the Content-Length it reads with a 400, unless an ACK or a CANCEL 2026-11-22 17:35:11 +01:00
Qmi tests: every suite returns 1 for a failure, not the count 2026-11-22 17:35:11 +01:00
Sdp tests: every suite returns 1 for a failure, not the count 2026-11-22 17:35:11 +01:00
Sip sip: a received message's header section is unfolded where it is framed 2026-11-22 17:35:12 +01:00
Sms sms, engine, imsd: a segment that gets no answer, or an RP-ERROR with cause 41, is sent once more with TP-RD set 2026-11-22 17:35:12 +01:00
Util tests: every suite returns 1 for a failure, not the count 2026-11-22 17:35:11 +01:00