Files
yibaibaandCursor 593cb967bc feat(vowifi): close SMS, hold, outbound, and SWu protocol gaps
Register now advertises outbound, prefers Service-Route then Path, and
tears down RFC 3680 subscriptions in-dialog. Voice adds hold/resume and
RFC 4028 timers; SWu sends AKA' bidding, IKE fragmentation, redirect
limits, and a correctly coded AUTS. Host SMS gets SMMA backpressure and
CS fallback without double-send.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-28 23:19:43 +08:00

28 lines
711 B
Go

package sim
import (
"bytes"
"encoding/hex"
"errors"
"testing"
swusim "github.com/iniwex5/vowifi-go/engine/sim"
)
func TestParseUSIMAuthResponseSyncFailureReturnsErrSyncFailureWithAUTS(t *testing.T) {
auts := bytes.Repeat([]byte{0xCC}, 14)
resp := append([]byte{0xDC, 0x0E}, auts...)
resp = append(resp, 0x90, 0x00)
got, err := ParseUSIMAuthResponse("wwan0", resp)
if !errors.Is(err, swusim.ErrSyncFailure) {
t.Fatalf("err = %v, want ErrSyncFailure", err)
}
if !bytes.Equal(got.AUTS, auts) {
t.Fatalf("AUTS = %s, want %s", hex.EncodeToString(got.AUTS), hex.EncodeToString(auts))
}
if len(got.RES) != 0 {
t.Fatalf("RES = %s, want empty on sync failure", hex.EncodeToString(got.RES))
}
}