Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以实现下steam的手机令牌吗 #1

Closed
lsxuan12138 opened this issue Oct 13, 2024 · 13 comments
Closed

可以实现下steam的手机令牌吗 #1

lsxuan12138 opened this issue Oct 13, 2024 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@lsxuan12138
Copy link
Contributor

如题,基本就是一个修改的totp,可以参考https://github.com/pyauth/pyotp/blob/develop/src/pyotp/contrib/steam.py 里的代码

@lsxuan12138
Copy link
Contributor Author

另外hotp的实现这个库里面也有

@SolidFaker SolidFaker self-assigned this Oct 14, 2024
@SolidFaker
Copy link
Owner

现在已经支持了

@lsxuan12138
Copy link
Contributor Author

收到,幸苦大佬,这个issue我就关了

@lsxuan12138
Copy link
Contributor Author

lsxuan12138 commented Oct 15, 2024

你好,大佬,这个地方直接赋值不对吧,生成的串的长度和原key不一定一样长吧。我测试了很多次,和其他的方式(pyotp以及我自己写的python的实现)得出来的值都对不上,然后把这里的totp函数中用到的值改成实际的key_raw的字符串长度,这里是10,得到的值就对上了。其他的功能我还没有细看,不确定有没有这样的问题。
image

@lsxuan12138 lsxuan12138 reopened this Oct 15, 2024
@lsxuan12138
Copy link
Contributor Author

然后我又发现steam的值还是对不上,仔细看了下源代码,这部分steam的TokenDigits应该是10,可见pyotp的这部分(第二个图)https://github.com/pyauth/pyotp/blob/develop/src/pyotp/contrib/steam.py
image
image

@lsxuan12138
Copy link
Contributor Author

lsxuan12138 commented Oct 15, 2024

然后我又发现steam的值还是对不上,仔细看了下源代码,这部分steam的TokenDigits应该是10,可见pyotp的这部分(第二个图)https://github.com/pyauth/pyotp/blob/develop/src/pyotp/contrib/steam.py image image

这个地方虽然已经赋值为10,但是通过以下方法打印(第一个图)出的值还是6(第二个图),可能需要进一步排查,目前我技术有限,需要仓库拥有者或者其他大佬的跟进
image

image

@lsxuan12138
Copy link
Contributor Author

然后我又发现steam的值还是对不上,仔细看了下源代码,这部分steam的TokenDigits应该是10,可见pyotp的这部分(第二个图)https://github.com/pyauth/pyotp/blob/develop/src/pyotp/contrib/steam.py image image

还要提一下就是,只有当前面提到的key_raw_len和传入的digits同时修改为正确的,20和10,Steam令牌的值才会正确

@SolidFaker
Copy link
Owner

这确实是个bug,奇怪的是在我这里工作却是正常的,我待会修复一下你再试试。
我这边出来的Steam Token是正确的

@SolidFaker
Copy link
Owner

然后我又发现steam的值还是对不上,仔细看了下源代码,这部分steam的TokenDigits应该是10,可见pyotp的这部分(第二个图)https://github.com/pyauth/pyotp/blob/develop/src/pyotp/contrib/steam.py image image

这个地方虽然已经赋值为10,但是通过以下方法打印(第一个图)出的值还是6(第二个图),可能需要进一步排查,目前我技术有限,需要仓库拥有者或者其他大佬的跟进 image

image

在SteamConfigDialog.ets的addNewConfigOTP函数里断点看看最后的值是多少?

@lsxuan12138
Copy link
Contributor Author

额,这块的逻辑没太搞懂,我直接在这里添加为啥没进断点啊(模拟器不能用相机,直接程序崩溃退出了)
image

@lsxuan12138
Copy link
Contributor Author

额,这块的逻辑没太搞懂,我直接在这里添加为啥没进断点啊(模拟器不能用相机,直接程序崩溃退出了) image

我又大致看了下代码,通过这种方式添加好像没进这个函数addNewConfigOTP,digits直接用的默认值?

@SolidFaker
Copy link
Owner

额,这块的逻辑没太搞懂,我直接在这里添加为啥没进断点啊(模拟器不能用相机,直接程序崩溃退出了) image

模拟器啊,我知道问题在哪了,应该已经修复,更新试试

@lsxuan12138
Copy link
Contributor Author

可以了,我这里正常了

@SolidFaker SolidFaker added the enhancement New feature or request label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants