aws-sigv4: fix signature when post data is in binary#7844
Conversation
|
Have you looked into adding a test case that verifies this? /cc @outscale-mgo this PR looks fine right? |
|
Wait, what happens if you decide to post data using the read callback? |
This seems fine to me. |
I think the read callback might not supported by sig-v4 because we need to calculate the signature on all of the post data and send that in the header.
Let me try doing that. |
User sets the post fields size for binary data. Hence, we should not be using strlen on it.
|
Added tests 1937 for regular POST data and 1938 for binary POST data. Both of them are very similar to 1936 which already existed for GET. |
I suspected so. It doesn't feel like you have to fix that issue in this PR, but it feels like a) the code should then return some sort of error early instead of continuing and pretending it might actually work - and b) the limitation should probably be documented clearly. |
|
Thanks! |
User sets the post fields size for binary data. Hence, we should not be using
strlenon it.The code is very similar to the one here in mqtt.c.
I have performed basic sanity testing but do let me know if anything more is required.
Python code to create a binary test file with null character:
Build and installation:
Curl command to test:
I put a log statement (for testing) to confirm the fix: