[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-challenger] branch master updated: -fix FTBFS
From: |
gnunet |
Subject: |
[taler-challenger] branch master updated: -fix FTBFS |
Date: |
Wed, 26 Apr 2023 23:28:17 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository challenger.
The following commit(s) were added to refs/heads/master by this push:
new 8e90d4f -fix FTBFS
8e90d4f is described below
commit 8e90d4f613c0347922dbe1eb73f5ef9287bf1743
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Apr 26 23:28:14 2023 +0200
-fix FTBFS
---
src/challenger/challenger-httpd.c | 14 +++++++++-----
src/challenger/challenger-httpd_common.c | 13 +++++++++----
src/challenger/challenger-httpd_setup.c | 13 +++++++------
3 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/src/challenger/challenger-httpd.c
b/src/challenger/challenger-httpd.c
index b3934b7..01975fb 100644
--- a/src/challenger/challenger-httpd.c
+++ b/src/challenger/challenger-httpd.c
@@ -75,6 +75,10 @@ static struct MHD_Daemon *mhd;
*/
struct CHALLENGER_DatabasePlugin *db;
+/**
+ * How long is an individual validation request valid?
+ */
+struct GNUNET_TIME_Relative CH_validation_duration;
/**
* A client has requested the given url using the given method
@@ -268,7 +272,7 @@ url_handler (void *cls,
GNUNET_SCHEDULER_begin_async_scope (&hc->async_scope_id);
}
GNUNET_assert (NULL != hc->rh);
- hc->path = &url[strlen (rh->url)];
+ hc->path = &url[strlen (hc->rh->url)];
return hc->rh->handler (hc,
upload_data,
upload_data_size);
@@ -492,10 +496,10 @@ run (void *cls,
go |= TALER_MHD_GO_FORCE_CONNECTION_CLOSE;
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_relative_time (config,
- "CHALLENGER",
- "VALIDATION_DURATION",
- &CH_validation_duration))
+ GNUNET_CONFIGURATION_get_value_time (config,
+ "CHALLENGER",
+ "VALIDATION_DURATION",
+ &CH_validation_duration))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"CHALLENGER",
diff --git a/src/challenger/challenger-httpd_common.c
b/src/challenger/challenger-httpd_common.c
index 12d4fa3..e79964e 100644
--- a/src/challenger/challenger-httpd_common.c
+++ b/src/challenger/challenger-httpd_common.c
@@ -18,26 +18,31 @@
* @brief common helper functions
* @author Christian Grothoff
*/
+#include "platform.h"
#include "challenger-httpd_common.h"
+#define RFC_8959_PREFIX "secret-token:"
+
const char *
CH_get_client_secret (struct MHD_Connection *connection)
{
- const char *auth;
const char *bearer = "Bearer ";
- const char *tok = *auth;
+ const char *auth;
+ const char *tok;
auth = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
MHD_HTTP_HEADER_AUTHORIZATION);
- if (0 != strncmp (tok,
+ if (NULL == auth)
+ return NULL;
+ if (0 != strncmp (auth,
bearer,
strlen (bearer)))
{
return NULL;
}
- tok = tok + strlen (bearer);
+ tok = auth + strlen (bearer);
while (' ' == *tok)
tok++;
if (0 != strncasecmp (tok,
diff --git a/src/challenger/challenger-httpd_setup.c
b/src/challenger/challenger-httpd_setup.c
index d1b8d5d..2e02f3d 100644
--- a/src/challenger/challenger-httpd_setup.c
+++ b/src/challenger/challenger-httpd_setup.c
@@ -48,7 +48,7 @@ CH_handler_setup (struct CH_HandlerContext *hc,
hc->path);
}
}
- client_secret = CH_get_client_secret (connection);
+ client_secret = CH_get_client_secret (hc->connection);
if (NULL == client_secret)
{
GNUNET_break_op (0);
@@ -97,6 +97,7 @@ CH_handler_setup (struct CH_HandlerContext *hc,
&nonce,
sizeof (nonce));
qs = db->validation_setup (db->cls,
+ client_id,
&nonce,
expiration_time);
switch (qs)
@@ -117,10 +118,10 @@ CH_handler_setup (struct CH_HandlerContext *hc,
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
break;
}
+ return TALER_MHD_REPLY_JSON_PACK (
+ hc->connection,
+ MHD_HTTP_OK,
+ GNUNET_JSON_pack_data_auto ("nonce",
+ &nonce));
}
- return TALER_MHD_REPLY_JSON_PACK (
- hc->connection,
- MHD_HTTP_OK,
- GNUNET_JSON_pack_data_auto ("nonce",
- &nonce));
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-challenger] branch master updated: -fix FTBFS,
gnunet <=