mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Minor tweak in http signatures.
This commit is contained in:
parent
6f7f98ded3
commit
fcf9329449
1 changed files with 10 additions and 6 deletions
16
http.c
16
http.c
|
@ -17,7 +17,7 @@ d_char *http_signed_request(snac *snac, char *method, char *url,
|
||||||
{
|
{
|
||||||
xs *l1;
|
xs *l1;
|
||||||
xs *date;
|
xs *date;
|
||||||
xs *digest_b64, *digest;
|
xs *digest;
|
||||||
xs *s64;
|
xs *s64;
|
||||||
xs *signature;
|
xs *signature;
|
||||||
xs *hdrs;
|
xs *hdrs;
|
||||||
|
@ -43,12 +43,16 @@ d_char *http_signed_request(snac *snac, char *method, char *url,
|
||||||
target = "";
|
target = "";
|
||||||
|
|
||||||
/* digest */
|
/* digest */
|
||||||
if (body != NULL)
|
{
|
||||||
digest_b64 = xs_sha256_base64(body, b_size);
|
xs *s;
|
||||||
else
|
|
||||||
digest_b64 = xs_sha256_base64("", 0);
|
|
||||||
|
|
||||||
digest = xs_fmt("SHA-256=%s", digest_b64);
|
if (body != NULL)
|
||||||
|
s = xs_sha256_base64(body, b_size);
|
||||||
|
else
|
||||||
|
s = xs_sha256_base64("", 0);
|
||||||
|
|
||||||
|
digest = xs_fmt("SHA-256=%s", s);
|
||||||
|
}
|
||||||
|
|
||||||
seckey = xs_dict_get(snac->key, "secret");
|
seckey = xs_dict_get(snac->key, "secret");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue