-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Issue with SecurityAccess #145
Comments
1st byte is an echo of the security access, 4 last bytes is the seed. SecurityAccess.interpret_response will extract it and put it in response.service_data, check the doc Also, do you know that the client can unlock a session by itself? You just need to provide your algorithm. Check the doc again |
Thank you for a fast response :) |
I'm pretty sure you haven't looked much at the link I gave you :) So what you are trying to do is : A cleaner approach would be: SecurityAccess.interpret_response(response, SecrutiyAccess.Mode.RequestSeed)
int.from_bytes(response.service_data.seed) But even that is unnecessary work. You could replace most of your code by something like this: def myalgo(level, seed, params):
# level = 5 in this case. Params=None because security_algo_params is unset
seedint = int.from_bytes(seed, 'big')
key = get_key_by_seed(seedint)
keybytes = key.to_bytes(4, byteorder="big")
return keybytes
client.set_config('security_algo', myalgo)
client.unlock_security_access(5) # Everything happens here. Exception in case of failure. |
Yeah, I put response.data[1:] it start works fine. |
Hello. I have strange behavior with SecurityAccess.
Where is seed in response?
My code is simple.
The text was updated successfully, but these errors were encountered: