perf: compile-time opt-out for SMS and OTA - #160
Open
benjaminbruun wants to merge 7 commits into
Open
Conversation
benjaminbruun
force-pushed
the
feat/subsystem-gates
branch
from
August 26, 2026 11:46
b8a5599 to
a7d6453
Compare
benjaminbruun
force-pushed
the
feat/subsystem-gates
branch
2 times, most recently
from
September 1, 2026 12:21
9ce8169 to
7ef1963
Compare
benjaminbruun
marked this pull request as ready for review
September 1, 2026 12:21
benjaminbruun
marked this pull request as draft
September 2, 2026 07:09
benjaminbruun
force-pushed
the
feat/subsystem-gates
branch
from
September 2, 2026 08:42
5cc972a to
72746e6
Compare
An integration that never uses a subsystem can compile it out via CONFIG_DISABLE_* (all off by default, so default builds are unchanged); instructions of a disabled subsystem answer 6D00 per TS 102 221. Also declares the uicc<->crypto static-library cycle the opt-outs exposed, so archive member extraction no longer depends on the OTA call chain. Signed-off-by: Benjamin Bruun <bb@onomondo.com>
6D00 is defined in TS 102 221 clause 10.2.1.5.0 (base checking errors); 10.2.1.1 is normal processing. Signed-off-by: Benjamin Bruun <bb@onomondo.com>
The only standalone gate the matrix did not compile; it uniquely covers ss_new_ctx without the filelist and the SMS-only proactive task array. Signed-off-by: Benjamin Bruun <bb@onomondo.com>
…BLE_SMS Two states are wanted: SMS without RFM, and SMS with RFM. REFRESH is only ever fed by remote commands, so it goes with OTA; SMS off implies OTA off; CAT stays in every build so the terminal sees the same card at boot. A compiled-out subsystem logs the profile fix when the terminal still offers it, and tests/opt_out pins the gated answers. Signed-off-by: Benjamin Bruun <bb@onomondo.com>
aes-encblock.c (crypto) calls ss_utils_aes_encrypt (utils_aes.c, uicc). With OTA compiled out nothing in the uicc archive references the wrapper any more, so a single pass over the archives left aes-encblock.o unresolved. Building utils_aes.c into the crypto library puts caller and callee in one archive: the link graph stays acyclic and consumer link lines are untouched. The four archives together define the same symbols. Signed-off-by: Benjamin Bruun <bb@onomondo.com>
The SMS-implies-OTA rule already lives in CMake, a prototype without a definition is inert, no build here enables -Wunused-parameter, opt_out_test includes only public headers, and wrapping the existing lines of ss_new_ctx keeps the default build's code byte for byte. The sms suite moves under the OTA gate instead of patching #171's test: its reassembly case expects the remote command handler's status word. Signed-off-by: Benjamin Bruun <bb@onomondo.com>
OTA only ever arrives over SMS-PP and the SMS layer has no other caller, so a build without OTA but with SMS kept six kilobytes of code whose only reachable outcome was a reject. One option now drops both. The gated ENVELOPE answers 6F00, which TS 31.111 clause 7.1.1.1 maps to an RP-ACK; no clause attaches a network-side behaviour to the 6A81 it answered before. Signed-off-by: Benjamin Bruun <bb@onomondo.com>
benjaminbruun
force-pushed
the
feat/subsystem-gates
branch
from
September 2, 2026 16:08
72746e6 to
4189932
Compare
benjaminbruun
marked this pull request as ready for review
September 2, 2026 16:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One build option, off by default, so the default build is unchanged (the four static libraries define the same symbols at the same sizes as before):
CONFIG_DISABLE_SMS— drops the SMS codec and rx/tx and, with them, RFM/OTA remote commands, 3DES and the REFRESH they drive (incl. both changed-file lists): OTA only ever arrives over SMS-PP and nothing else uses the SMS layer. Host-Ostext of the four libraries 65,051 → 52,289 B,sizeof(struct ss_context)2,936 → 872 B.CAT stays. An SMS-PP DOWNLOAD envelope answers 6F00, which TS 31.111 clause 7.1.1.1 maps to an RP-ACK, and logs an error. Leave EF.UST service n°28 set: clearing it makes the terminal store class-2 messages in EF.SMS, which the shipped profile does not have.
The OTA AES wrapper (
utils_aes.c) now builds into the crypto library, next to theaes-encblock.cthat calls back into it: with OTA compiled out nothing inlibuicc.areferenced the wrapper any more, so a single pass over the archives left it unresolved. Same archive, no link-order dependency, consumer link lines untouched;ss_utils_aes_*move fromlibuicc.atolibcrypto.a.Tests: the des/envelope/ota/sms suites are skipped in the gated build;
tests/opt_outpins SELECT MF, TERMINAL PROFILE, the 6F00 answer and the log line. CI gains an SMS-off row; docs list the option.