476 Commits
Author SHA1 Message Date
yibaiba dbca9693cf fix(sms): validate incoming TPDU structure without guessing offsets
Validate encoded TP-OA length, TOA extension bit and declared TP-UD length before decoding. Preserve valid GSM addresses, timestamps and binary payloads. Remove score-based filtering, arbitrary resynchronization and raw-PDU errors. Add a synthetic length-8 SMSC regression that reproduces the original 145-character sender.
2026-12-06 19:22:19 +08:00
PatrickPon 769a5bc419 fix(sms): resync a shifted TPDU before giving up
Some QMI backends prepend a few bytes to the SMS PDU, which shifts the
whole TPDU and makes every candidate decode into an impossible address
and timestamp. That produced the same garbage sender even when the PDU
itself was intact.

When no candidate reaches the plausibility score, retry decoding at byte
offsets 1..12, including starts that skip a second SMSC-style header.
Return the highest-scoring decode and drop the message only when every
offset fails.

Refs #130
2026-12-04 23:24:15 +08:00
PatrickPon 13b656f4af fix(sms): reject implausible QMI TPDU decodes
A QMI SMS PDU used to be accepted as soon as its first byte looked like a
TPDU (low two bits clear). A full PDU that still carries the SMSC header
starts with 0x08 and passes that test, so the SMSC TOA byte 0x91 was read
as a 145-semi-octet TP-OA: the message landed in the database with a
145-character "sender" and a bogus 2005 SCTS.

Score every decoded candidate on TP-OA plausibility, SCTS range and body
validity, keep the best one, and only return it at minSMSDecodeScore.
When nothing passes, include the raw PDU in the error so the next
occurrence can be diagnosed from the log.

