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

Python3 - invalid signature, str vs bytes, in sha256, in put_object #435

Closed
rrozestw opened this issue Dec 8, 2016 · 5 comments
Closed

Comments

@rrozestw
Copy link

rrozestw commented Dec 8, 2016

In api.py, in function put_object there is a line:

data_sha256_hex = encode_to_hex(get_sha256(current_data))

which causes the upload code using put_object fail when running under python 3.5 with invalid signature error. Sha256 hex string contains "r'" and "'" (sic). It makes signatures computed and sent different.
The line shall be:

data_sha256_hex = encode_to_hex(get_sha256(current_data)).decode('ascii')

As I went with other solution to my problems, I don't have time to fully fix this issue (as it seems that in some places bytes are used; in some - strings - I'd has to be a more systematic fix to support python3 IMHO).

@harshavardhana
Copy link
Member

This is fixed in master already. Thanks for reporting will be making a new release. @rrozestw

@harshavardhana
Copy link
Member

ping // cc @donatello

@rrozestw
Copy link
Author

rrozestw commented Dec 8, 2016

I tested master today - there is no fix for that.

@donatello
Copy link
Member

I ack. the bug. Able to reproduce. Working on a fix.

donatello added a commit to donatello/minio-py that referenced this issue Dec 8, 2016
@donatello donatello added the bug label Dec 9, 2016
@rrozestw
Copy link
Author

rrozestw commented Dec 9, 2016

Thank you for you excellent support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants