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

Fix bug regarding null character #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rahul003
Copy link

Thanks for your implementation. It was a helpful reference when I needed to implement Sig4 in CPP.
However there's a bug in your signature calculation code. When dealing with binary data, which can contain null characters, using strlen gives incomplete size. This was the source of a bug which took a lot of time to debug. I kept getting signature wrong responses from AWS.

Also, copy to c_string is unncessary. Strcpy is also slow. And conversion to hex can be done in a cleaner CPP style. If you don't want to incorporate these CPP style changes, I can remove them. Please let me know.

A reference for the null char issue https://stackoverflow.com/a/41601493/2382819

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

Successfully merging this pull request may close these issues.

1 participant