def encode_auth_tuple(val, buf, offset, min_len, max_len):
"""
Encode the Auth tuple IE.
Args:
val: (rand, sres, kc) tuple
Returns:
The size of encoded auth tuple (always 34)
"""
(rand, sres, key) = val
if len(rand) != 16 or len(sres) != 4 or len(key) != 8:
raise GSUPCodecError(
"Bad auth tuple to encode: rand: %s, sres: %s, key: %s"
% (rand, sres, key))
struct.pack_into(
'2B16s2B4s2B8s', buf, offset,
IEType.RAND, 16, rand, IEType.SRES, 4, sres,
IEType.KC_KEY, 8, key)
return 34
gsup.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录