mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
raop: Use the real URI for digest authentication rather than *
Yamaha MusicCast (or at least the RX-A880) seems to be stricter about the URI here, as it rejects `*`. Examples, such as those documented by OpenAirplay, use the real URI.
This commit is contained in:
parent
f613922d0e
commit
4b0945bf01
3 changed files with 12 additions and 4 deletions
|
|
@ -1219,7 +1219,7 @@ static int rtsp_do_auth(struct impl *impl, const struct spa_dict *headers)
|
|||
spa_scnprintf(auth, sizeof(auth), "Basic %s", enc);
|
||||
}
|
||||
else if (spa_streq(tokens[0], "Digest")) {
|
||||
const char *realm, *nonce;
|
||||
const char *realm, *nonce, *url;
|
||||
char h1[MD5_HASH_LENGTH+1];
|
||||
char h2[MD5_HASH_LENGTH+1];
|
||||
char resp[MD5_HASH_LENGTH+1];
|
||||
|
|
@ -1229,13 +1229,15 @@ static int rtsp_do_auth(struct impl *impl, const struct spa_dict *headers)
|
|||
if (realm == NULL || nonce == NULL)
|
||||
goto error;
|
||||
|
||||
url = pw_rtsp_client_get_url(impl->rtsp);
|
||||
|
||||
MD5_hash(h1, "%s:%s:%s", DEFAULT_USER_NAME, realm, impl->password);
|
||||
MD5_hash(h2, "OPTIONS:*");
|
||||
MD5_hash(h2, "OPTIONS:%s", url);
|
||||
MD5_hash(resp, "%s:%s:%s", h1, nonce, h2);
|
||||
|
||||
spa_scnprintf(auth, sizeof(auth),
|
||||
"username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"*\", response=\"%s\"",
|
||||
DEFAULT_USER_NAME, realm, nonce, resp);
|
||||
"username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"",
|
||||
DEFAULT_USER_NAME, realm, nonce, url, resp);
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue