summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2014-07-28 07:08:56 (GMT)
committerNirbheek Chauhan <nirbheek@centricular.com>2014-07-28 07:08:56 (GMT)
commit06a53c87bf2870967ced8af0b32927dfbd7363ca (patch)
treece37cf90d92919072a5bbb4fd78c59d527afa33e /src/main.c
parent9e9eb34d73873c4488d0fe69002dd53e463d62fc (diff)
downloadsoup-transcoding-proxy-06a53c87bf2870967ced8af0b32927dfbd7363ca.zip
soup-transcoding-proxy-06a53c87bf2870967ced8af0b32927dfbd7363ca.tar.gz
server: Verify the UDP client list during token validation
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 8d13d7c..e88ccae 100644
--- a/src/main.c
+++ b/src/main.c
@@ -123,12 +123,18 @@ stp_validate_fetch_token_from_query (GHashTable *tokens,
/* Only needed for RTP streaming */
udp_clients = g_hash_table_lookup (query, "udp-clients");
- if (!udp_clients) {
+ token->udp_clients = g_strdup (udp_clients);
+
+ if (!token->udp_clients) {
*http_status_code = SOUP_STATUS_BAD_REQUEST;
goto err;
}
- token->udp_clients = g_strdup (udp_clients);
+ if (!stp_clients_is_subset (perms_token->udp_clients,
+ token->udp_clients)) {
+ *http_status_code = SOUP_STATUS_FORBIDDEN;
+ goto err;
+ }
out:
g_hash_table_destroy (query);