Refs #130
2026-12-04 23:24:09 +08:00
BFNOC 539afc35b4 fix(vowifi-go): wait for runner and SWu session exit on stop
- Stop starts one release task and every caller waits for it with its own ctx
- Report ErrRunnerNotExited at the deadline and ErrCleanupFailed for local cleanup failures
- Bound the IMS stop in the release task to 5 seconds
- Ignore session, service and voice handles that arrive after Stop
- Add SessionManager.StopAsync and StopAndWait that wait for session goroutines and local cleanup
- Make StopSlot wait for its session
- Stop ePDG sessions with StopAsync in runtimecore and keep the original cleanup order
- Keep local cleanup failures in the runner result after cancellation
- Make the cellular tunnel adapter publish and wait for its stopped session
- Cancel and wait for P-CSCF recoveries on IMS stop
- Stop the IMS service only once
- Log IMS service stop failures
- Add StartWithRunnerForTest for host tests
2026-11-27 18:36:09 +08:00
yibaiba d5dcae677f Merge pull request #116 from yuyanmengxuan/codex/fix-vowifi-sms-smsc-reassembly
Codex/fix vowifi sms smsc reassembly
2026-11-17 19:57:18 +08:00
杨伟杰 157e75885d test(vowifi): use explicitly simulated SMS fixtures 2026-11-17 09:32:27 +08:00
杨伟杰 267496fc8d fix(vowifi): assemble multipart SMS across SMS centers 2026-11-17 09:26:51 +08:00
BFNOC aa5b7ce334 fix(netstack): keep the peer address of an IMS TCP conn after a reset
- Record the peer when an IMS TCP conn is dialled or accepted
- Return that peer from RemoteAddr instead of asking the reset endpoint
2026-11-09 23:07:22 +08:00
BFNOC 55a0eda726 fix(imscore): keep an old-SA port-s timeout a failure when the retirement sweep marks it 2026-11-09 22:03:03 +08:00
yibaiba 9f2cdefb29 fix(imscore): preserve newer subscription failures across service notifications 2026-11-08 22:42:31 +08:00
yibaiba e4c9d7495e Merge pull request #106 from BFNOC/fix-vfde-refresh-offer
feat(policy): offer new Security-Client parameters on Vodafone DE refreshes
2026-11-08 21:12:56 +08:00
yibaiba cb65e676da Merge pull request #107 from BFNOC/fix-mwi-redetect-backoff
feat(vowifi): reset the card's MWI backoff when MWI is turned on or re-detected
2026-11-08 21:12:46 +08:00
BFNOC 2305ed458d feat(vowifi): reset the card's MWI backoff when MWI is turned on or re-detected
- clear only the card's MWI failure count and local wait, keeping network waits and stop states
- act only on a switch to on or the redetect button, not on saving on again
- reconnect or wake only running runtimes that hold the card, never start one
- reset in the host-held state before the hideck#101 reconnect
- wake the running runtime to re-check MWI when no reconnect is needed
- restart an MWI usage the SIM setting stopped once the setting allows it
- do a proxy change's reconnect first, then reset and wake without a second reconnect
2026-11-08 02:04:08 +08:00
BFNOC 49b6152ee4 fix(vowifihost): keep SUBSCRIBE backoff across runtime restarts
- split the retry state out of SubscriptionRegistrationStore into SubscriptionRetryStore
- keep one store in vowifihost.Manager and pass it to every runtime start
- wire it into both the default runtimecore path and the custom-tunnel path
- narrow the protocol alignment doc to what is kept and for how long
2026-11-08 01:06:40 +08:00
BFNOC 1598da4779 fix(imscore): keep the MWI stop state when another subscription confirms 2026-11-08 01:04:27 +08:00
BFNOC f44c733fd1 fix(imscore): keep the stored MWI wait when a policy-stopped usage restarts 2026-11-08 01:04:27 +08:00
BFNOC 8b50ee21e6 feat(policy): offer new Security-Client parameters on Vodafone DE refreshes
- Enable refresh_offers_new_security_client in the Vodafone DE preset
- Assert it in the preset tests and update the preset hash
2026-11-07 20:26:29 +08:00
BFNOC 4d6415aa21 fix(imscore): treat a P-CSCF reset of the old-SA port-s as SA retirement
- Classify a reset or close from the old port_pc during retirement as sa_retired
- Keep a timeout on the old flow as a failure
- Clear the pending retirement only after its flows are marked
- Ignore a retire timer that fires after the retirement finished
- Log raw_close_kind, sa_retired_via, remote and current on port-s close
- Test reset, close and timeout from the old port_pc and a reset during cleanup
2026-11-07 20:05:10 +08:00
BFNOC 4f02691c08 fix(imscore): keep a newer port-s failure when the old SAs' flow closes
- Skip the last-live-connection fallback for sa_retired closes
- Test that retiring the old flow keeps a newer flow's reset
2026-11-07 19:42:53 +08:00
yibaiba f47296d0ad Merge pull request #103 from BFNOC/fix-subscription-backoff
fix(imscore): back off failed SUBSCRIBE retries independently of Expires
2026-11-07 15:57:33 +08:00
yibaiba c7652cee1c Merge pull request #101 from BFNOC/feat-mwi-policy
feat(vowifi): let carrier presets and a per-SIM setting control SUBSCRIBE(mwi)
2026-11-07 15:57:23 +08:00
BFNOC fcf91b6c75 fix(imscore): back off failed SUBSCRIBE retries independently of Expires
- retry the reg event package after 30 s, 1, 2 and 4 minutes, then every 5 minutes
- retry MWI after 5, 10 and 20 minutes, then every 30 minutes
- keep Retry-After and retry-after as the minimum wait
- keep the failure count per identity and event package across Service rebuilds
- clear the count only on a matching active or pending NOTIFY
- let the reg event package subscribe once after a new initial registration
- keep MWI stopped after rejected, noresource or invariant across registrations
- count a transaction timeout followed by Timer N as one failure
2026-11-06 08:25:07 +08:00
BFNOC 0238c99d5b feat(vowifi): gate SUBSCRIBE(mwi) on carrier and per-SIM policy
- Add disable_mwi_subscription to carrier presets and enable it for Vodafone DE 26202
- Carry the new field through preset merge, override clone, JSON override and runtime conversion
- Add an optional MWISubscriptionPolicyStore with auto, on and off per SIM
- Check the policy in the send callback of every initial, refresh and 481 retry SUBSCRIBE(mwi)
- Record a network 405 or 489 as a persistent rejection and skip 480, timeouts and locally routed 405
- End the subscription when a refresh is blocked instead of keeping its timer
- Stop an active MWI subscription found disabled at registration
- Do not treat a policy block as a signaling failure
- Wire the store through runtimehost and runtimecore, including the cellular start path
- Add carry-over tests at each conversion boundary
2026-11-05 11:15:31 +08:00
BFNOC 92125e041c fix(policy): clone the handover pointer in carrier overrides
- Copy AllowHandoverPDNWLANAndEPS in cloneCarrierOverridePointers like the other pointer fields
- Add a reflection test that fails when a cloned override still shares a pointer
2026-11-05 10:40:56 +08:00
BFNOC 58626e4885 fix(qmi): name the services behind a timeout storm
- Collect the timed-out services before clearing the storm window
- Log their count and names instead of the 0 the cleared window always gave
2026-11-04 18:23:42 +08:00
yibaiba 0614510c32 fix(swu): surface NAT-T reassociation failures 2026-10-29 16:34:45 +08:00
BFNOC 83ac69470e fix(swu): open a new SOCKS5 UDP association when IKE floats to 4500
- Open a fresh SOCKS5 UDP ASSOCIATE to the ePDG on 4500 after NAT detection
- Keep the old association when the new one cannot be opened
- Move a running IKE control loop to the new association
- Bound the SOCKS5 handshake with the dial timeout
- Drop duplicate IKE responses instead of blocking the dispatcher
- Share the proxy transport config between setup and MOBIKE
2026-10-29 14:10:34 +08:00
yibaiba a26bd085b1 test(ims): make subscription deadline verification deterministic 2026-10-29 14:01:59 +08:00
yibaiba 0f4e8d22ac fix(ims): finish SA retirement before the next refresh switch 2026-10-29 13:57:16 +08:00
yibaiba 443c7e8308 Merge pull request #89 from BFNOC/pr-port-s-timeout-await 2026-10-29 13:57:16 +08:00
yibaiba 8e2ab6ad84 Merge pull request #88 from BFNOC/pr-refresh-security-client 2026-10-29 13:49:26 +08:00
BFNOC c91ff20532 fix(imscore): await the Lebara UK P-CSCF after a port-s timeout
- Probe with a REGISTER after a Lebara UK port-s timeout and wait for the P-CSCF to reopen port-s once it succeeds
- Keep SMS readiness true with its own reasons while probing and waiting
- Bind the wait and the probe grace to the timed-out port-s generation and P-CSCF, and drop them on a new registration
- Send another probe REGISTER when port-s timed out while an earlier REGISTER was in flight
- End the wait when a REGISTER fails or a refresh negotiates an outbound flow, and the probe grace when recovery backs off
- Count a peer reopen during the wait as on-demand evidence only when no REGISTER is in flight
- Mirror sipOutbound into an atomic and clear the post-REGISTER wait flag on every port-s close
- Log entering, declining and ending the wait, each REGISTER during it and probe retries with the carrier preset and peer reconnect history
- Show in the web UI that SMS reception waits for the carrier to reopen port-s
- Add tests for the Lebara UK wait, probes, failures, stale states, outbound and carriers outside the list
2026-10-29 00:47:52 +08:00
BFNOC fb46910e27 feat(policy): offer new Security-Client parameters on DITO PH refreshes
- Enable refresh_offers_new_security_client in the DITO PH preset
- Assert it in the preset tests and update the preset hash
2026-10-29 00:27:30 +08:00
BFNOC c0f87556ae fix(imscore): offer new refresh SAs only where two SA sets can coexist
- Report from the runtime IMS network whether its IPsec installer can add a set beside the active one
- Keep the refresh REGISTER as on main when it cannot or when an external transport carries the registration
- Log the skipped offer with the missing capability
- Test the userspace, system and missing installers and both skipped cases
2026-10-28 19:49:11 +08:00
BFNOC 32f12ef1ff fix(imscore): await the P-CSCF after closing a port-s flow on retired SAs
- Classify the close of a port-s flow whose SAs a refresh switch deleted as sa_retired
- Await the P-CSCF reopening port-s over the new SAs instead of treating it as a local close
2026-10-28 19:49:06 +08:00
BFNOC 6b688f458b fix(imscore): switch to new SAs when a refresh REGISTER is re-authenticated
- Install the new SA set alongside the active one for SM7
- Send SM7 on its own flow from the offered port-c with the new Security-Verify
- Keep other requests on the old SAs until the 200
- Make the new SAs and flow active on the 200 and move dialogs onto them
- Retire the old SAs and their flows after a message over the new SAs once no transaction is pending, or at their lifetime end
- Delete the new SAs and keep the binding and old SAs when SM7 gets no response or any final non-2xx answer, including 403 and an IP+Port conflict
- Decline any further challenge to SM7 before AKA
- Check the new Security-Server before AKA and refuse it without answering the challenge
- Keep an SM7 write failure or flow close away from the active flow
- Leave an old flow close during the switch to the switch outcome
- Fail the refresh when the new flow closes before the switch completes
- Route protected UDP by sending port-c while both SA sets exist
- Add alongside install, abort, commit and retire to the IPsec installers
- Retire a replaced SA set on stop, a P-CSCF switch and a fresh registration
- Log which registration flow closed
- Gate a refresh only once its offer is reserved, so a failed reservation refreshes as on main
- Run the initial-reject fallback on refreshes with an offer and rewrite only the offered Security-Client
- Log the fallback retry of an offer and the actual delay before the old SAs retire
- Cite TS 24.229 5.1.1.5.1 for keeping the old SAs and mark our own choices in comments
2026-10-28 19:49:06 +08:00
yibaiba cd4d9876ec fix(ims): preserve compatible MPTCP listeners when checking MSS
Probe TCP_MAXSEG on Linux MPTCP listeners and retry with TCP only for EOPNOTSUPP. Retain compatible MPTCP sockets, propagate other errors, and provide a switch to disable the retry. Stabilize the related registration, subscription, and UDP test fixtures.

