diff options
| author | 2023-02-02 04:16:17 +0100 | |
|---|---|---|
| committer | 2023-02-02 04:16:17 +0100 | |
| commit | 829cdb672194bf9354455aa1807172ec83d85a95 (patch) | |
| tree | 5e444232411d9c87879d18ff4340ad6ee95c92b5 /http.c | |
| parent | New function http_signed_request_raw(). (diff) | |
| download | penes-snac2-829cdb672194bf9354455aa1807172ec83d85a95.tar.gz penes-snac2-829cdb672194bf9354455aa1807172ec83d85a95.tar.xz penes-snac2-829cdb672194bf9354455aa1807172ec83d85a95.zip | |
Move the #main-key adding back to the origin.
Diffstat (limited to '')
| -rw-r--r-- | http.c | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -70,7 +70,7 @@ xs_dict *http_signed_request_raw(const char *keyid, const char *seckey, | |||
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | /* build now the signature header */ | 72 | /* build now the signature header */ |
| 73 | signature = xs_fmt("keyId=\"%s\"," | 73 | signature = xs_fmt("keyId=\"%s#main-key\"," |
| 74 | "algorithm=\"rsa-sha256\"," | 74 | "algorithm=\"rsa-sha256\"," |
| 75 | "headers=\"(request-target) host digest date\"," | 75 | "headers=\"(request-target) host digest date\"," |
| 76 | "signature=\"%s\"", | 76 | "signature=\"%s\"", |
| @@ -109,11 +109,10 @@ xs_dict *http_signed_request(snac *snac, const char *method, const char *url, | |||
| 109 | int timeout) | 109 | int timeout) |
| 110 | /* does a signed HTTP request */ | 110 | /* does a signed HTTP request */ |
| 111 | { | 111 | { |
| 112 | xs *keyid = xs_fmt("%s#main-key", snac->actor); | ||
| 113 | char *seckey = xs_dict_get(snac->key, "secret"); | 112 | char *seckey = xs_dict_get(snac->key, "secret"); |
| 114 | xs_dict *response; | 113 | xs_dict *response; |
| 115 | 114 | ||
| 116 | response = http_signed_request_raw(keyid, seckey, method, url, | 115 | response = http_signed_request_raw(snac->actor, seckey, method, url, |
| 117 | headers, body, b_size, status, payload, p_size, timeout); | 116 | headers, body, b_size, status, payload, p_size, timeout); |
| 118 | 117 | ||
| 119 | return response; | 118 | return response; |