challenger

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

commit 5a008a27cf424112f979bbab53c29bf27a2edda0
parent 0568c69f666935fba6c533058097e57fa810d12f
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Thu,  9 Jul 2026 21:30:01 +0200

fix comments, DCE

Diffstat:
Msrc/challenger/challenger-admin.c | 6+++---
Msrc/challenger/challenger-httpd.c | 3---
Msrc/challenger/challenger-httpd_agpl.c | 4+++-
Msrc/challenger/challenger-httpd_challenge.c | 2+-
Msrc/challenger/challenger-httpd_config.c | 2+-
Dsrc/challenger/challenger-httpd_mhd.c | 56--------------------------------------------------------
Dsrc/challenger/challenger-httpd_mhd.h | 60------------------------------------------------------------
Msrc/challenger/meson.build | 1-
Msrc/util/os_installation.c | 2+-
9 files changed, 9 insertions(+), 127 deletions(-)

diff --git a/src/challenger/challenger-admin.c b/src/challenger/challenger-admin.c @@ -249,8 +249,8 @@ cleanup: /** - * The main function of the client management tool. Used to add or - * remove clients from the Challenger' database. + * The main function of the client management tool. Used to add, + * modify or remove clients from the Challenger' database. * * @param argc number of arguments from the command line * @param argv command line arguments @@ -298,4 +298,4 @@ main (int argc, } -/* end of challenger-dbinit.c */ +/* end of challenger-admin.c */ diff --git a/src/challenger/challenger-httpd.c b/src/challenger/challenger-httpd.c @@ -29,7 +29,6 @@ #include "challenger-httpd_challenge.h" #include "challenger-httpd_config.h" #include "challenger-httpd_info.h" -#include "challenger-httpd_mhd.h" #include "challenger-httpd_setup.h" #include "challenger-httpd_solve.h" #include "challenger-httpd_token.h" @@ -666,7 +665,6 @@ run (void *cls, "CHALLENGER", "MESSAGE_TEMPLATE_FILE", strerror (errno)); - GNUNET_free (tmpl_file); GNUNET_break (0 == close (fd)); global_ret = EXIT_NOTCONFIGURED; GNUNET_SCHEDULER_shutdown (); @@ -686,7 +684,6 @@ run (void *cls, "CHALLENGER", "MESSAGE_TEMPLATE_FILE", strerror (errno)); - GNUNET_free (tmpl_file); global_ret = EXIT_NOTCONFIGURED; GNUNET_SCHEDULER_shutdown (); return; diff --git a/src/challenger/challenger-httpd_agpl.c b/src/challenger/challenger-httpd_agpl.c @@ -15,7 +15,7 @@ */ /** * @file challenger/challenger-httpd_agpl.c - * @brief headers for /agpl handler + * @brief implementation of /agpl handler * @author Christian Grothoff */ #include "platform.h" @@ -28,6 +28,8 @@ CH_handler_agpl (struct CH_HandlerContext *hc, const char *upload_data, size_t *upload_data_size) { + (void) upload_data; + (void) upload_data_size; return TALER_MHD_reply_agpl ( hc->connection, "https://git.taler.net/challenger.git/"); diff --git a/src/challenger/challenger-httpd_challenge.c b/src/challenger/challenger-httpd_challenge.c @@ -123,7 +123,7 @@ struct ChallengeContext unsigned long int exit_code; /** - * Number of bytes in @a address, excluding 0-terminator. + * Number of bytes in @a data, excluding 0-terminator. */ size_t data_len; diff --git a/src/challenger/challenger-httpd_config.c b/src/challenger/challenger-httpd_config.c @@ -15,7 +15,7 @@ */ /** * @file challenger/challenger-httpd_config.c - * @brief headers for /config handler + * @brief implementation of /config handler * @author Christian Grothoff */ #include "platform.h" diff --git a/src/challenger/challenger-httpd_mhd.c b/src/challenger/challenger-httpd_mhd.c @@ -1,56 +0,0 @@ -/* - This file is part of Challenger - Copyright (C) 2023 Taler Systems SA - - Challenger is free software; you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - Challenger is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License along with - Challenger; see the file COPYING. If not, see <http://www.gnu.org/licenses/> -*/ -/** - * @file challenger-httpd_mhd.c - * @brief helpers for MHD interaction - * @author Christian Grothoff - */ -#include "platform.h" -#include <jansson.h> -#include "challenger-httpd_mhd.h" - - -enum MHD_Result -CH_MHD_handler_root (struct CH_HandlerContext *hc, - const char *upload_data, - size_t *upload_data_size) -{ - const char *msg = - "Hello, I'm challenger. This HTTP server is not for humans.\n"; - - (void) upload_data; - (void) upload_data_size; - return TALER_MHD_reply_static (hc->connection, - MHD_HTTP_OK, - "text/plain", - msg, - strlen (msg)); -} - - -enum MHD_Result -CH_MHD_handler_agpl_redirect (struct CH_HandlerContext *hc, - const char *upload_data, - size_t *upload_data_size) -{ - (void) upload_data; - (void) upload_data_size; - return TALER_MHD_reply_agpl (hc->connection, - "https://git.taler.net/challenger.git"); -} - - -/* end of challenger-httpd_mhd.c */ diff --git a/src/challenger/challenger-httpd_mhd.h b/src/challenger/challenger-httpd_mhd.h @@ -1,60 +0,0 @@ -/* - This file is part of Challenger - Copyright (C) 2023 Taler Systems SA - - Challenger is free software; you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - Challenger is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License along with - Challenger; see the file COPYING. If not, see <http://www.gnu.org/licenses/> -*/ - -/** - * @file challenger-httpd_mhd.h - * @brief helpers for MHD interaction, used to generate simple responses - * @author Florian Dold - * @author Benedikt Mueller - * @author Christian Grothoff - */ -#ifndef CHALLENGER_HTTPD_MHD_H -#define CHALLENGER_HTTPD_MHD_H -#include <gnunet/gnunet_util_lib.h> -#include <microhttpd.h> -#include "challenger-httpd.h" - - -/** - * Function to call to for "/" requests. - * - * @param[in,out] hc handler context - * @param upload_data data that is being uploaded - * @param[in,out] upload_data_size number of bytes (left) in @a upload_data - * @return MHD result code - */ -enum MHD_Result -CH_MHD_handler_root (struct CH_HandlerContext *hc, - const char *upload_data, - size_t *upload_data_size); - - -/** - * Function to call to handle the request by sending - * back a redirect to the AGPL source code. - * - * @param hc handler context - * @param upload_data upload data - * @param[in,out] upload_data_size number of bytes (left) in @a upload_data - * @return MHD result code - */ -enum MHD_Result -CH_MHD_handler_agpl_redirect (struct CH_HandlerContext *hc, - const char *upload_data, - size_t *upload_data_size); - - -#endif diff --git a/src/challenger/meson.build b/src/challenger/meson.build @@ -63,7 +63,6 @@ challenger_httpd_SOURCES = [ 'challenger-httpd_common.c', 'challenger-httpd_config.c', 'challenger-httpd_info.c', - 'challenger-httpd_mhd.c', 'challenger-httpd_setup.c', 'challenger-httpd_solve.c', 'challenger-httpd_token.c', diff --git a/src/util/os_installation.c b/src/util/os_installation.c @@ -37,7 +37,7 @@ static const struct GNUNET_OS_ProjectData challenger_pd = { .binary_name = "challenger-httpd", .env_varname = "CHALLENGER_PREFIX", .base_config_varname = "CHALLENGER_BASE_CONFIG", - .bug_email = "taler@lists.gnu.org", + .bug_email = "taler@gnu.org", .homepage = "http://www.gnu.org/s/taler/", .config_file = "challenger.conf", .user_config_file = "~/.config/challenger.conf",