Validated real IPv4/IPv6 connections on Linux 5.18 and a Linux 7.0 VM. The 179 IMS suite passed 699 tests and local race checks passed five rounds. The VM MPTCP tests passed; its full suite still hits short-deadline test timeouts, as documented.
2026-10-28 18:49:08 +08:00
BFNOC 2be3e83fe2 fix(imscore): offer new SPIs and port-c on a 2degrees refresh REGISTER
- Add refresh_offers_new_security_client to the IMS register template and every conversion layer
- Enable it in the 2degrees NZ preset
- Reserve a new protected client port on TCP and UDP and draw unused SPIs for each refresh, keeping port-s
- Keep the active SAs, Security-Verify and Authorization on the refresh
- Leave the REGISTER that completes an outbound flow out of the offer
- Decline a challenge that would set up new SAs before AKA and keep the existing binding
- Answer a challenge without Security-Server over the active SAs as before
- Release the offer's reservations on every outcome and log its disposition
- Skip the initial-reject fallback on such refreshes so the active Security-Client is not rewritten
- Log REGISTER response latency
- Add tests for the offer, declined and reused challenges, the key off, outbound completion and binding preservation
2026-10-28 17:34:51 +08:00
yibaiba 5a50a2c697 Merge pull request #87 from BFNOC/pr-sms-ready-after-interrupt
fix(runtimehost): ignore late SMS readiness while IMS is not registered
2026-10-28 16:31:04 +08:00
yibaiba 1e6edd9317 Merge pull request #86 from BFNOC/pr-sms-rx-awaiting-peer
fix(imscore): show SMS RX as awaiting the P-CSCF after a port-s close or timeout
2026-10-28 16:30:43 +08:00
BFNOC e34d905b86 fix(runtimehost): ignore late SMS readiness while IMS is not registered
- Skip the sms_ready state update when IMSReady is false
- Skip SMS readiness snapshots while the runtime is interrupted, retrying, restarting, failed or stopped
- Log each skipped update with the runtime phase
- Test a late snapshot and sms_ready after each down phase
2026-10-28 10:08:23 +08:00
BFNOC 9fbe885c98 fix(imscore): show SMS RX as awaiting the P-CSCF after a port-s close or timeout
- Report a registration whose port-s closed or timed out as awaiting the P-CSCF reconnect
- Report it as not ready again once Vodafone UK validation finds the downlink broken
- Keep reporting not ready after a failed RP report or on another P-CSCF
- Count an RP report failure on the registration flow even when port-s closed during its retries
- Show the awaiting state as pending with its own detail instead of failed in the web UI
- Test the close kinds, every prerequisite, failed validation, report failures, another P-CSCF and the web state
2026-10-28 09:03:49 +08:00
BFNOC eecc55242a fix(swu): wipe the private key of an unused CHILD_SA rekey KE
- Add DiffieHellman.Wipe for the MODP private key, the shared secret and the ECDH key reference
- Use it for every KE a CHILD_SA rekey offered but did not install
- Test refused, mismatched and NONE answers, and that the installed KE is kept
2026-10-27 19:49:39 +08:00
BFNOC 1fe3643732 feat(swu): negotiate optional PFS on CHILD_SA rekey
- Offer the IKE SA D-H group and NONE with KEi when the CHILD_SA has no PFS
- Accept either selection and install the CHILD_SA with or without PFS
- Retry a refused optional-PFS offer once with D-H left out, and the reverse
- Start the next no-PFS rekey with the form that last worked
- Keep D-H transforms ahead of ESN in the rekey proposal
- Reject a D-H selection that carries attributes
- Accept a peer rekey that adds PFS in the IKE SA group
- Name the offer on transport failures and the answer on rejected responses
- Log the offered and selected D-H groups
- Test both D-H forms in both directions, the remembered form, the second rejection and an unretried INVALID_KE_PAYLOAD
2026-10-27 19:49:38 +08:00
BFNOC 4d2ce9111b fix(swu): name our offer when a CHILD_SA rekey is rejected
- Add the offered proposal to a rejected CHILD_SA rekey error
2026-10-27 19:08:58 +08:00
杨伟杰 520c15b582 fix(qmi): add opt-in EC20 request serialization for OrbStack 2026-10-26 16:14:27 +08:00
yibaiba 7f46bde786 test(ims): cover RP report fallback from the registered flow 2026-10-25 22:18:15 +08:00
yibaiba c70182a2d5 Merge pull request #83 from BFNOC/fix-2degrees-port-s-await
fix(ims): await the 2degrees peer after a clean port-s close
2026-10-25 22:17:35 +08:00
yibaiba e2262e5d29 Merge pull request #82 from BFNOC/fix-rp-report-port-uc
fix(ims): start every RP report on the registered flow
2026-10-25 22:17:23 +08:00
yibaiba 941deeba37 Merge pull request #81 from BFNOC/fix-swu-engine-logs
fix(swu): write SWu engine logs to the log file and name rejected IKE rekey responses
2026-10-25 22:17:10 +08:00