mirror of
https://github.com/yibaiba/hideck.git
synced 2026-12-06 08:02:21 +00:00
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>
28 lines
711 B
Go
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))
|
|
}
|
|
}
|