Mmx233 / BitSrunLoginGo

深澜校园网登录程序 Go 语言版,适用于Windows、Linux、路由器等。提供对 Docker、Go Module、OpenWrt 的支持
GNU Affero General Public License v3.0
303 stars 27 forks source link

修复登录验证过程中部分信息因 json 转化后乱序而无法登录的问题 #32

Closed qianfanguojin closed 5 months ago

qianfanguojin commented 5 months ago

在进入登录验证的最后一步前,需要使用部分验证信息获取加密的字符串。需要使用的验证信息: image 由于 Go 的 json.Marshal 方法会将由 Map 所声明的 json 数据按照 Map 中 key 的字母表顺序排列,所以得到的 json 字符串为:

"{\"acid\":\"x\",\"enc_ver\":\"srun_bx1\",\"ip\":\"xxxx\",\"password\":\"xxxx\",\"username\":\"xxxx\"}"

在处理信息的过程中,sensCode 方法根据 content 字符串的内容(上文中的 json 字符串)组装得到 pwd: image

很明显根据不同的 content 字符串得到的 pwd 结果也不一样。

在使用默认的登录情况下,