[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: errors and plugin
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: errors and plugin |
Date: |
Mon, 19 Oct 2020 23:16:34 +0200 |
This is an automated email from the git hooks/post-receive script.
ds-meister pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 18857ff errors and plugin
18857ff is described below
commit 18857ff4e3eaca81e215e802582340544b9b65af
Author: Dominik Meister <dominik.meister@hotmail.ch>
AuthorDate: Mon Oct 19 23:16:03 2020 +0200
errors and plugin
---
doc/ypsomed/plan.PNG | Bin 145259 -> 0 bytes
doc/ypsomed/system_design.png | Bin 57272 -> 0 bytes
src/backend/Makefile.am | 18 ++++++++++++++
src/backend/anastasis-httpd_policy.c | 13 ++++++++++
src/backend/anastasis_authorization_plugin_file.c | 29 ++++++----------------
src/include/Makefile.am | 2 +-
src/include/anastasis_authorization_plugin.h | 3 ++-
7 files changed, 42 insertions(+), 23 deletions(-)
diff --git a/doc/ypsomed/plan.PNG b/doc/ypsomed/plan.PNG
deleted file mode 100644
index e62a028..0000000
Binary files a/doc/ypsomed/plan.PNG and /dev/null differ
diff --git a/doc/ypsomed/system_design.png b/doc/ypsomed/system_design.png
deleted file mode 100644
index 52ff118..0000000
Binary files a/doc/ypsomed/system_design.png and /dev/null differ
diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index c16b279..b1f5e9d 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -2,6 +2,24 @@
AM_CPPFLAGS = -I$(top_srcdir)/src/include
pkgcfgdir = $(prefix)/share/anastasis/config.d/
+plugindir = $(libdir)/anastasis
+
+if USE_COVERAGE
+ AM_CFLAGS = --coverage -O0
+ XLIB = -lgcov
+endif
+
+#plugin_LTLIBRARIES = \
+ libanastasis_plugin_authorization_file.la
+#libanastasis_plugin_authorization_file_la_SOURCES = \
+ anastasis_authorization_plugin_file.c
+#libanastasis_plugin_authorization_file_la_LIBADD = \
+ $(LTLIBINTL)
+#libanastasis_plugin_authorization_file_la_LDFLAGS = \
+ $(TALER_PLUGIN_LDFLAGS) \
+ -ljansson \
+ -ltalerutil \
+ -lgnunetutil $(XLIB)
pkgcfg_DATA = \
anastasis.conf
diff --git a/src/backend/anastasis-httpd_policy.c
b/src/backend/anastasis-httpd_policy.c
index 0ca73ef..b2bf8a9 100644
--- a/src/backend/anastasis-httpd_policy.c
+++ b/src/backend/anastasis-httpd_policy.c
@@ -135,6 +135,12 @@ AH_return_policy (struct MHD_Connection *connection,
case ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT:
/* interesting case below */
break;
+ default:
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_SYNC_DB_HARD_FETCH_ERROR,
+ "hard database failure");
+
}
resp = MHD_create_response_from_buffer (res_recovery_data_size,
res_recovery_data,
@@ -298,6 +304,13 @@ AH_policy_get (struct MHD_Connection *connection,
}
/* We have a result, should fetch and return it! */
break;
+ default:
+ GNUNET_break (0);
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_SYNC_DB_HARD_FETCH_ERROR,
+ "hard database failure");
+
}
return AH_return_policy (connection,
&account_pub,
diff --git a/src/backend/anastasis_authorization_plugin_file.c
b/src/backend/anastasis_authorization_plugin_file.c
index 97b0359..4a4949f 100644
--- a/src/backend/anastasis_authorization_plugin_file.c
+++ b/src/backend/anastasis_authorization_plugin_file.c
@@ -18,14 +18,7 @@
* @brief authorization plugin file based for testing
* @author Dominik Meister
*/
-#ifndef ANASTASIS_AUTHORIZATION_PLUGIN_H
-#define ANASTASIS_AUTHORIZATION_PLUGIN_H
-
-#include <gnunet/gnunet_util_lib.h>
-#include <anastasis_error_codes.h>
-#include "anastasis_service.h"
-#include <jansson.h>
-#include <taler/taler_util.h>
+#include "anastasis_authorization_plugin.h"
/**
* Saves the State of a authorization process
@@ -36,7 +29,7 @@ struct ANASTASIS_AUTHORIZATION_State
/**
* Public key of the challenge which is authorised
*/
- const struct ANASTASIS_CRYPTO_TruthPublicKeyP truth_public_key;
+ const struct ANASTASIS_CRYPTO_TruthPublicKeyP *truth_public_key;
/**
* Code which is sent to the user (here saved into a file)
*/
@@ -44,11 +37,7 @@ struct ANASTASIS_AUTHORIZATION_State
/**
* holds the truth information
*/
- char *data;
- /**
- * Size of the data
- */
- size_t data_length;
+ const char *data;
/**
* closure
*/
@@ -95,7 +84,6 @@ file_validate (void *cls,
* @param code secret code that the user has to provide back to satisfy the
challenge in
* the main anastasis protocol
* @param data input to validate (i.e. is it a valid phone number, etc.)
- * @param data_length number of bytes in @a data
* @return state to track progress on the authorization operation, NULL on
failure
*/
struct ANASTASIS_AUTHORIZATION_State *
@@ -110,8 +98,8 @@ file_start (void *cls,
as->cls = cls;
as->truth_public_key = truth_public_key;
as->code = code;
- as->data = data;
- as->data_length = data_length;
+ as->data = GNUNET_STRINGS_data_to_string_alloc (data,
+ data_length);
return as;
}
@@ -136,7 +124,7 @@ file_process (struct ANASTASIS_AUTHORIZATION_State *as,
}
/* print challenge code to file */
- fprintf (f, "%llu", &as->code);
+ fprintf (f, "%lu", as->code);
fclose (f);
return ANASTASIS_AUTHORIZATION_RES_SUCCESS;
}
@@ -168,7 +156,6 @@ libanastasis_plugin_authorization_file_init (void *cls)
plugin->validate = &file_validate;
plugin->start = &file_start;
plugin->process = &file_process;
- plugin->cleanup = &file_cleanup
-
- return plugin;
+ plugin->cleanup = &file_cleanup;
+ return plugin;
}
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 2bb88f1..c9dfab0 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -5,7 +5,6 @@ EXTRA_DIST = \
anastasisincludedir = $(includedir)/anastasis
anastasisinclude_HEADERS = \
- anastasis_authorization_plugin.h \
anastasis_database_plugin.h \
anastasis_service.h \
anastasis_error_codes.h \
@@ -13,4 +12,5 @@ anastasisinclude_HEADERS = \
anastasis_util_lib.h \
anastasis_crypto_lib.h \
anastasis_redux.h \
+ anastasis_authorization_plugin.h \
anastasis.h
diff --git a/src/include/anastasis_authorization_plugin.h
b/src/include/anastasis_authorization_plugin.h
index b9d3732..ab74d1b 100644
--- a/src/include/anastasis_authorization_plugin.h
+++ b/src/include/anastasis_authorization_plugin.h
@@ -22,6 +22,7 @@
#define ANASTASIS_AUTHORIZATION_PLUGIN_H
#include <gnunet/gnunet_util_lib.h>
+#include <gnunet/gnunet_curl_lib.h>
#include <anastasis_error_codes.h>
#include "anastasis_service.h"
#include <jansson.h>
@@ -107,7 +108,6 @@ struct ANASTASIS_AuthorizationPlugin
* @param code secret code that the user has to provide back to satisfy the
challenge in
* the main anastasis protocol
* @param data input to validate (i.e. is it a valid phone number, etc.)
- * @param data_length number of bytes in @a data
* @return state to track progress on the authorization operation, NULL on
failure
*/
struct ANASTASIS_AUTHORIZATION_State *
@@ -117,6 +117,7 @@ struct ANASTASIS_AuthorizationPlugin
const void *data,
size_t data_length);
+
/**
* Begin issuing authentication challenge to user based on @a data.
* I.e. start to send SMS or e-mail or launch video identification.
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: errors and plugin,
gnunet <=