From c0b4041cbd9d27ce919e861ca05a74843648d7d0 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sun, 2 Aug 2020 08:38:56 +0200 Subject: - actually urlencode parameters in reclaim OIDC --- src/reclaim/plugin_rest_openid_connect.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/reclaim/plugin_rest_openid_connect.c') diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c index 69bbb7af7..faa6e8351 100644 --- a/src/reclaim/plugin_rest_openid_connect.c +++ b/src/reclaim/plugin_rest_openid_connect.c @@ -856,6 +856,7 @@ login_redirect (void *cls) { char *login_base_url; char *new_redirect; + char *tmp; struct MHD_Response *resp; struct GNUNET_Buffer buf = { 0 }; struct RequestHandle *handle = cls; @@ -874,21 +875,32 @@ login_redirect (void *cls) "&%s=%s", OIDC_CLIENT_ID_KEY, handle->oidc->client_id); + GNUNET_STRINGS_urlencode (handle->oidc->redirect_uri, + strlen (handle->oidc->redirect_uri), + &tmp); GNUNET_buffer_write_fstr (&buf, "&%s=%s", OIDC_REDIRECT_URI_KEY, - handle->oidc->redirect_uri); - + tmp); + GNUNET_free (tmp); + GNUNET_STRINGS_urlencode (handle->oidc->scope, + strlen (handle->oidc->scope), + &tmp); GNUNET_buffer_write_fstr (&buf, "&%s=%s", OIDC_SCOPE_KEY, - handle->oidc->scope); + tmp); + GNUNET_free (tmp); if (NULL != handle->oidc->state) { + GNUNET_STRINGS_urlencode (handle->oidc->state, + strlen (handle->oidc->state), + &tmp); GNUNET_buffer_write_fstr (&buf, "&%s=%s", OIDC_STATE_KEY, handle->oidc->state); + GNUNET_free (tmp); } if (NULL != handle->oidc->code_challenge) { @@ -906,10 +918,14 @@ login_redirect (void *cls) } if (NULL != handle->oidc->claims) { + GNUNET_STRINGS_urlencode (handle->oidc->claims, + strlen (handle->oidc->claims), + &tmp); GNUNET_buffer_write_fstr (&buf, "&%s=%s", OIDC_CLAIMS_KEY, - handle->oidc->claims); + tmp); + GNUNET_free (tmp); } new_redirect = GNUNET_buffer_reap_str (&buf); resp = GNUNET_REST_create_response (""); -- cgit v1.2.3