aws_sigv4: fix header computation

Handle canonical headers and signed headers creation as explained here:
https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html

The algo tells that signed and canonical must contain at last host and
x-amz-date.

So we check whatever thoses are present in the curl http headers list.
If they are, we use the one enter by curl user, otherwise we generate
them.  then we to lower, and remove space from each http headers plus
host and x-amz-date, then sort them all by alphabetical order.

This patch also fix a bug with host header, which was ignoring the port.

Closes #7966
This commit is contained in:
Matthias Gatto 2022-01-13 15:53:52 +01:00 committed by Daniel Stenberg
parent 3c0050d13e
commit 29c4aa00a1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
17 changed files with 535 additions and 224 deletions

View file

@ -225,6 +225,7 @@ test1916 test1917 test1918 test1919 \
\
test1933 test1934 test1935 test1936 test1937 test1938 test1939 test1940 \
test1941 test1942 test1943 test1944 test1945 test1946 test1947 test1948 \
test1955 \
\
test2000 test2001 test2002 test2003 test2004 \
\