challenger

OAuth 2.0-based authentication service that validates user can receive messages at a certain address
Log | Files | Refs | Submodules | README | LICENSE

commit 7be09dcc18d9b1dff53db38c6da71d3a68349fc8
parent 495f292a0c542337cff6c44d7b5d26103cb849cc
Author: Bohdan Potuzhnyi <potub1@bfh.ch>
Date:   Sun, 15 Sep 2024 10:28:27 +0000

code cleaning and styling

Diffstat:
Msrc/challenger/challenger-httpd_authorize.c | 10+++++-----
Msrc/challenger/challenger-httpd_config.c | 2+-
Msrc/challenger/challenger-httpd_token.c | 7++++---
Msrc/challengerdb/challenger-0001.sql | 4++--
Msrc/challengerdb/pg_authorize_start.c | 1+
Msrc/challengerdb/pg_authorize_start.h | 1+
Msrc/challengerdb/plugin_challengerdb_postgres.c | 2+-
7 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/challenger/challenger-httpd_authorize.c b/src/challenger/challenger-httpd_authorize.c @@ -144,20 +144,20 @@ CH_handler_authorize (struct CH_HandlerContext *hc, = MHD_lookup_connection_value (hc->connection, MHD_GET_ARGUMENT_KIND, "redirect_uri"); - + code_challenge = MHD_lookup_connection_value(hc->connection, MHD_GET_ARGUMENT_KIND, "code_challenge"); - + code_challenge_method = MHD_lookup_connection_value(hc->connection, MHD_GET_ARGUMENT_KIND, - "code_challenge_method"); + "code_challenge_method"); if (NULL != code_challenge) { if (NULL == code_challenge_method) code_challenge_method = "plain"; } - + /** * Safe check to not allow public clients without s256 code_challenge */ @@ -178,7 +178,7 @@ CH_handler_authorize (struct CH_HandlerContext *hc, TALER_EC_GENERIC_PARAMETER_MALFORMED, "redirect_uri (has to start with 'http://' or 'https://' or not use 'plain'/NULL as code_challenge)"); } - + state = MHD_lookup_connection_value (hc->connection, MHD_GET_ARGUMENT_KIND, diff --git a/src/challenger/challenger-httpd_config.c b/src/challenger/challenger-httpd_config.c @@ -28,7 +28,7 @@ * * 0: original design * 1: revision to support SPA - * 2: + * 2: * 3: added support for RFC7636 */ diff --git a/src/challenger/challenger-httpd_token.c b/src/challenger/challenger-httpd_token.c @@ -405,7 +405,8 @@ CH_handler_token (struct CH_HandlerContext *hc, /* Verify the code_challenge if present*/ if (code_challenge != NULL) { - if (bc->code_verifier == NULL){ + if (bc->code_verifier == NULL) + { GNUNET_break_op (0); GNUNET_free (client_scope); GNUNET_free (client_secret); @@ -456,10 +457,10 @@ CH_handler_token (struct CH_HandlerContext *hc, "server_error", TALER_EC_CHALLENGER_HELPER_EXEC_FAILED, "Failed to encode hash to Base64 URL"); - } + } if (0 != strcmp(encoded_hash, code_challenge)) - { + { GNUNET_break_op(0); GNUNET_free(client_scope); GNUNET_free(client_secret); diff --git a/src/challengerdb/challenger-0001.sql b/src/challengerdb/challenger-0001.sql @@ -60,7 +60,7 @@ CREATE TABLE IF NOT EXISTS validations ,client_state VARCHAR ,client_redirect_uri VARCHAR ); - + -- Add columns for PKCE (RFC 7636) ALTER TABLE validations ADD COLUMN IF NOT EXISTS code_challenge VARCHAR, @@ -95,7 +95,7 @@ COMMENT ON COLUMN validations.expiration_time COMMENT ON COLUMN validations.code_challenge IS 'Code challenge used for PKCE'; COMMENT ON COLUMN validations.code_challenge_method - IS 'Code challenge method used for PKCE (plain, s256)'; + IS 'Code challenge method used for PKCE (plain, s256)'; CREATE INDEX IF NOT EXISTS validations_serial ON validations (validation_serial_id); diff --git a/src/challengerdb/pg_authorize_start.c b/src/challengerdb/pg_authorize_start.c @@ -16,6 +16,7 @@ /** * @file challengerdb/pg_authorize_start.c * @brief Implementation of the authorize_start function for Postgres + * @author Christian Grothoff * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ diff --git a/src/challengerdb/pg_authorize_start.h b/src/challengerdb/pg_authorize_start.h @@ -16,6 +16,7 @@ /** * @file challengerdb/pg_authorize_start.h * @brief implementation of the authorize_start function for Postgres + * @author Christian Grothoff * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ diff --git a/src/challengerdb/plugin_challengerdb_postgres.c b/src/challengerdb/plugin_challengerdb_postgres.c @@ -417,7 +417,7 @@ libchallenger_plugin_db_postgres_init (void *cls) plugin->info_get_token = &CH_PG_info_get_token; plugin->token_add_token - = &CH_PG_token_add_token; + = &CH_PG_token_add_token; return plugin; }