Skip to content

Fix bug regarding null character#2

Open
rahul003 wants to merge 1 commit intobradclawsie:masterfrom
rahul003:rahul003-patch-1
Open

Fix bug regarding null character#2
rahul003 wants to merge 1 commit intobradclawsie:masterfrom
rahul003:rahul003-patch-1

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