-
Notifications
You must be signed in to change notification settings - Fork 144
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
Fix Secure Comparator in PyThemis on 32-bit #555
Conversation
secure_comparator_get_result() returns themis_status_t which is defined as int32_t. We should expect 32-bit integer to be returned here. This kinda worked on 64-bit platforms because of how registers work on x86_64 and how 64-bit values are returned in System V ABI. However, this does not work on i686 and causes Python to see garbage returned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how you found this problem? can we test it somehow?
Our internal CI system has been failing because of Python tests being broken on 32-bit systems due to this bug. (No links since that triggers @shadinua and @gene-eu, see T1393 you-know-where.) I've fired up a Debian Stretch i686 VM, installed Python, run the tests, and the failure immediately reproduced. Keen observation of the source file revealed the issue, and the fix worked on my machine. It also seems to fix the CI build as well, see you-know-what again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great finding. merge it all!
We have been using incorrect return type which breaks PyThemis on 32-bit systems. Let’s use correct type.
Checklist
Benchmark results are attached(not applicable)Example projects and code samples are updated(no API changes)