digest: support SHA-512/256

Also fix the tests. New implementation tested with GNU libmicrohttpd.
The new numbers in tests are real SHA-512/256 numbers (not just some
random ;) numbers ).
This commit is contained in:
Evgeny Grin 2024-02-08 10:31:12 +01:00 committed by Daniel Stenberg
parent 6d6113e122
commit e3461bbd05
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 40 additions and 13 deletions

View file

@ -52,6 +52,7 @@ http
<features>
!SSPI
crypto
sha512-256
</features>
<name>
HTTP POST --digest with SHA-512-256, userhash=false and user-specified Content-Length header
@ -76,7 +77,7 @@ Content-Type: application/x-www-form-urlencoded
POST /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="4bc9c97a72f1856bcec9b0e1518c6b7ee28773f91357d56840bdc30bd89ca68f", algorithm=SHA-512-256
Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="0ba2f7ec8045446588eea82bb0c3812aedb05f4eac8883ea65040a52e9c5629e", algorithm=SHA-512-256
User-Agent: curl/%VERSION
Accept: */*
Content-Length: 11