aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Ebner <a.e.bner@web.de>2019-10-07 11:48:07 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-10-07 12:18:42 +0200
commit1d468ecabd6c2ee5c0eae672292efa0f51bc9e48 (patch)
tree6b527980752f9603945e070c8187bfbb06232b6f /src
parent5cc45c7ee6a3ac522e5a1f58010d4efdf4fd102f (diff)
downloadgnunet-1d468ecabd6c2ee5c0eae672292efa0f51bc9e48.tar.gz
gnunet-1d468ecabd6c2ee5c0eae672292efa0f51bc9e48.zip
Renamed credential service to abd, replaced all related functions, parameters, etc
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am16
-rw-r--r--src/abd/Makefile.am (renamed from src/credential/Makefile.am)73
-rw-r--r--src/abd/abd.conf.in5
-rw-r--r--src/abd/abd.h (renamed from src/credential/credential.h)27
-rw-r--r--src/abd/abd_api.c (renamed from src/credential/credential_api.c)184
-rw-r--r--src/abd/abd_serialization.c (renamed from src/credential/credential_serialization.c)110
-rw-r--r--src/abd/abd_serialization.h (renamed from src/credential/credential_serialization.h)84
-rw-r--r--src/abd/delegate_misc.c (renamed from src/credential/delegate_misc.c)26
-rw-r--r--src/abd/delegate_misc.h (renamed from src/credential/delegate_misc.h)12
-rw-r--r--src/abd/gnunet-abd.c (renamed from src/credential/gnunet-credential.c)82
-rw-r--r--src/abd/gnunet-service-abd.c (renamed from src/credential/gnunet-service-credential.c)128
-rw-r--r--src/abd/plugin_gnsrecord_abd.c (renamed from src/credential/plugin_gnsrecord_credential.c)65
-rw-r--r--src/abd/plugin_rest_credential.c (renamed from src/credential/plugin_rest_credential.c)0
-rwxr-xr-xsrc/abd/test_abd_bi_and.sh98
-rwxr-xr-xsrc/abd/test_abd_bi_and2.sh94
-rwxr-xr-xsrc/abd/test_abd_bi_and3.sh96
-rwxr-xr-xsrc/abd/test_abd_bi_and4.sh83
-rwxr-xr-xsrc/abd/test_abd_bi_bw.sh87
-rwxr-xr-xsrc/abd/test_abd_bi_bw_link.sh92
-rwxr-xr-xsrc/abd/test_abd_bi_bw_link2.sh93
-rwxr-xr-xsrc/abd/test_abd_bi_fw.sh92
-rw-r--r--src/abd/test_abd_defaults.conf (renamed from src/credential/test_credential_defaults.conf)2
-rwxr-xr-xsrc/abd/test_abd_issue.sh46
-rw-r--r--src/abd/test_abd_lookup.conf (renamed from src/credential/test_credential_lookup.conf)6
-rwxr-xr-xsrc/abd/test_abd_own.sh140
-rwxr-xr-xsrc/abd/test_abd_verify.sh87
-rwxr-xr-xsrc/abd/test_abd_verify_and.sh86
-rwxr-xr-xsrc/abd/test_abd_verify_simple.sh56
-rwxr-xr-xsrc/abd/test_credential_collect.sh (renamed from src/credential/test_credential_collect.sh)0
-rwxr-xr-xsrc/abd/test_credential_collect_rest.sh (renamed from src/credential/test_credential_collect_rest.sh)0
-rwxr-xr-xsrc/abd/test_credential_issue_rest.sh (renamed from src/credential/test_credential_issue_rest.sh)0
-rwxr-xr-xsrc/abd/test_credential_verify_rest.sh (renamed from src/credential/test_credential_verify_rest.sh)0
-rw-r--r--src/credential/credential.conf.in5
-rwxr-xr-xsrc/credential/test_credential_bi_and.sh98
-rwxr-xr-xsrc/credential/test_credential_bi_and2.sh94
-rwxr-xr-xsrc/credential/test_credential_bi_and3.sh96
-rwxr-xr-xsrc/credential/test_credential_bi_and4.sh83
-rwxr-xr-xsrc/credential/test_credential_bi_bw.sh87
-rwxr-xr-xsrc/credential/test_credential_bi_bw_link.sh92
-rwxr-xr-xsrc/credential/test_credential_bi_bw_link2.sh93
-rwxr-xr-xsrc/credential/test_credential_bi_fw.sh92
-rwxr-xr-xsrc/credential/test_credential_issue.sh46
-rwxr-xr-xsrc/credential/test_credential_own.sh140
-rwxr-xr-xsrc/credential/test_credential_verify.sh87
-rwxr-xr-xsrc/credential/test_credential_verify_and.sh87
-rwxr-xr-xsrc/credential/test_credential_verify_simple.sh56
-rw-r--r--src/include/Makefile.am2
-rw-r--r--src/include/gnunet_abd_service.h (renamed from src/include/gnunet_credential_service.h)104
-rw-r--r--src/include/gnunet_gnsrecord_lib.h3
-rw-r--r--src/include/gnunet_protocols.h12
50 files changed, 1612 insertions, 1635 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 217aea54f..51bf2d63d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,7 +12,9 @@ endif
12if HAVE_EXPERIMENTAL 12if HAVE_EXPERIMENTAL
13 EXP_DIR = \ 13 EXP_DIR = \
14 rps \ 14 rps \
15 credential 15 abd \
16 reclaim-attribute \
17 reclaim
16if HAVE_ABE 18if HAVE_ABE
17 EXP_DIR += \ 19 EXP_DIR += \
18 abe 20 abe
@@ -23,7 +25,6 @@ if HAVE_JSON
23endif 25endif
24endif 26endif
25 27
26if HAVE_MHD
27if HAVE_JSON 28if HAVE_JSON
28 JSON_DIR = json 29 JSON_DIR = json
29if HAVE_LIBGNURL 30if HAVE_LIBGNURL
@@ -34,6 +35,13 @@ if HAVE_LIBCURL
34endif 35endif
35endif 36endif
36endif 37endif
38
39if BUILD_PULSE_HELPERS
40CONVERSATION_DIR = conversation
41else
42if BUILD_GST_HELPERS
43CONVERSATION_DIR = conversation
44endif
37endif 45endif
38 46
39if HAVE_SQLITE 47if HAVE_SQLITE
@@ -51,7 +59,6 @@ endif
51if HAVE_MHD 59if HAVE_MHD
52if HAVE_JSON 60if HAVE_JSON
53 REST_DIR = rest 61 REST_DIR = rest
54 RECLAIM_DIR = reclaim-attribute reclaim
55endif 62endif
56endif 63endif
57 64
@@ -109,12 +116,11 @@ SUBDIRS = \
109 vpn \ 116 vpn \
110 gns \ 117 gns \
111 zonemaster \ 118 zonemaster \
112 conversation \ 119 $(CONVERSATION_DIR) \
113 fs \ 120 fs \
114 exit \ 121 exit \
115 pt \ 122 pt \
116 secretsharing \ 123 secretsharing \
117 $(RECLAIM_DIR) \
118 $(EXP_DIR) \ 124 $(EXP_DIR) \
119 integration-tests 125 integration-tests
120 126
diff --git a/src/credential/Makefile.am b/src/abd/Makefile.am
index e72cf4f79..321fb0350 100644
--- a/src/credential/Makefile.am
+++ b/src/abd/Makefile.am
@@ -2,8 +2,8 @@
2AM_CPPFLAGS = -I$(top_srcdir)/src/include 2AM_CPPFLAGS = -I$(top_srcdir)/src/include
3 3
4EXTRA_DIST = \ 4EXTRA_DIST = \
5 test_credential_defaults.conf \ 5 test_abd_defaults.conf \
6 test_credential_lookup.conf 6 test_abd_lookup.conf
7 7
8 8
9if USE_COVERAGE 9if USE_COVERAGE
@@ -17,28 +17,28 @@ libexecdir= $(pkglibdir)/libexec/
17plugindir = $(libdir)/gnunet 17plugindir = $(libdir)/gnunet
18 18
19pkgcfg_DATA = \ 19pkgcfg_DATA = \
20 credential.conf 20 abd.conf
21 21
22 22
23# /usr/lib - compiles a layer which can be used to be communicagte with the service 23# /usr/lib - compiles a layer which can be used to be communicagte with the service
24lib_LTLIBRARIES = \ 24lib_LTLIBRARIES = \
25 libgnunetcredential.la 25 libgnunetabd.la
26 26
27# /usr/lib/gnunet/libexec - Business logic . Separate process 27# /usr/lib/gnunet/libexec - Business logic . Separate process
28libexec_PROGRAMS = \ 28libexec_PROGRAMS = \
29 gnunet-service-credential 29 gnunet-service-abd
30 30
31bin_PROGRAMS = \ 31bin_PROGRAMS = \
32 gnunet-credential 32 gnunet-abd
33 33
34plugin_LTLIBRARIES = \ 34plugin_LTLIBRARIES = \
35 libgnunet_plugin_gnsrecord_credential.la 35 libgnunet_plugin_gnsrecord_abd.la
36 36
37 37
38gnunet_credential_SOURCES = \ 38gnunet_abd_SOURCES = \
39 gnunet-credential.c 39 gnunet-abd.c
40gnunet_credential_LDADD = \ 40gnunet_abd_LDADD = \
41 libgnunetcredential.la \ 41 libgnunetabd.la \
42 $(top_builddir)/src/util/libgnunetutil.la \ 42 $(top_builddir)/src/util/libgnunetutil.la \
43 $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ 43 $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
44 $(top_builddir)/src/identity/libgnunetidentity.la \ 44 $(top_builddir)/src/identity/libgnunetidentity.la \
@@ -46,21 +46,21 @@ gnunet_credential_LDADD = \
46 $(GN_LIBINTL) 46 $(GN_LIBINTL)
47 47
48 48
49libgnunet_plugin_gnsrecord_credential_la_SOURCES = \ 49libgnunet_plugin_gnsrecord_abd_la_SOURCES = \
50 plugin_gnsrecord_credential.c 50 plugin_gnsrecord_abd.c
51libgnunet_plugin_gnsrecord_credential_la_LIBADD = \ 51libgnunet_plugin_gnsrecord_abd_la_LIBADD = \
52 libgnunetcredential.la \ 52 libgnunetabd.la \
53 $(top_builddir)/src/util/libgnunetutil.la \ 53 $(top_builddir)/src/util/libgnunetutil.la \
54 $(LTLIBINTL) 54 $(LTLIBINTL)
55libgnunet_plugin_gnsrecord_credential_la_LDFLAGS = \ 55libgnunet_plugin_gnsrecord_abd_la_LDFLAGS = \
56 $(GN_PLUGIN_LDFLAGS) 56 $(GN_PLUGIN_LDFLAGS)
57 57
58 58
59 59
60gnunet_service_credential_SOURCES = \ 60gnunet_service_abd_SOURCES = \
61 gnunet-service-credential.c 61 gnunet-service-abd.c
62gnunet_service_credential_LDADD = \ 62gnunet_service_abd_LDADD = \
63 libgnunetcredential.la \ 63 libgnunetabd.la \
64 $(top_builddir)/src/util/libgnunetutil.la \ 64 $(top_builddir)/src/util/libgnunetutil.la \
65 $(top_builddir)/src/gns/libgnunetgns.la \ 65 $(top_builddir)/src/gns/libgnunetgns.la \
66 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 66 $(top_builddir)/src/namestore/libgnunetnamestore.la \
@@ -68,24 +68,24 @@ gnunet_service_credential_LDADD = \
68 $(GN_LIBINTL) 68 $(GN_LIBINTL)
69 69
70 70
71libgnunetcredential_la_SOURCES = \ 71libgnunetabd_la_SOURCES = \
72 credential_api.c credential.h\ 72 abd_api.c abd.h\
73 credential_serialization.c \ 73 abd_serialization.c \
74 credential_serialization.h \ 74 abd_serialization.h \
75 delegate_misc.c \ 75 delegate_misc.c \
76 delegate_misc.h 76 delegate_misc.h
77libgnunetcredential_la_LIBADD = \ 77libgnunetabd_la_LIBADD = \
78 $(top_builddir)/src/util/libgnunetutil.la $(XLIB) 78 $(top_builddir)/src/util/libgnunetutil.la $(XLIB)
79libgnunetcredential_la_LDFLAGS = \ 79libgnunetabd_la_LDFLAGS = \
80 $(GN_LIB_LDFLAGS) 80 $(GN_LIB_LDFLAGS)
81 81
82 82
83 83
84check_SCRIPTS = \ 84check_SCRIPTS = \
85 test_credential_issue.sh \ 85 test_abd_issue.sh \
86 test_credential_verify_simple.sh \ 86 test_abd_verify_simple.sh \
87 test_credential_verify.sh \ 87 test_abd_verify.sh \
88 test_credential_verify_and.sh 88 test_abd_verify_and.sh
89 89
90if ENABLE_TEST_RUN 90if ENABLE_TEST_RUN
91if HAVE_SQLITE 91if HAVE_SQLITE
@@ -94,17 +94,16 @@ if HAVE_SQLITE
94endif 94endif
95endif 95endif
96 96
97#libgnunet_plugin_rest_credential_la_SOURCES = \ 97#libgnunet_plugin_rest_abd_la_SOURCES = \
98# plugin_rest_credential.c 98# plugin_rest_abd.c
99#libgnunet_plugin_rest_credential_la_LIBADD = \ 99#libgnunet_plugin_rest_abd_la_LIBADD = \
100# $(top_builddir)/src/credential/libgnunetcredential.la \ 100# $(top_builddir)/src/abd/libgnunetabd.la \
101# $(top_builddir)/src/rest/libgnunetrest.la \ 101# $(top_builddir)/src/rest/libgnunetrest.la \
102# $(top_builddir)/src/identity/libgnunetidentity.la \ 102# $(top_builddir)/src/identity/libgnunetidentity.la \
103# $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ 103# $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
104# $(LTLIBINTL) -ljansson $(MHD_LIBS) 104# $(LTLIBINTL) -ljansson -lmicrohttpd
105#libgnunet_plugin_rest_credential_la_LDFLAGS = \ 105#libgnunet_plugin_rest_abd_la_LDFLAGS = \
106# $(GN_PLUGIN_LDFLAGS) 106# $(GN_PLUGIN_LDFLAGS)
107#libgnunet_plugin_rest_credential_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
108 107
109 108
110 109
diff --git a/src/abd/abd.conf.in b/src/abd/abd.conf.in
new file mode 100644
index 000000000..7baf95fc8
--- /dev/null
+++ b/src/abd/abd.conf.in
@@ -0,0 +1,5 @@
1[abd]
2BINARY = gnunet-service-abd
3UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-abd.sock
4RUN_PER_USER = YES
5OPTIONS = -L DEBUG
diff --git a/src/credential/credential.h b/src/abd/abd.h
index 1dd476814..854814832 100644
--- a/src/credential/credential.h
+++ b/src/abd/abd.h
@@ -11,21 +11,21 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19 */ 19 */
20/** 20/**
21 * @file credential/credential.h 21 * @file abd/abd.h
22 * @brief IPC messages between CREDENTIAL API and CREDENTIAL service 22 * @brief IPC messages between ABD API and ABD service
23 * @author Martin Schanzenbach 23 * @author Martin Schanzenbach
24 */ 24 */
25#ifndef CREDENTIAL_H 25#ifndef ABD_H
26#define CREDENTIAL_H 26#define ABD_H
27 27
28#include "gnunet_credential_service.h" 28#include "gnunet_abd_service.h"
29 29
30GNUNET_NETWORK_STRUCT_BEGIN 30GNUNET_NETWORK_STRUCT_BEGIN
31 31
@@ -35,7 +35,7 @@ GNUNET_NETWORK_STRUCT_BEGIN
35struct CollectMessage 35struct CollectMessage
36{ 36{
37 /** 37 /**
38 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY 38 * Header of type #GNUNET_MESSAGE_TYPE_ABD_VERIFY
39 */ 39 */
40 struct GNUNET_MessageHeader header; 40 struct GNUNET_MessageHeader header;
41 41
@@ -74,7 +74,7 @@ struct CollectMessage
74struct VerifyMessage 74struct VerifyMessage
75{ 75{
76 /** 76 /**
77 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY 77 * Header of type #GNUNET_MESSAGE_TYPE_ABD_VERIFY
78 */ 78 */
79 struct GNUNET_MessageHeader header; 79 struct GNUNET_MessageHeader header;
80 80
@@ -113,12 +113,12 @@ struct VerifyMessage
113 113
114 114
115/** 115/**
116 * Message from CREDENTIAL service to client: new results. 116 * Message from ABD service to client: new results.
117 */ 117 */
118struct DelegationChainResultMessage 118struct DelegationChainResultMessage
119{ 119{
120 /** 120 /**
121 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT 121 * Header of type #GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT
122 */ 122 */
123 struct GNUNET_MessageHeader header; 123 struct GNUNET_MessageHeader header;
124 124
@@ -142,16 +142,16 @@ struct DelegationChainResultMessage
142 */ 142 */
143 uint32_t c_count GNUNET_PACKED; 143 uint32_t c_count GNUNET_PACKED;
144 144
145 /* followed by ad_count GNUNET_CREDENTIAL_RecordData structs*/ 145 /* followed by ad_count GNUNET_ABD_RecordData structs*/
146}; 146};
147 147
148/** 148/**
149 * Message from CREDENTIAL service to client: new results. 149 * Message from ABD service to client: new results.
150 */ 150 */
151struct DelegationChainIntermediateMessage 151struct DelegationChainIntermediateMessage
152{ 152{
153 /** 153 /**
154 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_INTERMEDIATE_RESULT 154 * Header of type #GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT
155 */ 155 */
156 struct GNUNET_MessageHeader header; 156 struct GNUNET_MessageHeader header;
157 157
@@ -205,6 +205,7 @@ struct ChainEntry
205 205
206struct CredentialEntry 206struct CredentialEntry
207{ 207{
208
208 /** 209 /**
209 * The signature for this credential by the issuer 210 * The signature for this credential by the issuer
210 */ 211 */
diff --git a/src/credential/credential_api.c b/src/abd/abd_api.c
index 7acce7d9e..cdc52df91 100644
--- a/src/credential/credential_api.c
+++ b/src/abd/abd_api.c
@@ -18,8 +18,8 @@
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19*/ 19*/
20/** 20/**
21 * @file credential/credential_api.c 21 * @file abd/abd_api.c
22 * @brief library to access the CREDENTIAL service 22 * @brief library to access the ABD service
23 * @author Martin Schanzenbach 23 * @author Martin Schanzenbach
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
@@ -29,39 +29,39 @@
29#include "gnunet_hello_lib.h" 29#include "gnunet_hello_lib.h"
30#include "gnunet_protocols.h" 30#include "gnunet_protocols.h"
31#include "gnunet_signatures.h" 31#include "gnunet_signatures.h"
32#include "credential.h" 32#include "abd.h"
33#include "credential_serialization.h" 33#include "abd_serialization.h"
34#include "gnunet_credential_service.h" 34#include "gnunet_abd_service.h"
35#include "gnunet_identity_service.h" 35#include "gnunet_identity_service.h"
36 36
37 37
38#define LOG(kind, ...) GNUNET_log_from (kind, "credential-api", __VA_ARGS__) 38#define LOG(kind, ...) GNUNET_log_from (kind, "abd-api", __VA_ARGS__)
39 39
40/** 40/**
41 * Handle to a verify request 41 * Handle to a verify request
42 */ 42 */
43struct GNUNET_CREDENTIAL_Request 43struct GNUNET_ABD_Request
44{ 44{
45 45
46 /** 46 /**
47 * DLL 47 * DLL
48 */ 48 */
49 struct GNUNET_CREDENTIAL_Request *next; 49 struct GNUNET_ABD_Request *next;
50 50
51 /** 51 /**
52 * DLL 52 * DLL
53 */ 53 */
54 struct GNUNET_CREDENTIAL_Request *prev; 54 struct GNUNET_ABD_Request *prev;
55 55
56 /** 56 /**
57 * handle to credential service 57 * handle to abd service
58 */ 58 */
59 struct GNUNET_CREDENTIAL_Handle *credential_handle; 59 struct GNUNET_ABD_Handle *abd_handle;
60 60
61 /** 61 /**
62 * processor to call on verify result 62 * processor to call on verify result
63 */ 63 */
64 GNUNET_CREDENTIAL_CredentialResultProcessor verify_proc; 64 GNUNET_ABD_CredentialResultProcessor verify_proc;
65 65
66 /** 66 /**
67 * @e verify_proc closure 67 * @e verify_proc closure
@@ -71,7 +71,7 @@ struct GNUNET_CREDENTIAL_Request
71 /** 71 /**
72 * processor to call on intermediate result 72 * processor to call on intermediate result
73 */ 73 */
74 GNUNET_CREDENTIAL_IntermediateResultProcessor int_proc; 74 GNUNET_ABD_IntermediateResultProcessor int_proc;
75 75
76 /** 76 /**
77 * @e verify_proc2 closure 77 * @e verify_proc2 closure
@@ -91,9 +91,9 @@ struct GNUNET_CREDENTIAL_Request
91 91
92 92
93/** 93/**
94 * Connection to the CREDENTIAL service. 94 * Connection to the ABD service.
95 */ 95 */
96struct GNUNET_CREDENTIAL_Handle 96struct GNUNET_ABD_Handle
97{ 97{
98 98
99 /** 99 /**
@@ -109,12 +109,12 @@ struct GNUNET_CREDENTIAL_Handle
109 /** 109 /**
110 * Head of linked list of active verify requests. 110 * Head of linked list of active verify requests.
111 */ 111 */
112 struct GNUNET_CREDENTIAL_Request *request_head; 112 struct GNUNET_ABD_Request *request_head;
113 113
114 /** 114 /**
115 * Tail of linked list of active verify requests. 115 * Tail of linked list of active verify requests.
116 */ 116 */
117 struct GNUNET_CREDENTIAL_Request *request_tail; 117 struct GNUNET_ABD_Request *request_tail;
118 118
119 /** 119 /**
120 * Reconnect task 120 * Reconnect task
@@ -134,23 +134,23 @@ struct GNUNET_CREDENTIAL_Handle
134 134
135 135
136/** 136/**
137 * Reconnect to CREDENTIAL service. 137 * Reconnect to ABD service.
138 * 138 *
139 * @param handle the handle to the CREDENTIAL service 139 * @param handle the handle to the ABD service
140 */ 140 */
141static void 141static void
142reconnect (struct GNUNET_CREDENTIAL_Handle *handle); 142reconnect (struct GNUNET_ABD_Handle *handle);
143 143
144 144
145/** 145/**
146 * Reconnect to CREDENTIAL 146 * Reconnect to ABD
147 * 147 *
148 * @param cls the handle 148 * @param cls the handle
149 */ 149 */
150static void 150static void
151reconnect_task (void *cls) 151reconnect_task (void *cls)
152{ 152{
153 struct GNUNET_CREDENTIAL_Handle *handle = cls; 153 struct GNUNET_ABD_Handle *handle = cls;
154 154
155 handle->reconnect_task = NULL; 155 handle->reconnect_task = NULL;
156 reconnect (handle); 156 reconnect (handle);
@@ -163,7 +163,7 @@ reconnect_task (void *cls)
163 * @param handle our handle 163 * @param handle our handle
164 */ 164 */
165static void 165static void
166force_reconnect (struct GNUNET_CREDENTIAL_Handle *handle) 166force_reconnect (struct GNUNET_ABD_Handle *handle)
167{ 167{
168 GNUNET_MQ_destroy (handle->mq); 168 GNUNET_MQ_destroy (handle->mq);
169 handle->mq = NULL; 169 handle->mq = NULL;
@@ -181,21 +181,21 @@ force_reconnect (struct GNUNET_CREDENTIAL_Handle *handle)
181 * the same closure specified at the creation of the message queue. 181 * the same closure specified at the creation of the message queue.
182 * Not every message queue implementation supports an error handler. 182 * Not every message queue implementation supports an error handler.
183 * 183 *
184 * @param cls closure with the `struct GNUNET_CREDENTIAL_Handle *` 184 * @param cls closure with the `struct GNUNET_ABD_Handle *`
185 * @param error error code 185 * @param error error code
186 */ 186 */
187static void 187static void
188mq_error_handler (void *cls, enum GNUNET_MQ_Error error) 188mq_error_handler (void *cls, enum GNUNET_MQ_Error error)
189{ 189{
190 struct GNUNET_CREDENTIAL_Handle *handle = cls; 190 struct GNUNET_ABD_Handle *handle = cls;
191 191
192 force_reconnect (handle); 192 force_reconnect (handle);
193} 193}
194 194
195/** 195/**
196 * Check validity of message received from the CREDENTIAL service 196 * Check validity of message received from the ABD service
197 * 197 *
198 * @param cls the `struct GNUNET_CREDENTIAL_Handle *` 198 * @param cls the `struct GNUNET_ABD_Handle *`
199 * @param vr_msg the incoming message 199 * @param vr_msg the incoming message
200 */ 200 */
201static int 201static int
@@ -207,27 +207,27 @@ check_result (void *cls, const struct DelegationChainResultMessage *vr_msg)
207 207
208 208
209/** 209/**
210 * Handler for messages received from the CREDENTIAL service 210 * Handler for messages received from the ABD service
211 * 211 *
212 * @param cls the `struct GNUNET_CREDENTIAL_Handle *` 212 * @param cls the `struct GNUNET_ABD_Handle *`
213 * @param vr_msg the incoming message 213 * @param vr_msg the incoming message
214 */ 214 */
215static void 215static void
216handle_result (void *cls, const struct DelegationChainResultMessage *vr_msg) 216handle_result (void *cls, const struct DelegationChainResultMessage *vr_msg)
217{ 217{
218 struct GNUNET_CREDENTIAL_Handle *handle = cls; 218 struct GNUNET_ABD_Handle *handle = cls;
219 uint32_t r_id = ntohl (vr_msg->id); 219 uint32_t r_id = ntohl (vr_msg->id);
220 struct GNUNET_CREDENTIAL_Request *vr; 220 struct GNUNET_ABD_Request *vr;
221 size_t mlen = ntohs (vr_msg->header.size) - sizeof (*vr_msg); 221 size_t mlen = ntohs (vr_msg->header.size) - sizeof (*vr_msg);
222 uint32_t d_count = ntohl (vr_msg->d_count); 222 uint32_t d_count = ntohl (vr_msg->d_count);
223 uint32_t c_count = ntohl (vr_msg->c_count); 223 uint32_t c_count = ntohl (vr_msg->c_count);
224 struct GNUNET_CREDENTIAL_Delegation d_chain[d_count]; 224 struct GNUNET_ABD_Delegation d_chain[d_count];
225 struct GNUNET_CREDENTIAL_Delegate dels[c_count]; 225 struct GNUNET_ABD_Delegate dels[c_count];
226 GNUNET_CREDENTIAL_CredentialResultProcessor proc; 226 GNUNET_ABD_CredentialResultProcessor proc;
227 void *proc_cls; 227 void *proc_cls;
228 228
229 LOG (GNUNET_ERROR_TYPE_DEBUG, 229 LOG (GNUNET_ERROR_TYPE_DEBUG,
230 "Received verify reply from CREDENTIAL service\n"); 230 "Received verify reply from ABD service\n");
231 for (vr = handle->request_head; NULL != vr; vr = vr->next) 231 for (vr = handle->request_head; NULL != vr; vr = vr->next)
232 if (vr->r_id == r_id) 232 if (vr->r_id == r_id)
233 break; 233 break;
@@ -240,7 +240,7 @@ handle_result (void *cls, const struct DelegationChainResultMessage *vr_msg)
240 GNUNET_free (vr); 240 GNUNET_free (vr);
241 GNUNET_assert ( 241 GNUNET_assert (
242 GNUNET_OK == 242 GNUNET_OK ==
243 GNUNET_CREDENTIAL_delegation_chain_deserialize (mlen, 243 GNUNET_ABD_delegation_chain_deserialize (mlen,
244 (const char *) &vr_msg[1], 244 (const char *) &vr_msg[1],
245 d_count, 245 d_count,
246 d_chain, 246 d_chain,
@@ -267,17 +267,17 @@ check_intermediate (void *cls, const struct DelegationChainIntermediateMessage *
267static void 267static void
268handle_intermediate (void *cls, const struct DelegationChainIntermediateMessage *vr_msg) 268handle_intermediate (void *cls, const struct DelegationChainIntermediateMessage *vr_msg)
269{ 269{
270 struct GNUNET_CREDENTIAL_Handle *handle = cls; 270 struct GNUNET_ABD_Handle *handle = cls;
271 uint32_t r_id = ntohl (vr_msg->id); 271 uint32_t r_id = ntohl (vr_msg->id);
272 uint32_t size = ntohl (vr_msg->size); 272 uint32_t size = ntohl (vr_msg->size);
273 bool is_bw = ntohs(vr_msg->is_bw); 273 bool is_bw = ntohs(vr_msg->is_bw);
274 struct GNUNET_CREDENTIAL_Request *vr; 274 struct GNUNET_ABD_Request *vr;
275 GNUNET_CREDENTIAL_IntermediateResultProcessor proc; 275 GNUNET_ABD_IntermediateResultProcessor proc;
276 void *proc_cls; 276 void *proc_cls;
277 struct GNUNET_CREDENTIAL_Delegation *dd; 277 struct GNUNET_ABD_Delegation *dd;
278 278
279 279
280 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received intermediate reply from CREDENTIAL service\n"); 280 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received intermediate reply from ABD service\n");
281 281
282 for (vr = handle->request_head; NULL != vr; vr = vr->next) 282 for (vr = handle->request_head; NULL != vr; vr = vr->next)
283 if (vr->r_id == r_id) 283 if (vr->r_id == r_id)
@@ -288,10 +288,10 @@ handle_intermediate (void *cls, const struct DelegationChainIntermediateMessage
288 proc = vr->int_proc; 288 proc = vr->int_proc;
289 proc_cls = vr->proc2_cls; 289 proc_cls = vr->proc2_cls;
290 290
291 dd = GNUNET_new (struct GNUNET_CREDENTIAL_Delegation); 291 dd = GNUNET_new (struct GNUNET_ABD_Delegation);
292 GNUNET_assert ( 292 GNUNET_assert (
293 GNUNET_OK == 293 GNUNET_OK ==
294 GNUNET_CREDENTIAL_delegation_chain_deserialize (size, 294 GNUNET_ABD_delegation_chain_deserialize (size,
295 (const char *) &vr_msg[1], 295 (const char *) &vr_msg[1],
296 1, 296 1,
297 dd, 297 dd,
@@ -303,33 +303,33 @@ handle_intermediate (void *cls, const struct DelegationChainIntermediateMessage
303 303
304 304
305/** 305/**
306 * Reconnect to CREDENTIAL service. 306 * Reconnect to ABD service.
307 * 307 *
308 * @param handle the handle to the CREDENTIAL service 308 * @param handle the handle to the ABD service
309 */ 309 */
310static void 310static void
311reconnect (struct GNUNET_CREDENTIAL_Handle *handle) 311reconnect (struct GNUNET_ABD_Handle *handle)
312{ 312{
313 struct GNUNET_MQ_MessageHandler handlers[] = 313 struct GNUNET_MQ_MessageHandler handlers[] =
314 {GNUNET_MQ_hd_var_size (result, 314 {GNUNET_MQ_hd_var_size (result,
315 GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT, 315 GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT,
316 struct DelegationChainResultMessage, 316 struct DelegationChainResultMessage,
317 handle), 317 handle),
318 GNUNET_MQ_hd_var_size (result, 318 GNUNET_MQ_hd_var_size (result,
319 GNUNET_MESSAGE_TYPE_CREDENTIAL_COLLECT_RESULT, 319 GNUNET_MESSAGE_TYPE_ABD_COLLECT_RESULT,
320 struct DelegationChainResultMessage, 320 struct DelegationChainResultMessage,
321 handle), 321 handle),
322 GNUNET_MQ_hd_var_size (intermediate, 322 GNUNET_MQ_hd_var_size (intermediate,
323 GNUNET_MESSAGE_TYPE_CREDENTIAL_INTERMEDIATE_RESULT, 323 GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT,
324 struct DelegationChainIntermediateMessage, 324 struct DelegationChainIntermediateMessage,
325 handle), 325 handle),
326 GNUNET_MQ_handler_end ()}; 326 GNUNET_MQ_handler_end ()};
327 struct GNUNET_CREDENTIAL_Request *vr; 327 struct GNUNET_ABD_Request *vr;
328 328
329 GNUNET_assert (NULL == handle->mq); 329 GNUNET_assert (NULL == handle->mq);
330 LOG (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to CREDENTIAL\n"); 330 LOG (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to ABD\n");
331 handle->mq = GNUNET_CLIENT_connect (handle->cfg, 331 handle->mq = GNUNET_CLIENT_connect (handle->cfg,
332 "credential", 332 "abd",
333 handlers, 333 handlers,
334 &mq_error_handler, 334 &mq_error_handler,
335 handle); 335 handle);
@@ -341,17 +341,17 @@ reconnect (struct GNUNET_CREDENTIAL_Handle *handle)
341 341
342 342
343/** 343/**
344 * Initialize the connection with the CREDENTIAL service. 344 * Initialize the connection with the ABD service.
345 * 345 *
346 * @param cfg configuration to use 346 * @param cfg configuration to use
347 * @return handle to the CREDENTIAL service, or NULL on error 347 * @return handle to the ABD service, or NULL on error
348 */ 348 */
349struct GNUNET_CREDENTIAL_Handle * 349struct GNUNET_ABD_Handle *
350GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) 350GNUNET_ABD_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
351{ 351{
352 struct GNUNET_CREDENTIAL_Handle *handle; 352 struct GNUNET_ABD_Handle *handle;
353 353
354 handle = GNUNET_new (struct GNUNET_CREDENTIAL_Handle); 354 handle = GNUNET_new (struct GNUNET_ABD_Handle);
355 handle->cfg = cfg; 355 handle->cfg = cfg;
356 reconnect (handle); 356 reconnect (handle);
357 if (NULL == handle->mq) 357 if (NULL == handle->mq)
@@ -364,12 +364,12 @@ GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
364 364
365 365
366/** 366/**
367 * Shutdown connection with the CREDENTIAL service. 367 * Shutdown connection with the ABD service.
368 * 368 *
369 * @param handle handle of the CREDENTIAL connection to stop 369 * @param handle handle of the ABD connection to stop
370 */ 370 */
371void 371void
372GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle) 372GNUNET_ABD_disconnect (struct GNUNET_ABD_Handle *handle)
373{ 373{
374 if (NULL != handle->mq) 374 if (NULL != handle->mq)
375 { 375 {
@@ -392,9 +392,9 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle)
392 * @param lr the verify request to cancel 392 * @param lr the verify request to cancel
393 */ 393 */
394void 394void
395GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr) 395GNUNET_ABD_request_cancel (struct GNUNET_ABD_Request *lr)
396{ 396{
397 struct GNUNET_CREDENTIAL_Handle *handle = lr->credential_handle; 397 struct GNUNET_ABD_Handle *handle = lr->abd_handle;
398 398
399 GNUNET_CONTAINER_DLL_remove (handle->request_head, handle->request_tail, lr); 399 GNUNET_CONTAINER_DLL_remove (handle->request_head, handle->request_tail, lr);
400 GNUNET_MQ_discard (lr->env); 400 GNUNET_MQ_discard (lr->env);
@@ -404,7 +404,7 @@ GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr)
404 404
405/** 405/**
406 * Performs attribute collection. 406 * Performs attribute collection.
407 * Collects all credentials of subject to fulfill the 407 * Collects all abds of subject to fulfill the
408 * attribute, if possible 408 * attribute, if possible
409 * 409 *
410 * @param handle handle to the Credential service 410 * @param handle handle to the Credential service
@@ -415,21 +415,21 @@ GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr)
415 * @param proc_cls closure for processor 415 * @param proc_cls closure for processor
416 * @return handle to the queued request 416 * @return handle to the queued request
417 */ 417 */
418struct GNUNET_CREDENTIAL_Request * 418struct GNUNET_ABD_Request *
419GNUNET_CREDENTIAL_collect ( 419GNUNET_ABD_collect (
420 struct GNUNET_CREDENTIAL_Handle *handle, 420 struct GNUNET_ABD_Handle *handle,
421 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 421 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
422 const char *issuer_attribute, 422 const char *issuer_attribute,
423 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, 423 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
424 enum GNUNET_CREDENTIAL_AlgoDirectionFlags direction, 424 enum GNUNET_ABD_AlgoDirectionFlags direction,
425 GNUNET_CREDENTIAL_CredentialResultProcessor proc, 425 GNUNET_ABD_CredentialResultProcessor proc,
426 void *proc_cls, 426 void *proc_cls,
427 GNUNET_CREDENTIAL_IntermediateResultProcessor proc2, 427 GNUNET_ABD_IntermediateResultProcessor proc2,
428 void *proc2_cls) 428 void *proc2_cls)
429{ 429{
430 /* IPC to shorten credential names, return shorten_handle */ 430 /* IPC to shorten abd names, return shorten_handle */
431 struct CollectMessage *c_msg; 431 struct CollectMessage *c_msg;
432 struct GNUNET_CREDENTIAL_Request *vr; 432 struct GNUNET_ABD_Request *vr;
433 size_t nlen; 433 size_t nlen;
434 434
435 if (NULL == issuer_attribute) 435 if (NULL == issuer_attribute)
@@ -440,7 +440,7 @@ GNUNET_CREDENTIAL_collect (
440 440
441 //DEBUG LOG 441 //DEBUG LOG
442 LOG (GNUNET_ERROR_TYPE_DEBUG, 442 LOG (GNUNET_ERROR_TYPE_DEBUG,
443 "Trying to collect `%s' in CREDENTIAL\n", 443 "Trying to collect `%s' in ABD\n",
444 issuer_attribute); 444 issuer_attribute);
445 nlen = strlen (issuer_attribute) + 1; 445 nlen = strlen (issuer_attribute) + 1;
446 if (nlen >= GNUNET_MAX_MESSAGE_SIZE - sizeof (*vr)) 446 if (nlen >= GNUNET_MAX_MESSAGE_SIZE - sizeof (*vr))
@@ -448,15 +448,15 @@ GNUNET_CREDENTIAL_collect (
448 GNUNET_break (0); 448 GNUNET_break (0);
449 return NULL; 449 return NULL;
450 } 450 }
451 vr = GNUNET_new (struct GNUNET_CREDENTIAL_Request); 451 vr = GNUNET_new (struct GNUNET_ABD_Request);
452 vr->credential_handle = handle; 452 vr->abd_handle = handle;
453 vr->verify_proc = proc; 453 vr->verify_proc = proc;
454 vr->proc_cls = proc_cls; 454 vr->proc_cls = proc_cls;
455 vr->int_proc = proc2; 455 vr->int_proc = proc2;
456 vr->proc2_cls = proc2_cls; 456 vr->proc2_cls = proc2_cls;
457 vr->r_id = handle->r_id_gen++; 457 vr->r_id = handle->r_id_gen++;
458 vr->env = 458 vr->env =
459 GNUNET_MQ_msg_extra (c_msg, nlen, GNUNET_MESSAGE_TYPE_CREDENTIAL_COLLECT); 459 GNUNET_MQ_msg_extra (c_msg, nlen, GNUNET_MESSAGE_TYPE_ABD_COLLECT);
460 c_msg->id = htonl (vr->r_id); 460 c_msg->id = htonl (vr->r_id);
461 c_msg->subject_key = *subject_key; 461 c_msg->subject_key = *subject_key;
462 c_msg->issuer_key = *issuer_key; 462 c_msg->issuer_key = *issuer_key;
@@ -487,23 +487,23 @@ GNUNET_CREDENTIAL_collect (
487 * @param proc_cls closure for processor 487 * @param proc_cls closure for processor
488 * @return handle to the queued request 488 * @return handle to the queued request
489 */ 489 */
490struct GNUNET_CREDENTIAL_Request * 490struct GNUNET_ABD_Request *
491GNUNET_CREDENTIAL_verify ( 491GNUNET_ABD_verify (
492 struct GNUNET_CREDENTIAL_Handle *handle, 492 struct GNUNET_ABD_Handle *handle,
493 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 493 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
494 const char *issuer_attribute, 494 const char *issuer_attribute,
495 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, 495 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
496 uint32_t delegate_count, 496 uint32_t delegate_count,
497 const struct GNUNET_CREDENTIAL_Delegate *delegates, 497 const struct GNUNET_ABD_Delegate *delegates,
498 enum GNUNET_CREDENTIAL_AlgoDirectionFlags direction, 498 enum GNUNET_ABD_AlgoDirectionFlags direction,
499 GNUNET_CREDENTIAL_CredentialResultProcessor proc, 499 GNUNET_ABD_CredentialResultProcessor proc,
500 void *proc_cls, 500 void *proc_cls,
501 GNUNET_CREDENTIAL_IntermediateResultProcessor proc2, 501 GNUNET_ABD_IntermediateResultProcessor proc2,
502 void *proc2_cls) 502 void *proc2_cls)
503{ 503{
504 /* IPC to shorten credential names, return shorten_handle */ 504 /* IPC to shorten abd names, return shorten_handle */
505 struct VerifyMessage *v_msg; 505 struct VerifyMessage *v_msg;
506 struct GNUNET_CREDENTIAL_Request *vr; 506 struct GNUNET_ABD_Request *vr;
507 size_t nlen; 507 size_t nlen;
508 size_t clen; 508 size_t clen;
509 509
@@ -513,11 +513,11 @@ GNUNET_CREDENTIAL_verify (
513 return NULL; 513 return NULL;
514 } 514 }
515 515
516 clen = GNUNET_CREDENTIAL_delegates_get_size (delegate_count, delegates); 516 clen = GNUNET_ABD_delegates_get_size (delegate_count, delegates);
517 517
518 //DEBUG LOG 518 //DEBUG LOG
519 LOG (GNUNET_ERROR_TYPE_DEBUG, 519 LOG (GNUNET_ERROR_TYPE_DEBUG,
520 "Trying to verify `%s' in CREDENTIAL\n", 520 "Trying to verify `%s' in ABD\n",
521 issuer_attribute); 521 issuer_attribute);
522 nlen = strlen (issuer_attribute) + 1 + clen; 522 nlen = strlen (issuer_attribute) + 1 + clen;
523 if (nlen >= GNUNET_MAX_MESSAGE_SIZE - sizeof (*vr)) 523 if (nlen >= GNUNET_MAX_MESSAGE_SIZE - sizeof (*vr))
@@ -525,15 +525,15 @@ GNUNET_CREDENTIAL_verify (
525 GNUNET_break (0); 525 GNUNET_break (0);
526 return NULL; 526 return NULL;
527 } 527 }
528 vr = GNUNET_new (struct GNUNET_CREDENTIAL_Request); 528 vr = GNUNET_new (struct GNUNET_ABD_Request);
529 vr->credential_handle = handle; 529 vr->abd_handle = handle;
530 vr->verify_proc = proc; 530 vr->verify_proc = proc;
531 vr->proc_cls = proc_cls; 531 vr->proc_cls = proc_cls;
532 vr->int_proc = proc2; 532 vr->int_proc = proc2;
533 vr->proc2_cls = proc2_cls; 533 vr->proc2_cls = proc2_cls;
534 vr->r_id = handle->r_id_gen++; 534 vr->r_id = handle->r_id_gen++;
535 vr->env = 535 vr->env =
536 GNUNET_MQ_msg_extra (v_msg, nlen, GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY); 536 GNUNET_MQ_msg_extra (v_msg, nlen, GNUNET_MESSAGE_TYPE_ABD_VERIFY);
537 v_msg->id = htonl (vr->r_id); 537 v_msg->id = htonl (vr->r_id);
538 v_msg->subject_key = *subject_key; 538 v_msg->subject_key = *subject_key;
539 v_msg->d_count = htonl (delegate_count); 539 v_msg->d_count = htonl (delegate_count);
@@ -542,7 +542,7 @@ GNUNET_CREDENTIAL_verify (
542 v_msg->resolution_algo = htons (direction); 542 v_msg->resolution_algo = htons (direction);
543 543
544 GNUNET_memcpy (&v_msg[1], issuer_attribute, strlen (issuer_attribute)); 544 GNUNET_memcpy (&v_msg[1], issuer_attribute, strlen (issuer_attribute));
545 GNUNET_CREDENTIAL_delegates_serialize (delegate_count, 545 GNUNET_ABD_delegates_serialize (delegate_count,
546 delegates, 546 delegates,
547 clen, 547 clen,
548 ((char *) &v_msg[1]) + 548 ((char *) &v_msg[1]) +
@@ -553,4 +553,4 @@ GNUNET_CREDENTIAL_verify (
553 return vr; 553 return vr;
554} 554}
555 555
556/* end of credential_api.c */ 556/* end of abd_api.c */
diff --git a/src/credential/credential_serialization.c b/src/abd/abd_serialization.c
index 8d8eafa44..d2bc15166 100644
--- a/src/credential/credential_serialization.c
+++ b/src/abd/abd_serialization.c
@@ -20,30 +20,30 @@
20 20
21 21
22/** 22/**
23 * @file credential/credential_serialization.c 23 * @file abd/abd_serialization.c
24 * @brief API to serialize and deserialize delegation chains 24 * @brief API to serialize and deserialize delegation chains
25 * and credentials 25 * and abds
26 * @author Martin Schanzenbach 26 * @author Martin Schanzenbach
27 */ 27 */
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_constants.h" 30#include "gnunet_constants.h"
31#include "gnunet_credential_service.h" 31#include "gnunet_abd_service.h"
32#include "gnunet_signatures.h" 32#include "gnunet_signatures.h"
33#include "credential.h" 33#include "abd.h"
34 34
35/** 35/**
36 * Calculate how many bytes we will need to serialize 36 * Calculate how many bytes we will need to serialize
37 * the given delegation chain 37 * the given delegation chain
38 * 38 *
39 * @param ds_count number of delegation chain entries 39 * @param ds_count number of delegation chain entries
40 * @param dsr array of #GNUNET_CREDENTIAL_DelegationSet 40 * @param dsr array of #GNUNET_ABD_DelegationSet
41 * @return the required size to serialize 41 * @return the required size to serialize
42 */ 42 */
43size_t 43size_t
44GNUNET_CREDENTIAL_delegation_set_get_size ( 44GNUNET_ABD_delegation_set_get_size (
45 unsigned int ds_count, 45 unsigned int ds_count,
46 const struct GNUNET_CREDENTIAL_DelegationSet *dsr) 46 const struct GNUNET_ABD_DelegationSet *dsr)
47{ 47{
48 unsigned int i; 48 unsigned int i;
49 size_t ret; 49 size_t ret;
@@ -59,18 +59,18 @@ GNUNET_CREDENTIAL_delegation_set_get_size (
59} 59}
60 60
61/** 61/**
62 * Serizalize the given delegation chain entries and credential 62 * Serizalize the given delegation chain entries and abd
63 * 63 *
64 * @param d_count number of delegation chain entries 64 * @param d_count number of delegation chain entries
65 * @param dsr array of #GNUNET_CREDENTIAL_DelegationSet 65 * @param dsr array of #GNUNET_ABD_DelegationSet
66 * @param dest_size size of the destination 66 * @param dest_size size of the destination
67 * @param dest where to store the result 67 * @param dest where to store the result
68 * @return the size of the data, -1 on failure 68 * @return the size of the data, -1 on failure
69 */ 69 */
70ssize_t 70ssize_t
71GNUNET_CREDENTIAL_delegation_set_serialize ( 71GNUNET_ABD_delegation_set_serialize (
72 unsigned int d_count, 72 unsigned int d_count,
73 const struct GNUNET_CREDENTIAL_DelegationSet *dsr, 73 const struct GNUNET_ABD_DelegationSet *dsr,
74 size_t dest_size, 74 size_t dest_size,
75 char *dest) 75 char *dest)
76{ 76{
@@ -110,11 +110,11 @@ GNUNET_CREDENTIAL_delegation_set_serialize (
110 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 110 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
111 */ 111 */
112int 112int
113GNUNET_CREDENTIAL_delegation_set_deserialize ( 113GNUNET_ABD_delegation_set_deserialize (
114 size_t len, 114 size_t len,
115 const char *src, 115 const char *src,
116 unsigned int d_count, 116 unsigned int d_count,
117 struct GNUNET_CREDENTIAL_DelegationSet *dsr) 117 struct GNUNET_ABD_DelegationSet *dsr)
118{ 118{
119 struct DelegationRecordData rec; 119 struct DelegationRecordData rec;
120 unsigned int i; 120 unsigned int i;
@@ -140,16 +140,16 @@ GNUNET_CREDENTIAL_delegation_set_deserialize (
140 140
141/** 141/**
142 * Calculate how many bytes we will need to serialize 142 * Calculate how many bytes we will need to serialize
143 * the credentials 143 * the abds
144 * 144 *
145 * @param c_count number of credential entries 145 * @param c_count number of abd entries
146 * @param cd a #GNUNET_CREDENTIAL_Credential 146 * @param cd a #GNUNET_ABD_Credential
147 * @return the required size to serialize 147 * @return the required size to serialize
148 */ 148 */
149size_t 149size_t
150GNUNET_CREDENTIAL_delegates_get_size ( 150GNUNET_ABD_delegates_get_size (
151 unsigned int c_count, 151 unsigned int c_count,
152 const struct GNUNET_CREDENTIAL_Delegate *cd) 152 const struct GNUNET_ABD_Delegate *cd)
153{ 153{
154 unsigned int i; 154 unsigned int i;
155 size_t ret; 155 size_t ret;
@@ -165,18 +165,18 @@ GNUNET_CREDENTIAL_delegates_get_size (
165 return ret; 165 return ret;
166} 166}
167/** 167/**
168 * Serizalize the given credentials 168 * Serizalize the given abds
169 * 169 *
170 * @param c_count number of credential entries 170 * @param c_count number of abd entries
171 * @param cd a #GNUNET_CREDENTIAL_Credential 171 * @param cd a #GNUNET_ABD_Credential
172 * @param dest_size size of the destination 172 * @param dest_size size of the destination
173 * @param dest where to store the result 173 * @param dest where to store the result
174 * @return the size of the data, -1 on failure 174 * @return the size of the data, -1 on failure
175 */ 175 */
176ssize_t 176ssize_t
177GNUNET_CREDENTIAL_delegates_serialize ( 177GNUNET_ABD_delegates_serialize (
178 unsigned int c_count, 178 unsigned int c_count,
179 const struct GNUNET_CREDENTIAL_Delegate *cd, 179 const struct GNUNET_ABD_Delegate *cd,
180 size_t dest_size, 180 size_t dest_size,
181 char *dest) 181 char *dest)
182{ 182{
@@ -218,15 +218,15 @@ GNUNET_CREDENTIAL_delegates_serialize (
218 * 218 *
219 * @param len size of the serialized creds 219 * @param len size of the serialized creds
220 * @param src the serialized data 220 * @param src the serialized data
221 * @param c_count the number of credential entries 221 * @param c_count the number of abd entries
222 * @param cd where to put the credential data 222 * @param cd where to put the abd data
223 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 223 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
224 */ 224 */
225int 225int
226GNUNET_CREDENTIAL_delegates_deserialize (size_t len, 226GNUNET_ABD_delegates_deserialize (size_t len,
227 const char *src, 227 const char *src,
228 unsigned int c_count, 228 unsigned int c_count,
229 struct GNUNET_CREDENTIAL_Delegate *cd) 229 struct GNUNET_ABD_Delegate *cd)
230{ 230{
231 struct DelegateEntry c_rec; 231 struct DelegateEntry c_rec;
232 unsigned int i; 232 unsigned int i;
@@ -256,20 +256,20 @@ GNUNET_CREDENTIAL_delegates_deserialize (size_t len,
256 256
257/** 257/**
258 * Calculate how many bytes we will need to serialize 258 * Calculate how many bytes we will need to serialize
259 * the given delegation chain and credential 259 * the given delegation chain and abd
260 * 260 *
261 * @param d_count number of delegation chain entries 261 * @param d_count number of delegation chain entries
262 * @param dd array of #GNUNET_CREDENTIAL_Delegation 262 * @param dd array of #GNUNET_ABD_Delegation
263 * @param c_count number of credential entries 263 * @param c_count number of abd entries
264 * @param cd a #GNUNET_CREDENTIAL_Credential 264 * @param cd a #GNUNET_ABD_Credential
265 * @return the required size to serialize 265 * @return the required size to serialize
266 */ 266 */
267size_t 267size_t
268GNUNET_CREDENTIAL_delegation_chain_get_size ( 268GNUNET_ABD_delegation_chain_get_size (
269 unsigned int d_count, 269 unsigned int d_count,
270 const struct GNUNET_CREDENTIAL_Delegation *dd, 270 const struct GNUNET_ABD_Delegation *dd,
271 unsigned int c_count, 271 unsigned int c_count,
272 const struct GNUNET_CREDENTIAL_Delegate *cd) 272 const struct GNUNET_ABD_Delegate *cd)
273{ 273{
274 unsigned int i; 274 unsigned int i;
275 size_t ret; 275 size_t ret;
@@ -282,26 +282,26 @@ GNUNET_CREDENTIAL_delegation_chain_get_size (
282 (ret + dd[i].issuer_attribute_len + dd[i].subject_attribute_len) >= ret); 282 (ret + dd[i].issuer_attribute_len + dd[i].subject_attribute_len) >= ret);
283 ret += dd[i].issuer_attribute_len + dd[i].subject_attribute_len; 283 ret += dd[i].issuer_attribute_len + dd[i].subject_attribute_len;
284 } 284 }
285 return ret + GNUNET_CREDENTIAL_delegates_get_size (c_count, cd); 285 return ret + GNUNET_ABD_delegates_get_size (c_count, cd);
286} 286}
287 287
288/** 288/**
289 * Serizalize the given delegation chain entries and credential 289 * Serizalize the given delegation chain entries and abd
290 * 290 *
291 * @param d_count number of delegation chain entries 291 * @param d_count number of delegation chain entries
292 * @param dd array of #GNUNET_CREDENTIAL_Delegation 292 * @param dd array of #GNUNET_ABD_Delegation
293 * @param c_count number of credential entries 293 * @param c_count number of abd entries
294 * @param cd a #GNUNET_CREDENTIAL_Credential 294 * @param cd a #GNUNET_ABD_Credential
295 * @param dest_size size of the destination 295 * @param dest_size size of the destination
296 * @param dest where to store the result 296 * @param dest where to store the result
297 * @return the size of the data, -1 on failure 297 * @return the size of the data, -1 on failure
298 */ 298 */
299ssize_t 299ssize_t
300GNUNET_CREDENTIAL_delegation_chain_serialize ( 300GNUNET_ABD_delegation_chain_serialize (
301 unsigned int d_count, 301 unsigned int d_count,
302 const struct GNUNET_CREDENTIAL_Delegation *dd, 302 const struct GNUNET_ABD_Delegation *dd,
303 unsigned int c_count, 303 unsigned int c_count,
304 const struct GNUNET_CREDENTIAL_Delegate *cd, 304 const struct GNUNET_ABD_Delegate *cd,
305 size_t dest_size, 305 size_t dest_size,
306 char *dest) 306 char *dest)
307{ 307{
@@ -335,7 +335,7 @@ GNUNET_CREDENTIAL_delegation_chain_serialize (
335 dd[i].subject_attribute_len); 335 dd[i].subject_attribute_len);
336 off += dd[i].subject_attribute_len; 336 off += dd[i].subject_attribute_len;
337 } 337 }
338 return off + GNUNET_CREDENTIAL_delegates_serialize (c_count, 338 return off + GNUNET_ABD_delegates_serialize (c_count,
339 cd, 339 cd,
340 dest_size - off, 340 dest_size - off,
341 &dest[off]); 341 &dest[off]);
@@ -349,18 +349,18 @@ GNUNET_CREDENTIAL_delegation_chain_serialize (
349 * @param src the serialized data 349 * @param src the serialized data
350 * @param d_count the number of delegation chain entries 350 * @param d_count the number of delegation chain entries
351 * @param dd where to put the delegation chain entries 351 * @param dd where to put the delegation chain entries
352 * @param c_count the number of credential entries 352 * @param c_count the number of abd entries
353 * @param cd where to put the credential data 353 * @param cd where to put the abd data
354 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 354 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
355 */ 355 */
356int 356int
357GNUNET_CREDENTIAL_delegation_chain_deserialize ( 357GNUNET_ABD_delegation_chain_deserialize (
358 size_t len, 358 size_t len,
359 const char *src, 359 const char *src,
360 unsigned int d_count, 360 unsigned int d_count,
361 struct GNUNET_CREDENTIAL_Delegation *dd, 361 struct GNUNET_ABD_Delegation *dd,
362 unsigned int c_count, 362 unsigned int c_count,
363 struct GNUNET_CREDENTIAL_Delegate *cd) 363 struct GNUNET_ABD_Delegate *cd)
364{ 364{
365 struct ChainEntry rec; 365 struct ChainEntry rec;
366 unsigned int i; 366 unsigned int i;
@@ -386,14 +386,14 @@ GNUNET_CREDENTIAL_delegation_chain_deserialize (
386 dd[i].subject_attribute = &src[off]; 386 dd[i].subject_attribute = &src[off];
387 off += dd[i].subject_attribute_len; 387 off += dd[i].subject_attribute_len;
388 } 388 }
389 return GNUNET_CREDENTIAL_delegates_deserialize (len - off, 389 return GNUNET_ABD_delegates_deserialize (len - off,
390 &src[off], 390 &src[off],
391 c_count, 391 c_count,
392 cd); 392 cd);
393} 393}
394 394
395int 395int
396GNUNET_CREDENTIAL_delegate_serialize (struct GNUNET_CREDENTIAL_Delegate *dele, 396GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *dele,
397 char **data) 397 char **data)
398{ 398{
399 size_t size; 399 size_t size;
@@ -455,10 +455,10 @@ GNUNET_CREDENTIAL_delegate_serialize (struct GNUNET_CREDENTIAL_Delegate *dele,
455 return size; 455 return size;
456} 456}
457 457
458struct GNUNET_CREDENTIAL_Delegate * 458struct GNUNET_ABD_Delegate *
459GNUNET_CREDENTIAL_delegate_deserialize (const char *data, size_t data_size) 459GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size)
460{ 460{
461 struct GNUNET_CREDENTIAL_Delegate *dele; 461 struct GNUNET_ABD_Delegate *dele;
462 struct DelegateEntry *cdata; 462 struct DelegateEntry *cdata;
463 char *attr_combo_str; 463 char *attr_combo_str;
464 464
@@ -480,7 +480,7 @@ GNUNET_CREDENTIAL_delegate_deserialize (const char *data, size_t data_size)
480 int attr_combo_len = iss_len + sub_len; 480 int attr_combo_len = iss_len + sub_len;
481 481
482 dele = 482 dele =
483 GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_Delegate) + attr_combo_len); 483 GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + attr_combo_len);
484 484
485 dele->issuer_key = cdata->issuer_key; 485 dele->issuer_key = cdata->issuer_key;
486 dele->subject_key = cdata->subject_key; 486 dele->subject_key = cdata->subject_key;
@@ -505,4 +505,4 @@ GNUNET_CREDENTIAL_delegate_deserialize (const char *data, size_t data_size)
505 return dele; 505 return dele;
506} 506}
507 507
508/* end of credential_serialization.c */ 508/* end of abd_serialization.c */
diff --git a/src/credential/credential_serialization.h b/src/abd/abd_serialization.h
index 0e106caa1..cef9f42ef 100644
--- a/src/credential/credential_serialization.h
+++ b/src/abd/abd_serialization.h
@@ -20,45 +20,45 @@
20 20
21 21
22/** 22/**
23 * @file credential/credential_serialization.h 23 * @file abd/abd_serialization.h
24 * @brief API to serialize and deserialize delegation chains 24 * @brief API to serialize and deserialize delegation chains
25 * and credentials 25 * and abds
26 * @author Martin Schanzenbach 26 * @author Martin Schanzenbach
27 */ 27 */
28#ifndef CREDENTIAL_SERIALIZATION_H 28#ifndef ABD_SERIALIZATION_H
29#define CREDENTIAL_SERIALIZATION_H 29#define ABD_SERIALIZATION_H
30 30
31#include "platform.h" 31#include "platform.h"
32#include "gnunet_util_lib.h" 32#include "gnunet_util_lib.h"
33#include "gnunet_constants.h" 33#include "gnunet_constants.h"
34#include "gnunet_credential_service.h" 34#include "gnunet_abd_service.h"
35 35
36/** 36/**
37 * Calculate how many bytes we will need to serialize 37 * Calculate how many bytes we will need to serialize
38 * the given delegation record 38 * the given delegation record
39 * 39 *
40 * @param ds_count number of delegation chain entries 40 * @param ds_count number of delegation chain entries
41 * @param dsr array of #GNUNET_CREDENTIAL_Delegation 41 * @param dsr array of #GNUNET_ABD_Delegation
42 * @return the required size to serialize 42 * @return the required size to serialize
43 */ 43 */
44size_t 44size_t
45GNUNET_CREDENTIAL_delegation_set_get_size ( 45GNUNET_ABD_delegation_set_get_size (
46 unsigned int ds_count, 46 unsigned int ds_count,
47 const struct GNUNET_CREDENTIAL_DelegationSet *dsr); 47 const struct GNUNET_ABD_DelegationSet *dsr);
48 48
49/** 49/**
50 * Serizalize the given delegation record entries 50 * Serizalize the given delegation record entries
51 * 51 *
52 * @param d_count number of delegation chain entries 52 * @param d_count number of delegation chain entries
53 * @param dsr array of #GNUNET_CREDENTIAL_Delegation 53 * @param dsr array of #GNUNET_ABD_Delegation
54 * @param dest_size size of the destination 54 * @param dest_size size of the destination
55 * @param dest where to store the result 55 * @param dest where to store the result
56 * @return the size of the data, -1 on failure 56 * @return the size of the data, -1 on failure
57 */ 57 */
58ssize_t 58ssize_t
59GNUNET_CREDENTIAL_delegation_set_serialize ( 59GNUNET_ABD_delegation_set_serialize (
60 unsigned int d_count, 60 unsigned int d_count,
61 const struct GNUNET_CREDENTIAL_DelegationSet *dsr, 61 const struct GNUNET_ABD_DelegationSet *dsr,
62 size_t dest_size, 62 size_t dest_size,
63 char *dest); 63 char *dest);
64 64
@@ -73,46 +73,46 @@ GNUNET_CREDENTIAL_delegation_set_serialize (
73 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 73 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
74 */ 74 */
75int 75int
76GNUNET_CREDENTIAL_delegation_set_deserialize ( 76GNUNET_ABD_delegation_set_deserialize (
77 size_t len, 77 size_t len,
78 const char *src, 78 const char *src,
79 unsigned int d_count, 79 unsigned int d_count,
80 struct GNUNET_CREDENTIAL_DelegationSet *dsr); 80 struct GNUNET_ABD_DelegationSet *dsr);
81 81
82/** 82/**
83 * Calculate how many bytes we will need to serialize 83 * Calculate how many bytes we will need to serialize
84 * the given delegation chain and credential 84 * the given delegation chain and abd
85 * 85 *
86 * @param d_count number of delegation chain entries 86 * @param d_count number of delegation chain entries
87 * @param dd array of #GNUNET_CREDENTIAL_Delegation 87 * @param dd array of #GNUNET_ABD_Delegation
88 * @param c_count number of credential entries 88 * @param c_count number of abd entries
89 * @param cd a #GNUNET_CREDENTIAL_Delegate 89 * @param cd a #GNUNET_ABD_Delegate
90 * @return the required size to serialize 90 * @return the required size to serialize
91 */ 91 */
92size_t 92size_t
93GNUNET_CREDENTIAL_delegation_chain_get_size ( 93GNUNET_ABD_delegation_chain_get_size (
94 unsigned int d_count, 94 unsigned int d_count,
95 const struct GNUNET_CREDENTIAL_Delegation *dd, 95 const struct GNUNET_ABD_Delegation *dd,
96 unsigned int c_count, 96 unsigned int c_count,
97 const struct GNUNET_CREDENTIAL_Delegate *cd); 97 const struct GNUNET_ABD_Delegate *cd);
98 98
99/** 99/**
100 * Serizalize the given delegation chain entries and credential 100 * Serizalize the given delegation chain entries and abd
101 * 101 *
102 * @param d_count number of delegation chain entries 102 * @param d_count number of delegation chain entries
103 * @param dd array of #GNUNET_CREDENTIAL_Delegation 103 * @param dd array of #GNUNET_ABD_Delegation
104 * @param c_count number of credential entries 104 * @param c_count number of abd entries
105 * @param cd a #GNUNET_CREDENTIAL_Delegate 105 * @param cd a #GNUNET_ABD_Delegate
106 * @param dest_size size of the destination 106 * @param dest_size size of the destination
107 * @param dest where to store the result 107 * @param dest where to store the result
108 * @return the size of the data, -1 on failure 108 * @return the size of the data, -1 on failure
109 */ 109 */
110ssize_t 110ssize_t
111GNUNET_CREDENTIAL_delegation_chain_serialize ( 111GNUNET_ABD_delegation_chain_serialize (
112 unsigned int d_count, 112 unsigned int d_count,
113 const struct GNUNET_CREDENTIAL_Delegation *dd, 113 const struct GNUNET_ABD_Delegation *dd,
114 unsigned int c_count, 114 unsigned int c_count,
115 const struct GNUNET_CREDENTIAL_Delegate *cd, 115 const struct GNUNET_ABD_Delegate *cd,
116 size_t dest_size, 116 size_t dest_size,
117 char *dest); 117 char *dest);
118 118
@@ -124,42 +124,42 @@ GNUNET_CREDENTIAL_delegation_chain_serialize (
124 * @param src the serialized data 124 * @param src the serialized data
125 * @param d_count the number of delegation chain entries 125 * @param d_count the number of delegation chain entries
126 * @param dd where to put the delegation chain entries 126 * @param dd where to put the delegation chain entries
127 * @param c_count number of credential entries 127 * @param c_count number of abd entries
128 * @param cd where to put the credential data 128 * @param cd where to put the abd data
129 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 129 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
130 */ 130 */
131int 131int
132GNUNET_CREDENTIAL_delegation_chain_deserialize ( 132GNUNET_ABD_delegation_chain_deserialize (
133 size_t len, 133 size_t len,
134 const char *src, 134 const char *src,
135 unsigned int d_count, 135 unsigned int d_count,
136 struct GNUNET_CREDENTIAL_Delegation *dd, 136 struct GNUNET_ABD_Delegation *dd,
137 unsigned int c_count, 137 unsigned int c_count,
138 struct GNUNET_CREDENTIAL_Delegate *cd); 138 struct GNUNET_ABD_Delegate *cd);
139size_t 139size_t
140GNUNET_CREDENTIAL_delegates_get_size ( 140GNUNET_ABD_delegates_get_size (
141 unsigned int c_count, 141 unsigned int c_count,
142 const struct GNUNET_CREDENTIAL_Delegate *cd); 142 const struct GNUNET_ABD_Delegate *cd);
143 143
144ssize_t 144ssize_t
145GNUNET_CREDENTIAL_delegates_serialize ( 145GNUNET_ABD_delegates_serialize (
146 unsigned int c_count, 146 unsigned int c_count,
147 const struct GNUNET_CREDENTIAL_Delegate *cd, 147 const struct GNUNET_ABD_Delegate *cd,
148 size_t dest_size, 148 size_t dest_size,
149 char *dest); 149 char *dest);
150 150
151 151
152int 152int
153GNUNET_CREDENTIAL_delegates_deserialize (size_t len, 153GNUNET_ABD_delegates_deserialize (size_t len,
154 const char *src, 154 const char *src,
155 unsigned int c_count, 155 unsigned int c_count,
156 struct GNUNET_CREDENTIAL_Delegate *cd); 156 struct GNUNET_ABD_Delegate *cd);
157 157
158int 158int
159GNUNET_CREDENTIAL_delegate_serialize (struct GNUNET_CREDENTIAL_Delegate *cred, 159GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *cred,
160 char **data); 160 char **data);
161 161
162struct GNUNET_CREDENTIAL_Delegate * 162struct GNUNET_ABD_Delegate *
163GNUNET_CREDENTIAL_delegate_deserialize (const char *data, size_t data_size); 163GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size);
164#endif 164#endif
165/* end of credential_serialization.h */ 165/* end of abd_serialization.h */
diff --git a/src/credential/delegate_misc.c b/src/abd/delegate_misc.c
index 80124711a..ecc7f7669 100644
--- a/src/credential/delegate_misc.c
+++ b/src/abd/delegate_misc.c
@@ -20,7 +20,7 @@
20 20
21 21
22/** 22/**
23 * @file credential/delegate_misc.c 23 * @file abd/delegate_misc.c
24 * @brief Misc API for delegate 24 * @brief Misc API for delegate
25 * 25 *
26 * @author Martin Schanzenbach 26 * @author Martin Schanzenbach
@@ -28,14 +28,14 @@
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_constants.h" 30#include "gnunet_constants.h"
31#include "gnunet_credential_service.h" 31#include "gnunet_abd_service.h"
32#include "gnunet_signatures.h" 32#include "gnunet_signatures.h"
33#include "credential.h" 33#include "abd.h"
34#include <inttypes.h> 34#include <inttypes.h>
35 35
36char * 36char *
37GNUNET_CREDENTIAL_delegate_to_string ( 37GNUNET_ABD_delegate_to_string (
38 const struct GNUNET_CREDENTIAL_Delegate *cred) 38 const struct GNUNET_ABD_Delegate *cred)
39{ 39{
40 char *cred_str; 40 char *cred_str;
41 char *subject_pkey; 41 char *subject_pkey;
@@ -75,10 +75,10 @@ GNUNET_CREDENTIAL_delegate_to_string (
75 return cred_str; 75 return cred_str;
76} 76}
77 77
78struct GNUNET_CREDENTIAL_Delegate * 78struct GNUNET_ABD_Delegate *
79GNUNET_CREDENTIAL_delegate_from_string (const char *s) 79GNUNET_ABD_delegate_from_string (const char *s)
80{ 80{
81 struct GNUNET_CREDENTIAL_Delegate *dele; 81 struct GNUNET_ABD_Delegate *dele;
82 size_t enclen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8; 82 size_t enclen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8;
83 if (enclen % 5 > 0) 83 if (enclen % 5 > 0)
84 enclen += 5 - enclen % 5; 84 enclen += 5 - enclen % 5;
@@ -129,7 +129,7 @@ GNUNET_CREDENTIAL_delegate_from_string (const char *s)
129 { 129 {
130 attr_len = strlen (iss_attr) + strlen (sub_attr) + 2; 130 attr_len = strlen (iss_attr) + strlen (sub_attr) + 2;
131 } 131 }
132 dele = GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_Delegate) + attr_len); 132 dele = GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + attr_len);
133 133
134 char tmp_str[attr_len]; 134 char tmp_str[attr_len];
135 GNUNET_memcpy (tmp_str, iss_attr, strlen (iss_attr)); 135 GNUNET_memcpy (tmp_str, iss_attr, strlen (iss_attr));
@@ -183,8 +183,8 @@ GNUNET_CREDENTIAL_delegate_from_string (const char *s)
183 * @return handle to the queued request 183 * @return handle to the queued request
184 */ 184 */
185 185
186struct GNUNET_CREDENTIAL_Delegate * 186struct GNUNET_ABD_Delegate *
187GNUNET_CREDENTIAL_delegate_issue ( 187GNUNET_ABD_delegate_issue (
188 const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, 188 const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
189 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 189 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
190 const char *iss_attr, 190 const char *iss_attr,
@@ -192,7 +192,7 @@ GNUNET_CREDENTIAL_delegate_issue (
192 struct GNUNET_TIME_Absolute *expiration) 192 struct GNUNET_TIME_Absolute *expiration)
193{ 193{
194 struct DelegateEntry *del; 194 struct DelegateEntry *del;
195 struct GNUNET_CREDENTIAL_Delegate *dele; 195 struct GNUNET_ABD_Delegate *dele;
196 size_t size; 196 size_t size;
197 int attr_len; 197 int attr_len;
198 198
@@ -246,7 +246,7 @@ GNUNET_CREDENTIAL_delegate_issue (
246 return NULL; 246 return NULL;
247 } 247 }
248 248
249 dele = GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_Delegate) + attr_len); 249 dele = GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + attr_len);
250 dele->signature = del->signature; 250 dele->signature = del->signature;
251 dele->expiration = *expiration; 251 dele->expiration = *expiration;
252 GNUNET_CRYPTO_ecdsa_key_get_public (issuer, &dele->issuer_key); 252 GNUNET_CRYPTO_ecdsa_key_get_public (issuer, &dele->issuer_key);
diff --git a/src/credential/delegate_misc.h b/src/abd/delegate_misc.h
index 936517437..42a95ce99 100644
--- a/src/credential/delegate_misc.h
+++ b/src/abd/delegate_misc.h
@@ -18,19 +18,19 @@
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19 */ 19 */
20/** 20/**
21 * @file credential/delegate_misc.h 21 * @file abd/delegate_misc.h
22 * @brief Delegate helper functions 22 * @brief Delegate helper functions
23 */ 23 */
24#ifndef DELEGATE_MISC_H 24#ifndef DELEGATE_MISC_H
25#define DELEGATE_MISC_H 25#define DELEGATE_MISC_H
26 26
27#include "gnunet_credential_service.h" 27#include "gnunet_abd_service.h"
28 28
29char * 29char *
30GNUNET_CREDENTIAL_delegate_to_string ( 30GNUNET_ABD_delegate_to_string (
31 const struct GNUNET_CREDENTIAL_Delegate *cred); 31 const struct GNUNET_ABD_Delegate *cred);
32 32
33struct GNUNET_CREDENTIAL_Delegate * 33struct GNUNET_ABD_Delegate *
34GNUNET_CREDENTIAL_delegate_from_string (const char *str); 34GNUNET_ABD_delegate_from_string (const char *str);
35 35
36#endif 36#endif
diff --git a/src/credential/gnunet-credential.c b/src/abd/gnunet-abd.c
index 03b017208..23083ec68 100644
--- a/src/credential/gnunet-credential.c
+++ b/src/abd/gnunet-abd.c
@@ -18,17 +18,17 @@
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19*/ 19*/
20/** 20/**
21 * @file gnunet-credential.c 21 * @file gnunet-abd.c
22 * @brief command line tool to access command line Credential service 22 * @brief command line tool to access command line Credential service
23 * @author Martin Schanzenbach 23 * @author Martin Schanzenbach
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include <gnunet_util_lib.h> 26#include <gnunet_util_lib.h>
27#include <gnunet_credential_service.h> 27#include <gnunet_abd_service.h>
28#include <gnunet_gnsrecord_lib.h> 28#include <gnunet_gnsrecord_lib.h>
29#include <gnunet_namestore_service.h> 29#include <gnunet_namestore_service.h>
30#include "delegate_misc.h" 30#include "delegate_misc.h"
31#include "credential_serialization.h" 31#include "abd_serialization.h"
32 32
33/** 33/**
34 * Configuration we are using. 34 * Configuration we are using.
@@ -53,7 +53,7 @@ static struct GNUNET_IDENTITY_EgoLookup *el;
53/** 53/**
54 * Handle to Credential service. 54 * Handle to Credential service.
55 */ 55 */
56static struct GNUNET_CREDENTIAL_Handle *credential; 56static struct GNUNET_ABD_Handle *abd;
57 57
58/** 58/**
59 * Desired timeout for the lookup (default is no timeout). 59 * Desired timeout for the lookup (default is no timeout).
@@ -63,12 +63,12 @@ static struct GNUNET_TIME_Relative timeout;
63/** 63/**
64 * Handle to verify request 64 * Handle to verify request
65 */ 65 */
66static struct GNUNET_CREDENTIAL_Request *verify_request; 66static struct GNUNET_ABD_Request *verify_request;
67 67
68/** 68/**
69 * Handle to collect request 69 * Handle to collect request
70 */ 70 */
71static struct GNUNET_CREDENTIAL_Request *collect_request; 71static struct GNUNET_ABD_Request *collect_request;
72 72
73/** 73/**
74 * Task scheduled to handle timeout. 74 * Task scheduled to handle timeout.
@@ -169,7 +169,7 @@ static int backward;
169/** 169/**
170 * API enum, filled and passed for collect/verify 170 * API enum, filled and passed for collect/verify
171 */ 171 */
172enum GNUNET_CREDENTIAL_AlgoDirectionFlags direction = 0; 172enum GNUNET_ABD_AlgoDirectionFlags direction = 0;
173 173
174/** 174/**
175 * Queue entry for the 'add' operation. 175 * Queue entry for the 'add' operation.
@@ -225,13 +225,13 @@ do_shutdown (void *cls)
225{ 225{
226 if (NULL != verify_request) 226 if (NULL != verify_request)
227 { 227 {
228 GNUNET_CREDENTIAL_request_cancel (verify_request); 228 GNUNET_ABD_request_cancel (verify_request);
229 verify_request = NULL; 229 verify_request = NULL;
230 } 230 }
231 if (NULL != credential) 231 if (NULL != abd)
232 { 232 {
233 GNUNET_CREDENTIAL_disconnect (credential); 233 GNUNET_ABD_disconnect (abd);
234 credential = NULL; 234 abd = NULL;
235 } 235 }
236 if (NULL != tt) 236 if (NULL != tt)
237 { 237 {
@@ -270,7 +270,7 @@ do_timeout (void *cls)
270 270
271static void 271static void
272handle_intermediate_result(void *cls, 272handle_intermediate_result(void *cls,
273 struct GNUNET_CREDENTIAL_Delegation *dd, 273 struct GNUNET_ABD_Delegation *dd,
274 bool is_bw) 274 bool is_bw)
275{ 275{
276 char *prefix = ""; 276 char *prefix = "";
@@ -290,9 +290,9 @@ handle_intermediate_result(void *cls,
290static void 290static void
291handle_collect_result (void *cls, 291handle_collect_result (void *cls,
292 unsigned int d_count, 292 unsigned int d_count,
293 struct GNUNET_CREDENTIAL_Delegation *dc, 293 struct GNUNET_ABD_Delegation *dc,
294 unsigned int c_count, 294 unsigned int c_count,
295 struct GNUNET_CREDENTIAL_Delegate *dele) 295 struct GNUNET_ABD_Delegate *dele)
296{ 296{
297 int i; 297 int i;
298 char *line; 298 char *line;
@@ -302,7 +302,7 @@ handle_collect_result (void *cls,
302 { 302 {
303 for (i = 0; i < c_count; i++) 303 for (i = 0; i < c_count; i++)
304 { 304 {
305 line = GNUNET_CREDENTIAL_delegate_to_string (&dele[i]); 305 line = GNUNET_ABD_delegate_to_string (&dele[i]);
306 printf ("%s\n", line); 306 printf ("%s\n", line);
307 GNUNET_free (line); 307 GNUNET_free (line);
308 } 308 }
@@ -319,9 +319,9 @@ handle_collect_result (void *cls,
319static void 319static void
320handle_verify_result (void *cls, 320handle_verify_result (void *cls,
321 unsigned int d_count, 321 unsigned int d_count,
322 struct GNUNET_CREDENTIAL_Delegation *dc, 322 struct GNUNET_ABD_Delegation *dc,
323 unsigned int c_count, 323 unsigned int c_count,
324 struct GNUNET_CREDENTIAL_Delegate *dele) 324 struct GNUNET_ABD_Delegate *dele)
325{ 325{
326 int i; 326 int i;
327 char *iss_key; 327 char *iss_key;
@@ -413,7 +413,7 @@ identity_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
413 } 413 }
414 privkey = GNUNET_IDENTITY_ego_get_private_key (ego); 414 privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
415 415
416 collect_request = GNUNET_CREDENTIAL_collect (credential, 416 collect_request = GNUNET_ABD_collect (abd,
417 &issuer_pkey, 417 &issuer_pkey,
418 issuer_attr, 418 issuer_attr,
419 privkey, 419 privkey,
@@ -557,8 +557,8 @@ store_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
557 if (GNUNET_GNSRECORD_TYPE_DELEGATE == type) 557 if (GNUNET_GNSRECORD_TYPE_DELEGATE == type)
558 { 558 {
559 // Parse import 559 // Parse import
560 struct GNUNET_CREDENTIAL_Delegate *cred; 560 struct GNUNET_ABD_Delegate *cred;
561 cred = GNUNET_CREDENTIAL_delegate_from_string (import); 561 cred = GNUNET_ABD_delegate_from_string (import);
562 562
563 // Get import subject public key string 563 // Get import subject public key string
564 char *subject_pubkey_str = 564 char *subject_pubkey_str =
@@ -584,7 +584,7 @@ store_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
584 etime_is_rel = GNUNET_NO; 584 etime_is_rel = GNUNET_NO;
585 585
586 // Prepare the data to be store in the record 586 // Prepare the data to be store in the record
587 data_size = GNUNET_CREDENTIAL_delegate_serialize (cred, (char **) &data); 587 data_size = GNUNET_ABD_delegate_serialize (cred, (char **) &data);
588 GNUNET_free (cred); 588 GNUNET_free (cred);
589 } 589 }
590 else 590 else
@@ -631,7 +631,7 @@ static void
631sign_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) 631sign_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
632{ 632{
633 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 633 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
634 struct GNUNET_CREDENTIAL_Delegate *dele; 634 struct GNUNET_ABD_Delegate *dele;
635 struct GNUNET_TIME_Absolute etime_abs; 635 struct GNUNET_TIME_Absolute etime_abs;
636 char *res; 636 char *res;
637 637
@@ -694,12 +694,12 @@ sign_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
694 } 694 }
695 695
696 // Sign delegate 696 // Sign delegate
697 dele = GNUNET_CREDENTIAL_delegate_issue (privkey, 697 dele = GNUNET_ABD_delegate_issue (privkey,
698 &subject_pkey, 698 &subject_pkey,
699 issuer_attr, 699 issuer_attr,
700 subject_attr, 700 subject_attr,
701 &etime_abs); 701 &etime_abs);
702 res = GNUNET_CREDENTIAL_delegate_to_string (dele); 702 res = GNUNET_ABD_delegate_to_string (dele);
703 GNUNET_free (dele); 703 GNUNET_free (dele);
704 printf ("%s\n", res); 704 printf ("%s\n", res);
705 705
@@ -803,9 +803,9 @@ run (void *cls,
803 backward = GNUNET_YES; 803 backward = GNUNET_YES;
804 } 804 }
805 if (GNUNET_YES == forward) 805 if (GNUNET_YES == forward)
806 direction |= GNUNET_CREDENTIAL_FLAG_FORWARD; 806 direction |= GNUNET_ABD_FLAG_FORWARD;
807 if (GNUNET_YES == backward) 807 if (GNUNET_YES == backward)
808 direction |= GNUNET_CREDENTIAL_FLAG_BACKWARD; 808 direction |= GNUNET_ABD_FLAG_BACKWARD;
809 809
810 if (GNUNET_YES == collect) 810 if (GNUNET_YES == collect)
811 { 811 {
@@ -816,11 +816,11 @@ run (void *cls,
816 return; 816 return;
817 } 817 }
818 818
819 credential = GNUNET_CREDENTIAL_connect (cfg); 819 abd = GNUNET_ABD_connect (cfg);
820 820
821 if (NULL == credential) 821 if (NULL == abd)
822 { 822 {
823 fprintf (stderr, _ ("Failed to connect to CREDENTIAL\n")); 823 fprintf (stderr, _ ("Failed to connect to ABD\n"));
824 GNUNET_SCHEDULER_shutdown (); 824 GNUNET_SCHEDULER_shutdown ();
825 return; 825 return;
826 } 826 }
@@ -877,11 +877,11 @@ run (void *cls,
877 GNUNET_SCHEDULER_shutdown (); 877 GNUNET_SCHEDULER_shutdown ();
878 return; 878 return;
879 } 879 }
880 credential = GNUNET_CREDENTIAL_connect (cfg); 880 abd = GNUNET_ABD_connect (cfg);
881 881
882 if (NULL == credential) 882 if (NULL == abd)
883 { 883 {
884 fprintf (stderr, _ ("Failed to connect to CREDENTIAL\n")); 884 fprintf (stderr, _ ("Failed to connect to ABD\n"));
885 GNUNET_SCHEDULER_shutdown (); 885 GNUNET_SCHEDULER_shutdown ();
886 return; 886 return;
887 } 887 }
@@ -906,23 +906,23 @@ run (void *cls,
906 int i; 906 int i;
907 while (NULL != (tok = strtok (NULL, ","))) 907 while (NULL != (tok = strtok (NULL, ",")))
908 count++; 908 count++;
909 struct GNUNET_CREDENTIAL_Delegate delegates[count]; 909 struct GNUNET_ABD_Delegate delegates[count];
910 struct GNUNET_CREDENTIAL_Delegate *dele; 910 struct GNUNET_ABD_Delegate *dele;
911 GNUNET_free (tmp); 911 GNUNET_free (tmp);
912 tmp = GNUNET_strdup (subject_delegate); 912 tmp = GNUNET_strdup (subject_delegate);
913 tok = strtok (tmp, ","); 913 tok = strtok (tmp, ",");
914 for (i = 0; i < count; i++) 914 for (i = 0; i < count; i++)
915 { 915 {
916 dele = GNUNET_CREDENTIAL_delegate_from_string (tok); 916 dele = GNUNET_ABD_delegate_from_string (tok);
917 GNUNET_memcpy (&delegates[i], 917 GNUNET_memcpy (&delegates[i],
918 dele, 918 dele,
919 sizeof (struct GNUNET_CREDENTIAL_Delegate)); 919 sizeof (struct GNUNET_ABD_Delegate));
920 delegates[i].issuer_attribute = GNUNET_strdup (dele->issuer_attribute); 920 delegates[i].issuer_attribute = GNUNET_strdup (dele->issuer_attribute);
921 tok = strtok (NULL, ","); 921 tok = strtok (NULL, ",");
922 GNUNET_free (dele); 922 GNUNET_free (dele);
923 } 923 }
924 924
925 verify_request = GNUNET_CREDENTIAL_verify (credential, 925 verify_request = GNUNET_ABD_verify (abd,
926 &issuer_pkey, 926 &issuer_pkey,
927 issuer_attr, 927 issuer_attr,
928 &subject_pkey, 928 &subject_pkey,
@@ -1054,11 +1054,11 @@ main (int argc, char *const *argv)
1054 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 1054 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
1055 return 2; 1055 return 2;
1056 1056
1057 GNUNET_log_setup ("gnunet-credential", "WARNING", NULL); 1057 GNUNET_log_setup ("gnunet-abd", "WARNING", NULL);
1058 if (GNUNET_OK != GNUNET_PROGRAM_run (argc, 1058 if (GNUNET_OK != GNUNET_PROGRAM_run (argc,
1059 argv, 1059 argv,
1060 "gnunet-credential", 1060 "gnunet-abd",
1061 _ ("GNUnet credential resolver tool"), 1061 _ ("GNUnet abd resolver tool"),
1062 options, 1062 options,
1063 &run, 1063 &run,
1064 NULL)) 1064 NULL))
@@ -1067,4 +1067,4 @@ main (int argc, char *const *argv)
1067 return ret; 1067 return ret;
1068} 1068}
1069 1069
1070/* end of gnunet-credential.c */ 1070/* end of gnunet-abd.c */
diff --git a/src/credential/gnunet-service-credential.c b/src/abd/gnunet-service-abd.c
index 4753e8e3b..84222b290 100644
--- a/src/credential/gnunet-service-credential.c
+++ b/src/abd/gnunet-service-abd.c
@@ -18,7 +18,7 @@
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19*/ 19*/
20/** 20/**
21 * @file credential/gnunet-service-credential.c 21 * @file abd/gnunet-service-abd.c
22 * @brief GNUnet Credential Service (main service) 22 * @brief GNUnet Credential Service (main service)
23 * @author Martin Schanzenbach 23 * @author Martin Schanzenbach
24 */ 24 */
@@ -26,9 +26,9 @@
26 26
27#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
28 28
29#include "credential.h" 29#include "abd.h"
30#include "credential_serialization.h" 30#include "abd_serialization.h"
31#include "gnunet_credential_service.h" 31#include "gnunet_abd_service.h"
32#include "gnunet_protocols.h" 32#include "gnunet_protocols.h"
33#include "gnunet_signatures.h" 33#include "gnunet_signatures.h"
34#include "gnunet_statistics_service.h" 34#include "gnunet_statistics_service.h"
@@ -39,7 +39,7 @@
39#include <gnunet_namestore_service.h> 39#include <gnunet_namestore_service.h>
40 40
41 41
42#define GNUNET_CREDENTIAL_MAX_LENGTH 255 42#define GNUNET_ABD_MAX_LENGTH 255
43 43
44struct VerifyRequestHandle; 44struct VerifyRequestHandle;
45 45
@@ -82,32 +82,6 @@ struct DelegationChainEntry
82/** 82/**
83 * DLL for record 83 * DLL for record
84 */ 84 */
85struct CredentialRecordEntry
86{
87 /**
88 * DLL
89 */
90 struct CredentialRecordEntry *next;
91
92 /**
93 * DLL
94 */
95 struct CredentialRecordEntry *prev;
96
97 /**
98 * Number of references in delegation chains
99 */
100 uint32_t refcount;
101
102 /**
103 * Payload
104 */
105 struct GNUNET_CREDENTIAL_Credential *credential;
106};
107
108/**
109 * DLL for record
110 */
111struct DelegateRecordEntry 85struct DelegateRecordEntry
112{ 86{
113 /** 87 /**
@@ -128,7 +102,7 @@ struct DelegateRecordEntry
128 /** 102 /**
129 * Payload 103 * Payload
130 */ 104 */
131 struct GNUNET_CREDENTIAL_Delegate *delegate; 105 struct GNUNET_ABD_Delegate *delegate;
132}; 106};
133 107
134/** 108/**
@@ -338,7 +312,7 @@ struct VerifyRequestHandle
338 /** 312 /**
339 * Direction of the resolution algo 313 * Direction of the resolution algo
340 */ 314 */
341 enum GNUNET_CREDENTIAL_AlgoDirectionFlags resolution_algo; 315 enum GNUNET_ABD_AlgoDirectionFlags resolution_algo;
342 316
343 /** 317 /**
344 * Delegate iterator for lookup 318 * Delegate iterator for lookup
@@ -463,7 +437,7 @@ shutdown_task (void *cls)
463 437
464 while (NULL != (vrh = vrh_head)) 438 while (NULL != (vrh = vrh_head))
465 { 439 {
466 // CREDENTIAL_resolver_lookup_cancel (clh->lookup); 440 // ABD_resolver_lookup_cancel (clh->lookup);
467 GNUNET_CONTAINER_DLL_remove (vrh_head, vrh_tail, vrh); 441 GNUNET_CONTAINER_DLL_remove (vrh_head, vrh_tail, vrh);
468 cleanup_handle (vrh); 442 cleanup_handle (vrh);
469 } 443 }
@@ -489,14 +463,14 @@ static void
489send_intermediate_response(struct VerifyRequestHandle *vrh, struct DelegationChainEntry *ch_entry, bool is_bw){ 463send_intermediate_response(struct VerifyRequestHandle *vrh, struct DelegationChainEntry *ch_entry, bool is_bw){
490 struct DelegationChainIntermediateMessage *rmsg; 464 struct DelegationChainIntermediateMessage *rmsg;
491 struct GNUNET_MQ_Envelope *env; 465 struct GNUNET_MQ_Envelope *env;
492 struct GNUNET_CREDENTIAL_Delegation *dd; 466 struct GNUNET_ABD_Delegation *dd;
493 size_t size; 467 size_t size;
494 468
495 // Don't report immediate results during collect 469 // Don't report immediate results during collect
496 if(vrh->is_collect) 470 if(vrh->is_collect)
497 return; 471 return;
498 472
499 dd = GNUNET_new (struct GNUNET_CREDENTIAL_Delegation); 473 dd = GNUNET_new (struct GNUNET_ABD_Delegation);
500 dd->issuer_key = ch_entry->issuer_key; 474 dd->issuer_key = ch_entry->issuer_key;
501 dd->subject_key = ch_entry->subject_key; 475 dd->subject_key = ch_entry->subject_key;
502 dd->issuer_attribute = ch_entry->issuer_attribute; 476 dd->issuer_attribute = ch_entry->issuer_attribute;
@@ -510,21 +484,21 @@ send_intermediate_response(struct VerifyRequestHandle *vrh, struct DelegationCha
510 } 484 }
511 485
512 486
513 size = GNUNET_CREDENTIAL_delegation_chain_get_size (1, 487 size = GNUNET_ABD_delegation_chain_get_size (1,
514 dd, 488 dd,
515 0, 489 0,
516 NULL); 490 NULL);
517 491
518 env = GNUNET_MQ_msg_extra (rmsg, 492 env = GNUNET_MQ_msg_extra (rmsg,
519 size, 493 size,
520 GNUNET_MESSAGE_TYPE_CREDENTIAL_INTERMEDIATE_RESULT); 494 GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT);
521 // Assign id so that client can find associated request 495 // Assign id so that client can find associated request
522 rmsg->id = vrh->request_id; 496 rmsg->id = vrh->request_id;
523 rmsg->is_bw = htons(is_bw); 497 rmsg->is_bw = htons(is_bw);
524 rmsg->size = htonl(size); 498 rmsg->size = htonl(size);
525 499
526 GNUNET_assert ( 500 GNUNET_assert (
527 -1 != GNUNET_CREDENTIAL_delegation_chain_serialize (1, 501 -1 != GNUNET_ABD_delegation_chain_serialize (1,
528 dd, 502 dd,
529 0, 503 0,
530 NULL, 504 NULL,
@@ -539,8 +513,8 @@ send_lookup_response (struct VerifyRequestHandle *vrh)
539 struct GNUNET_MQ_Envelope *env; 513 struct GNUNET_MQ_Envelope *env;
540 struct DelegationChainResultMessage *rmsg; 514 struct DelegationChainResultMessage *rmsg;
541 struct DelegationChainEntry *dce; 515 struct DelegationChainEntry *dce;
542 struct GNUNET_CREDENTIAL_Delegation dd[vrh->delegation_chain_size]; 516 struct GNUNET_ABD_Delegation dd[vrh->delegation_chain_size];
543 struct GNUNET_CREDENTIAL_Delegate dele[vrh->del_chain_size]; 517 struct GNUNET_ABD_Delegate dele[vrh->del_chain_size];
544 struct DelegateRecordEntry *del; 518 struct DelegateRecordEntry *del;
545 struct DelegateRecordEntry *tmp; 519 struct DelegateRecordEntry *tmp;
546 size_t size; 520 size_t size;
@@ -595,13 +569,13 @@ send_lookup_response (struct VerifyRequestHandle *vrh)
595 del = del->next; 569 del = del->next;
596 } 570 }
597 size = 571 size =
598 GNUNET_CREDENTIAL_delegation_chain_get_size (vrh->delegation_chain_size, 572 GNUNET_ABD_delegation_chain_get_size (vrh->delegation_chain_size,
599 dd, 573 dd,
600 vrh->del_chain_size, 574 vrh->del_chain_size,
601 dele); 575 dele);
602 env = GNUNET_MQ_msg_extra (rmsg, 576 env = GNUNET_MQ_msg_extra (rmsg,
603 size, 577 size,
604 GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT); 578 GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT);
605 // Assign id so that client can find associated request 579 // Assign id so that client can find associated request
606 rmsg->id = vrh->request_id; 580 rmsg->id = vrh->request_id;
607 rmsg->d_count = htonl (vrh->delegation_chain_size); 581 rmsg->d_count = htonl (vrh->delegation_chain_size);
@@ -614,7 +588,7 @@ send_lookup_response (struct VerifyRequestHandle *vrh)
614 588
615 GNUNET_assert ( 589 GNUNET_assert (
616 -1 != 590 -1 !=
617 GNUNET_CREDENTIAL_delegation_chain_serialize (vrh->delegation_chain_size, 591 GNUNET_ABD_delegation_chain_serialize (vrh->delegation_chain_size,
618 dd, 592 dd,
619 vrh->del_chain_size, 593 vrh->del_chain_size,
620 dele, 594 dele,
@@ -775,8 +749,8 @@ forward_resolution (void *cls,
775 continue; 749 continue;
776 750
777 // Start deserialize into Delegate 751 // Start deserialize into Delegate
778 struct GNUNET_CREDENTIAL_Delegate *del; 752 struct GNUNET_ABD_Delegate *del;
779 del = GNUNET_CREDENTIAL_delegate_deserialize (rd[i].data, rd[i].data_size); 753 del = GNUNET_ABD_delegate_deserialize (rd[i].data, rd[i].data_size);
780 754
781 // Start: Create DQ Entry 755 // Start: Create DQ Entry
782 dq_entry = GNUNET_new (struct DelegationQueueEntry); 756 dq_entry = GNUNET_new (struct DelegationQueueEntry);
@@ -996,7 +970,7 @@ backward_resolution (void *cls,
996 const struct GNUNET_GNSRECORD_Data *rd) 970 const struct GNUNET_GNSRECORD_Data *rd)
997{ 971{
998 struct VerifyRequestHandle *vrh; 972 struct VerifyRequestHandle *vrh;
999 const struct GNUNET_CREDENTIAL_DelegationRecord *sets; 973 const struct GNUNET_ABD_DelegationRecord *sets;
1000 struct DelegateRecordEntry *del_pointer; 974 struct DelegateRecordEntry *del_pointer;
1001 struct DelegationSetQueueEntry *current_set; 975 struct DelegationSetQueueEntry *current_set;
1002 struct DelegationSetQueueEntry *ds_entry; 976 struct DelegationSetQueueEntry *ds_entry;
@@ -1017,13 +991,13 @@ backward_resolution (void *cls,
1017 continue; 991 continue;
1018 992
1019 sets = rd[i].data; 993 sets = rd[i].data;
1020 struct GNUNET_CREDENTIAL_DelegationSet set[ntohl (sets->set_count)]; 994 struct GNUNET_ABD_DelegationSet set[ntohl (sets->set_count)];
1021 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 995 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1022 "Found new attribute delegation with %d sets. Creating new Job...\n", 996 "Found new attribute delegation with %d sets. Creating new Job...\n",
1023 ntohl (sets->set_count)); 997 ntohl (sets->set_count));
1024 998
1025 if (GNUNET_OK != 999 if (GNUNET_OK !=
1026 GNUNET_CREDENTIAL_delegation_set_deserialize (GNUNET_ntohll ( 1000 GNUNET_ABD_delegation_set_deserialize (GNUNET_ntohll (
1027 sets->data_size), 1001 sets->data_size),
1028 (const char *) &sets[1], 1002 (const char *) &sets[1],
1029 ntohl (sets->set_count), 1003 ntohl (sets->set_count),
@@ -1430,14 +1404,14 @@ check_verify (void *cls, const struct VerifyMessage *v_msg)
1430 GNUNET_break (0); 1404 GNUNET_break (0);
1431 return GNUNET_SYSERR; 1405 return GNUNET_SYSERR;
1432 } 1406 }
1433 if (ntohs (v_msg->issuer_attribute_len) > GNUNET_CREDENTIAL_MAX_LENGTH) 1407 if (ntohs (v_msg->issuer_attribute_len) > GNUNET_ABD_MAX_LENGTH)
1434 { 1408 {
1435 GNUNET_break (0); 1409 GNUNET_break (0);
1436 return GNUNET_SYSERR; 1410 return GNUNET_SYSERR;
1437 } 1411 }
1438 attr = (const char *) &v_msg[1]; 1412 attr = (const char *) &v_msg[1];
1439 1413
1440 if (strlen (attr) > GNUNET_CREDENTIAL_MAX_LENGTH) 1414 if (strlen (attr) > GNUNET_ABD_MAX_LENGTH)
1441 { 1415 {
1442 GNUNET_break (0); 1416 GNUNET_break (0);
1443 return GNUNET_SYSERR; 1417 return GNUNET_SYSERR;
@@ -1453,8 +1427,8 @@ handle_verify (void *cls, const struct VerifyMessage *v_msg)
1453 struct DelegateRecordEntry *del_entry; 1427 struct DelegateRecordEntry *del_entry;
1454 uint32_t delegate_count; 1428 uint32_t delegate_count;
1455 uint32_t delegate_data_size; 1429 uint32_t delegate_data_size;
1456 char attr[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; 1430 char attr[GNUNET_ABD_MAX_LENGTH + 1];
1457 char issuer_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; 1431 char issuer_attribute[GNUNET_ABD_MAX_LENGTH + 1];
1458 char *attrptr = attr; 1432 char *attrptr = attr;
1459 char *delegate_data; 1433 char *delegate_data;
1460 const char *utf_in; 1434 const char *utf_in;
@@ -1494,12 +1468,12 @@ handle_verify (void *cls, const struct VerifyMessage *v_msg)
1494 delegate_data_size = ntohs (v_msg->header.size) - 1468 delegate_data_size = ntohs (v_msg->header.size) -
1495 sizeof (struct VerifyMessage) - 1469 sizeof (struct VerifyMessage) -
1496 ntohs (v_msg->issuer_attribute_len) - 1; 1470 ntohs (v_msg->issuer_attribute_len) - 1;
1497 struct GNUNET_CREDENTIAL_Delegate delegates[delegate_count]; 1471 struct GNUNET_ABD_Delegate delegates[delegate_count];
1498 memset (delegates, 1472 memset (delegates,
1499 0, 1473 0,
1500 sizeof (struct GNUNET_CREDENTIAL_Delegate) * delegate_count); 1474 sizeof (struct GNUNET_ABD_Delegate) * delegate_count);
1501 delegate_data = (char *) &v_msg[1] + ntohs (v_msg->issuer_attribute_len) + 1; 1475 delegate_data = (char *) &v_msg[1] + ntohs (v_msg->issuer_attribute_len) + 1;
1502 if (GNUNET_OK != GNUNET_CREDENTIAL_delegates_deserialize (delegate_data_size, 1476 if (GNUNET_OK != GNUNET_ABD_delegates_deserialize (delegate_data_size,
1503 delegate_data, 1477 delegate_data,
1504 delegate_count, 1478 delegate_count,
1505 delegates)) 1479 delegates))
@@ -1514,11 +1488,11 @@ handle_verify (void *cls, const struct VerifyMessage *v_msg)
1514 { 1488 {
1515 del_entry = GNUNET_new (struct DelegateRecordEntry); 1489 del_entry = GNUNET_new (struct DelegateRecordEntry);
1516 del_entry->delegate = 1490 del_entry->delegate =
1517 GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_Delegate) + 1491 GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) +
1518 delegates[i].issuer_attribute_len + 1); 1492 delegates[i].issuer_attribute_len + 1);
1519 GNUNET_memcpy (del_entry->delegate, 1493 GNUNET_memcpy (del_entry->delegate,
1520 &delegates[i], 1494 &delegates[i],
1521 sizeof (struct GNUNET_CREDENTIAL_Delegate)); 1495 sizeof (struct GNUNET_ABD_Delegate));
1522 GNUNET_memcpy (&del_entry->delegate[1], 1496 GNUNET_memcpy (&del_entry->delegate[1],
1523 delegates[i].issuer_attribute, 1497 delegates[i].issuer_attribute,
1524 delegates[i].issuer_attribute_len); 1498 delegates[i].issuer_attribute_len);
@@ -1532,18 +1506,18 @@ handle_verify (void *cls, const struct VerifyMessage *v_msg)
1532 } 1506 }
1533 1507
1534 // Switch resolution algo 1508 // Switch resolution algo
1535 if (GNUNET_CREDENTIAL_FLAG_BACKWARD & vrh->resolution_algo && 1509 if (GNUNET_ABD_FLAG_BACKWARD & vrh->resolution_algo &&
1536 GNUNET_CREDENTIAL_FLAG_FORWARD & vrh->resolution_algo) 1510 GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo)
1537 { 1511 {
1538 if(1 == delegation_chain_fw_resolution_start (vrh)) 1512 if(1 == delegation_chain_fw_resolution_start (vrh))
1539 return; 1513 return;
1540 delegation_chain_bw_resolution_start (vrh); 1514 delegation_chain_bw_resolution_start (vrh);
1541 } 1515 }
1542 else if (GNUNET_CREDENTIAL_FLAG_BACKWARD & vrh->resolution_algo) 1516 else if (GNUNET_ABD_FLAG_BACKWARD & vrh->resolution_algo)
1543 { 1517 {
1544 delegation_chain_bw_resolution_start (vrh); 1518 delegation_chain_bw_resolution_start (vrh);
1545 } 1519 }
1546 else if (GNUNET_CREDENTIAL_FLAG_FORWARD & vrh->resolution_algo) 1520 else if (GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo)
1547 { 1521 {
1548 delegation_chain_fw_resolution_start (vrh); 1522 delegation_chain_fw_resolution_start (vrh);
1549 } 1523 }
@@ -1566,19 +1540,19 @@ delegate_collection_finished (void *cls)
1566 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Done collecting delegates.\n"); 1540 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Done collecting delegates.\n");
1567 1541
1568 // if both are set: bidirectional search, meaning start both chain resolutions 1542 // if both are set: bidirectional search, meaning start both chain resolutions
1569 if (GNUNET_CREDENTIAL_FLAG_BACKWARD & vrh->resolution_algo && 1543 if (GNUNET_ABD_FLAG_BACKWARD & vrh->resolution_algo &&
1570 GNUNET_CREDENTIAL_FLAG_FORWARD & vrh->resolution_algo) 1544 GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo)
1571 { 1545 {
1572 // if premature match found don't start bw resultion 1546 // if premature match found don't start bw resultion
1573 if(1 == delegation_chain_fw_resolution_start (vrh)) 1547 if(1 == delegation_chain_fw_resolution_start (vrh))
1574 return; 1548 return;
1575 delegation_chain_bw_resolution_start (vrh); 1549 delegation_chain_bw_resolution_start (vrh);
1576 } 1550 }
1577 else if (GNUNET_CREDENTIAL_FLAG_BACKWARD & vrh->resolution_algo) 1551 else if (GNUNET_ABD_FLAG_BACKWARD & vrh->resolution_algo)
1578 { 1552 {
1579 delegation_chain_bw_resolution_start (vrh); 1553 delegation_chain_bw_resolution_start (vrh);
1580 } 1554 }
1581 else if (GNUNET_CREDENTIAL_FLAG_FORWARD & vrh->resolution_algo) 1555 else if (GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo)
1582 { 1556 {
1583 delegation_chain_fw_resolution_start (vrh); 1557 delegation_chain_fw_resolution_start (vrh);
1584 } 1558 }
@@ -1592,7 +1566,7 @@ handle_delegate_collection_cb (void *cls,
1592 const struct GNUNET_GNSRECORD_Data *rd) 1566 const struct GNUNET_GNSRECORD_Data *rd)
1593{ 1567{
1594 struct VerifyRequestHandle *vrh = cls; 1568 struct VerifyRequestHandle *vrh = cls;
1595 struct GNUNET_CREDENTIAL_Delegate *del; 1569 struct GNUNET_ABD_Delegate *del;
1596 struct DelegateRecordEntry *del_entry; 1570 struct DelegateRecordEntry *del_entry;
1597 int cred_record_count; 1571 int cred_record_count;
1598 cred_record_count = 0; 1572 cred_record_count = 0;
@@ -1603,7 +1577,7 @@ handle_delegate_collection_cb (void *cls,
1603 if (GNUNET_GNSRECORD_TYPE_DELEGATE != rd[i].record_type) 1577 if (GNUNET_GNSRECORD_TYPE_DELEGATE != rd[i].record_type)
1604 continue; 1578 continue;
1605 cred_record_count++; 1579 cred_record_count++;
1606 del = GNUNET_CREDENTIAL_delegate_deserialize (rd[i].data, rd[i].data_size); 1580 del = GNUNET_ABD_delegate_deserialize (rd[i].data, rd[i].data_size);
1607 if (NULL == del) 1581 if (NULL == del)
1608 { 1582 {
1609 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Invalid delegate found\n"); 1583 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Invalid delegate found\n");
@@ -1628,8 +1602,8 @@ handle_delegate_collection_cb (void *cls,
1628static void 1602static void
1629handle_collect (void *cls, const struct CollectMessage *c_msg) 1603handle_collect (void *cls, const struct CollectMessage *c_msg)
1630{ 1604{
1631 char attr[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; 1605 char attr[GNUNET_ABD_MAX_LENGTH + 1];
1632 char issuer_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; 1606 char issuer_attribute[GNUNET_ABD_MAX_LENGTH + 1];
1633 struct VerifyRequestHandle *vrh; 1607 struct VerifyRequestHandle *vrh;
1634 struct GNUNET_SERVICE_Client *client = cls; 1608 struct GNUNET_SERVICE_Client *client = cls;
1635 char *attrptr = attr; 1609 char *attrptr = attr;
@@ -1692,7 +1666,7 @@ check_collect (void *cls, const struct CollectMessage *c_msg)
1692 GNUNET_break (0); 1666 GNUNET_break (0);
1693 return GNUNET_SYSERR; 1667 return GNUNET_SYSERR;
1694 } 1668 }
1695 if (ntohs (c_msg->issuer_attribute_len) > GNUNET_CREDENTIAL_MAX_LENGTH) 1669 if (ntohs (c_msg->issuer_attribute_len) > GNUNET_ABD_MAX_LENGTH)
1696 { 1670 {
1697 GNUNET_break (0); 1671 GNUNET_break (0);
1698 return GNUNET_SYSERR; 1672 return GNUNET_SYSERR;
@@ -1700,7 +1674,7 @@ check_collect (void *cls, const struct CollectMessage *c_msg)
1700 attr = (const char *) &c_msg[1]; 1674 attr = (const char *) &c_msg[1];
1701 1675
1702 if (('\0' != attr[msg_size - sizeof (struct CollectMessage) - 1]) || 1676 if (('\0' != attr[msg_size - sizeof (struct CollectMessage) - 1]) ||
1703 (strlen (attr) > GNUNET_CREDENTIAL_MAX_LENGTH)) 1677 (strlen (attr) > GNUNET_ABD_MAX_LENGTH))
1704 { 1678 {
1705 GNUNET_break (0); 1679 GNUNET_break (0);
1706 return GNUNET_SYSERR; 1680 return GNUNET_SYSERR;
@@ -1749,7 +1723,7 @@ run (void *cls,
1749 fprintf (stderr, _ ("Failed to connect to namestore\n")); 1723 fprintf (stderr, _ ("Failed to connect to namestore\n"));
1750 } 1724 }
1751 1725
1752 statistics = GNUNET_STATISTICS_create ("credential", c); 1726 statistics = GNUNET_STATISTICS_create ("abd", c);
1753 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL); 1727 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
1754} 1728}
1755 1729
@@ -1758,20 +1732,20 @@ run (void *cls,
1758 * Define "main" method using service macro 1732 * Define "main" method using service macro
1759 */ 1733 */
1760GNUNET_SERVICE_MAIN ( 1734GNUNET_SERVICE_MAIN (
1761 "credential", 1735 "abd",
1762 GNUNET_SERVICE_OPTION_NONE, 1736 GNUNET_SERVICE_OPTION_NONE,
1763 &run, 1737 &run,
1764 &client_connect_cb, 1738 &client_connect_cb,
1765 &client_disconnect_cb, 1739 &client_disconnect_cb,
1766 NULL, 1740 NULL,
1767 GNUNET_MQ_hd_var_size (verify, 1741 GNUNET_MQ_hd_var_size (verify,
1768 GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY, 1742 GNUNET_MESSAGE_TYPE_ABD_VERIFY,
1769 struct VerifyMessage, 1743 struct VerifyMessage,
1770 NULL), 1744 NULL),
1771 GNUNET_MQ_hd_var_size (collect, 1745 GNUNET_MQ_hd_var_size (collect,
1772 GNUNET_MESSAGE_TYPE_CREDENTIAL_COLLECT, 1746 GNUNET_MESSAGE_TYPE_ABD_COLLECT,
1773 struct CollectMessage, 1747 struct CollectMessage,
1774 NULL), 1748 NULL),
1775 GNUNET_MQ_handler_end ()); 1749 GNUNET_MQ_handler_end ());
1776 1750
1777/* end of gnunet-service-credential.c */ 1751/* end of gnunet-service-abd.c */
diff --git a/src/credential/plugin_gnsrecord_credential.c b/src/abd/plugin_gnsrecord_abd.c
index 088c4dd0e..811878627 100644
--- a/src/credential/plugin_gnsrecord_credential.c
+++ b/src/abd/plugin_gnsrecord_abd.c
@@ -19,8 +19,8 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file credential/plugin_gnsrecord_credential.c 22 * @file abd/plugin_gnsrecord_abd.c
23 * @brief gnsrecord plugin to provide the API for CREDENTIAL records 23 * @brief gnsrecord plugin to provide the API for ABD records
24 * @author Martin Schanzenbach 24 * @author Martin Schanzenbach
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
@@ -28,8 +28,8 @@
28#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29 29
30#include "delegate_misc.h" 30#include "delegate_misc.h"
31#include "credential_serialization.h" 31#include "abd_serialization.h"
32#include "gnunet_credential_service.h" 32#include "gnunet_abd_service.h"
33#include "gnunet_gnsrecord_lib.h" 33#include "gnunet_gnsrecord_lib.h"
34#include "gnunet_gnsrecord_plugin.h" 34#include "gnunet_gnsrecord_plugin.h"
35#include "gnunet_signatures.h" 35#include "gnunet_signatures.h"
@@ -43,7 +43,7 @@
43 * @return NULL on error, otherwise human-readable representation of the value 43 * @return NULL on error, otherwise human-readable representation of the value
44 */ 44 */
45static char * 45static char *
46credential_value_to_string (void *cls, 46abd_value_to_string (void *cls,
47 uint32_t type, 47 uint32_t type,
48 const void *data, 48 const void *data,
49 size_t data_size) 49 size_t data_size)
@@ -54,20 +54,20 @@ credential_value_to_string (void *cls,
54 { 54 {
55 case GNUNET_GNSRECORD_TYPE_ATTRIBUTE: 55 case GNUNET_GNSRECORD_TYPE_ATTRIBUTE:
56 { 56 {
57 struct GNUNET_CREDENTIAL_DelegationRecord sets; 57 struct GNUNET_ABD_DelegationRecord sets;
58 char *attr_str; 58 char *attr_str;
59 char *subject_pkey; 59 char *subject_pkey;
60 char *tmp_str; 60 char *tmp_str;
61 int i; 61 int i;
62 if (data_size < sizeof (struct GNUNET_CREDENTIAL_DelegationRecord)) 62 if (data_size < sizeof (struct GNUNET_ABD_DelegationRecord))
63 return NULL; /* malformed */ 63 return NULL; /* malformed */
64 64
65 GNUNET_memcpy (&sets, data, sizeof (sets)); 65 GNUNET_memcpy (&sets, data, sizeof (sets));
66 cdata = data; 66 cdata = data;
67 67
68 struct GNUNET_CREDENTIAL_DelegationSet set[ntohl (sets.set_count)]; 68 struct GNUNET_ABD_DelegationSet set[ntohl (sets.set_count)];
69 if (GNUNET_OK != 69 if (GNUNET_OK !=
70 GNUNET_CREDENTIAL_delegation_set_deserialize (GNUNET_ntohll ( 70 GNUNET_ABD_delegation_set_deserialize (GNUNET_ntohll (
71 sets.data_size), 71 sets.data_size),
72 &cdata[sizeof (sets)], 72 &cdata[sizeof (sets)],
73 ntohl (sets.set_count), 73 ntohl (sets.set_count),
@@ -118,11 +118,11 @@ credential_value_to_string (void *cls,
118 } 118 }
119 case GNUNET_GNSRECORD_TYPE_DELEGATE: 119 case GNUNET_GNSRECORD_TYPE_DELEGATE:
120 { 120 {
121 struct GNUNET_CREDENTIAL_Delegate *cred; 121 struct GNUNET_ABD_Delegate *cred;
122 char *cred_str; 122 char *cred_str;
123 123
124 cred = GNUNET_CREDENTIAL_delegate_deserialize (data, data_size); 124 cred = GNUNET_ABD_delegate_deserialize (data, data_size);
125 cred_str = GNUNET_CREDENTIAL_delegate_to_string (cred); 125 cred_str = GNUNET_ABD_delegate_to_string (cred);
126 GNUNET_free (cred); 126 GNUNET_free (cred);
127 return cred_str; 127 return cred_str;
128 } 128 }
@@ -144,7 +144,7 @@ credential_value_to_string (void *cls,
144 * @return #GNUNET_OK on success 144 * @return #GNUNET_OK on success
145 */ 145 */
146static int 146static int
147credential_string_to_value (void *cls, 147abd_string_to_value (void *cls,
148 uint32_t type, 148 uint32_t type,
149 const char *s, 149 const char *s,
150 void **data, 150 void **data,
@@ -156,7 +156,7 @@ credential_string_to_value (void *cls,
156 { 156 {
157 case GNUNET_GNSRECORD_TYPE_ATTRIBUTE: 157 case GNUNET_GNSRECORD_TYPE_ATTRIBUTE:
158 { 158 {
159 struct GNUNET_CREDENTIAL_DelegationRecord *sets; 159 struct GNUNET_ABD_DelegationRecord *sets;
160 char attr_str[253 + 1]; 160 char attr_str[253 + 1];
161 char subject_pkey[52 + 1]; 161 char subject_pkey[52 + 1];
162 char *token; 162 char *token;
@@ -170,7 +170,7 @@ credential_string_to_value (void *cls,
170 token = strtok (tmp_str, ","); 170 token = strtok (tmp_str, ",");
171 entries = 0; 171 entries = 0;
172 tmp_data_size = 0; 172 tmp_data_size = 0;
173 *data_size = sizeof (struct GNUNET_CREDENTIAL_DelegationRecord); 173 *data_size = sizeof (struct GNUNET_ABD_DelegationRecord);
174 while (NULL != token) 174 while (NULL != token)
175 { 175 {
176 // also fills the variables subject_pley and attr_str if "regex"-like match 176 // also fills the variables subject_pley and attr_str if "regex"-like match
@@ -199,9 +199,9 @@ credential_string_to_value (void *cls,
199 return GNUNET_SYSERR; 199 return GNUNET_SYSERR;
200 } 200 }
201 201
202 struct GNUNET_CREDENTIAL_DelegationSet set[entries]; 202 struct GNUNET_ABD_DelegationSet set[entries];
203 // sets memory to be 0, starting at *set for the size of struct * entries 203 // sets memory to be 0, starting at *set for the size of struct * entries
204 memset (set, 0, sizeof (struct GNUNET_CREDENTIAL_DelegationSet) * entries); 204 memset (set, 0, sizeof (struct GNUNET_ABD_DelegationSet) * entries);
205 for (i = 0; i < entries; i++) 205 for (i = 0; i < entries; i++)
206 { 206 {
207 matches = SSCANF (token, "%s %s", subject_pkey, attr_str); 207 matches = SSCANF (token, "%s %s", subject_pkey, attr_str);
@@ -220,7 +220,7 @@ credential_string_to_value (void *cls,
220 // If more entries, then token string can take the next entry (separated by ',') by calling strtok again 220 // If more entries, then token string can take the next entry (separated by ',') by calling strtok again
221 token = strtok (NULL, ","); 221 token = strtok (NULL, ",");
222 } 222 }
223 tmp_data_size = GNUNET_CREDENTIAL_delegation_set_get_size (entries, set); 223 tmp_data_size = GNUNET_ABD_delegation_set_get_size (entries, set);
224 224
225 if (-1 == tmp_data_size) 225 if (-1 == tmp_data_size)
226 { 226 {
@@ -229,7 +229,7 @@ credential_string_to_value (void *cls,
229 } 229 }
230 *data_size += tmp_data_size; 230 *data_size += tmp_data_size;
231 *data = sets = GNUNET_malloc (*data_size); 231 *data = sets = GNUNET_malloc (*data_size);
232 GNUNET_CREDENTIAL_delegation_set_serialize (entries, 232 GNUNET_ABD_delegation_set_serialize (entries,
233 set, 233 set,
234 tmp_data_size, 234 tmp_data_size,
235 (char *) &sets[1]); 235 (char *) &sets[1]);
@@ -246,10 +246,10 @@ credential_string_to_value (void *cls,
246 } 246 }
247 case GNUNET_GNSRECORD_TYPE_DELEGATE: 247 case GNUNET_GNSRECORD_TYPE_DELEGATE:
248 { 248 {
249 struct GNUNET_CREDENTIAL_Delegate *cred; 249 struct GNUNET_ABD_Delegate *cred;
250 cred = GNUNET_CREDENTIAL_delegate_from_string (s); 250 cred = GNUNET_ABD_delegate_from_string (s);
251 251
252 *data_size = GNUNET_CREDENTIAL_delegate_serialize (cred, (char **) data); 252 *data_size = GNUNET_ABD_delegate_serialize (cred, (char **) data);
253 253
254 return GNUNET_OK; 254 return GNUNET_OK;
255 } 255 }
@@ -267,8 +267,7 @@ static struct
267{ 267{
268 const char *name; 268 const char *name;
269 uint32_t number; 269 uint32_t number;
270} name_map[] = {{"CRED", GNUNET_GNSRECORD_TYPE_CREDENTIAL}, 270} name_map[] = {{"ATTR", GNUNET_GNSRECORD_TYPE_ATTRIBUTE},
271 {"ATTR", GNUNET_GNSRECORD_TYPE_ATTRIBUTE},
272 {"DEL", GNUNET_GNSRECORD_TYPE_DELEGATE}, 271 {"DEL", GNUNET_GNSRECORD_TYPE_DELEGATE},
273 {NULL, UINT32_MAX}}; 272 {NULL, UINT32_MAX}};
274 273
@@ -281,7 +280,7 @@ static struct
281 * @return corresponding number, UINT32_MAX on error 280 * @return corresponding number, UINT32_MAX on error
282 */ 281 */
283static uint32_t 282static uint32_t
284credential_typename_to_number (void *cls, const char *gns_typename) 283abd_typename_to_number (void *cls, const char *gns_typename)
285{ 284{
286 unsigned int i; 285 unsigned int i;
287 286
@@ -301,7 +300,7 @@ credential_typename_to_number (void *cls, const char *gns_typename)
301 * @return corresponding typestring, NULL on error 300 * @return corresponding typestring, NULL on error
302 */ 301 */
303static const char * 302static const char *
304credential_number_to_typename (void *cls, uint32_t type) 303abd_number_to_typename (void *cls, uint32_t type)
305{ 304{
306 unsigned int i; 305 unsigned int i;
307 306
@@ -319,15 +318,15 @@ credential_number_to_typename (void *cls, uint32_t type)
319 * @return the exported block API 318 * @return the exported block API
320 */ 319 */
321void * 320void *
322libgnunet_plugin_gnsrecord_credential_init (void *cls) 321libgnunet_plugin_gnsrecord_abd_init (void *cls)
323{ 322{
324 struct GNUNET_GNSRECORD_PluginFunctions *api; 323 struct GNUNET_GNSRECORD_PluginFunctions *api;
325 324
326 api = GNUNET_new (struct GNUNET_GNSRECORD_PluginFunctions); 325 api = GNUNET_new (struct GNUNET_GNSRECORD_PluginFunctions);
327 api->value_to_string = &credential_value_to_string; 326 api->value_to_string = &abd_value_to_string;
328 api->string_to_value = &credential_string_to_value; 327 api->string_to_value = &abd_string_to_value;
329 api->typename_to_number = &credential_typename_to_number; 328 api->typename_to_number = &abd_typename_to_number;
330 api->number_to_typename = &credential_number_to_typename; 329 api->number_to_typename = &abd_number_to_typename;
331 return api; 330 return api;
332} 331}
333 332
@@ -339,7 +338,7 @@ libgnunet_plugin_gnsrecord_credential_init (void *cls)
339 * @return NULL 338 * @return NULL
340 */ 339 */
341void * 340void *
342libgnunet_plugin_gnsrecord_credential_done (void *cls) 341libgnunet_plugin_gnsrecord_abd_done (void *cls)
343{ 342{
344 struct GNUNET_GNSRECORD_PluginFunctions *api = cls; 343 struct GNUNET_GNSRECORD_PluginFunctions *api = cls;
345 344
@@ -347,4 +346,4 @@ libgnunet_plugin_gnsrecord_credential_done (void *cls)
347 return NULL; 346 return NULL;
348} 347}
349 348
350/* end of plugin_gnsrecord_credential.c */ 349/* end of plugin_gnsrecord_abd.c */
diff --git a/src/credential/plugin_rest_credential.c b/src/abd/plugin_rest_credential.c
index 513ddfff9..513ddfff9 100644
--- a/src/credential/plugin_rest_credential.c
+++ b/src/abd/plugin_rest_credential.c
diff --git a/src/abd/test_abd_bi_and.sh b/src/abd/test_abd_bi_and.sh
new file mode 100755
index 000000000..b32313636
--- /dev/null
+++ b/src/abd/test_abd_bi_and.sh
@@ -0,0 +1,98 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_abd_lookup.conf
23
24gnunet-identity -C a -c test_abd_lookup.conf
25gnunet-identity -C b -c test_abd_lookup.conf
26gnunet-identity -C c -c test_abd_lookup.conf
27gnunet-identity -C d -c test_abd_lookup.conf
28gnunet-identity -C e -c test_abd_lookup.conf
29gnunet-identity -C f -c test_abd_lookup.conf
30gnunet-identity -C g -c test_abd_lookup.conf
31gnunet-identity -C h -c test_abd_lookup.conf
32AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
33BKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep b | awk '{print $3}')
34CKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep c | awk '{print $3}')
35DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
36EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
37FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
38GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
39HKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep h | awk '{print $3}')
40gnunet-identity -d
41
42# (1) (A.a) <- B.b
43# (2) (B.b) <- C.c AND G.g
44# (3) C.c <- (D.D)
45# (4) D.d <- (E.e)
46# (5) E.e <- (F) priv
47# (6) (G.g) <- H.h
48# (7) H.h <- (F) priv
49
50# BIDIRECTIONAL
51gnunet-abd --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_abd_lookup.conf
52gnunet-namestore -D -z a
53gnunet-abd --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, $GKEY g" --ttl=5m -c test_abd_lookup.conf
54gnunet-namestore -D -z b
55gnunet-abd --createIssuerSide --ego=g --attribute="g" --subject="$HKEY h" --ttl=5m -c test_abd_lookup.conf
56gnunet-namestore -D -z b
57
58SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
59gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
60gnunet-namestore -D -z d
61SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
62gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
63gnunet-namestore -D -z e
64SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
65gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
66gnunet-namestore -D -z f
67SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=h --attribute="h" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
68gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
69gnunet-namestore -D -z h
70
71# Starting to resolve
72echo "+++ Starting to Resolve +++"
73
74DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=f --forward --backward -c test_abd_lookup.conf | paste -d, -s - -`
75echo $DELS
76echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --forward --backward -c test_abd_lookup.conf
77gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --forward --backward -c test_abd_lookup.conf
78
79RES=$?
80
81# Cleanup properly
82gnunet-namestore -z a -d -n "a" -t ATTR -c test_abd_lookup.conf
83gnunet-namestore -z b -d -n "b" -t ATTR -c test_abd_lookup.conf
84gnunet-namestore -z g -d -n "g" -t ATTR -c test_abd_lookup.conf
85gnunet-namestore -z d -d -n "@" -t DEL -c test_abd_lookup.conf
86gnunet-namestore -z e -d -n "@" -t DEL -c test_abd_lookup.conf
87gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
88
89gnunet-arm -e -c test_abd_lookup.conf
90
91if [ "$RES" == 0 ]
92then
93 exit 0
94else
95 echo "FAIL: Failed to verify credential."
96 exit 1
97fi
98
diff --git a/src/abd/test_abd_bi_and2.sh b/src/abd/test_abd_bi_and2.sh
new file mode 100755
index 000000000..8d1601ef4
--- /dev/null
+++ b/src/abd/test_abd_bi_and2.sh
@@ -0,0 +1,94 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_abd_lookup.conf
23
24gnunet-identity -C a -c test_abd_lookup.conf
25gnunet-identity -C b -c test_abd_lookup.conf
26gnunet-identity -C c -c test_abd_lookup.conf
27gnunet-identity -C d -c test_abd_lookup.conf
28gnunet-identity -C e -c test_abd_lookup.conf
29gnunet-identity -C f -c test_abd_lookup.conf
30gnunet-identity -C g -c test_abd_lookup.conf
31gnunet-identity -C h -c test_abd_lookup.conf
32AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
33BKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep b | awk '{print $3}')
34CKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep c | awk '{print $3}')
35DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
36EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
37FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
38GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
39HKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep h | awk '{print $3}')
40gnunet-identity -d
41
42# (1) (A.a) <- B.b
43# (2) (B.b) <- C.c AND G.g
44# (3) C.c <- (D.D)
45# (4) D.d <- (E.e)
46# (5) E.e <- (F) priv
47# (6) G.g <- (F) priv
48
49# BIDIRECTIONAL
50gnunet-abd --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_abd_lookup.conf
51gnunet-namestore -D -z a
52gnunet-abd --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, $GKEY g" --ttl=5m -c test_abd_lookup.conf
53gnunet-namestore -D -z b
54
55SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
56gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
57gnunet-namestore -D -z d
58SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
59gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
60gnunet-namestore -D -z e
61SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
62gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
63gnunet-namestore -D -z f
64SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=g --attribute="g" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
65gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
66gnunet-namestore -D -z h
67
68# Starting to resolve
69echo "+++ Starting to Resolve +++"
70
71DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=f -c test_abd_lookup.conf | paste -d, -s - -`
72echo $DELS
73echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' -c test_abd_lookup.conf
74gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" -c test_abd_lookup.conf
75
76RES=$?
77
78# Cleanup properly
79gnunet-namestore -z a -d -n "a" -t ATTR -c test_abd_lookup.conf
80gnunet-namestore -z b -d -n "b" -t ATTR -c test_abd_lookup.conf
81gnunet-namestore -z d -d -n "@" -t DEL -c test_abd_lookup.conf
82gnunet-namestore -z e -d -n "@" -t DEL -c test_abd_lookup.conf
83gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
84
85gnunet-arm -e -c test_abd_lookup.conf
86
87if [ "$RES" == 0 ]
88then
89 exit 0
90else
91 echo "FAIL: Failed to verify credential."
92 exit 1
93fi
94
diff --git a/src/abd/test_abd_bi_and3.sh b/src/abd/test_abd_bi_and3.sh
new file mode 100755
index 000000000..cde2a020b
--- /dev/null
+++ b/src/abd/test_abd_bi_and3.sh
@@ -0,0 +1,96 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
21gnunet-arm -s -c test_abd_lookup.conf
22
23gnunet-identity -C a -c test_abd_lookup.conf
24gnunet-identity -C b -c test_abd_lookup.conf
25gnunet-identity -C c -c test_abd_lookup.conf
26gnunet-identity -C d -c test_abd_lookup.conf
27gnunet-identity -C e -c test_abd_lookup.conf
28gnunet-identity -C f -c test_abd_lookup.conf
29gnunet-identity -C g -c test_abd_lookup.conf
30gnunet-identity -C h -c test_abd_lookup.conf
31AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
38HKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep h | awk '{print $3}')
39gnunet-identity -d
40
41# (1) (A.a) <- B.b
42# (2) (B.b) <- C.c AND G.g
43# (3) C.c <- (D.d)
44# (4) D.d <- (E.e)
45# (5) E.e <- (F) priv
46# (6) G.g <- (H.h)
47# (7) H.h <- (F) priv
48
49# BIDIRECTIONAL
50gnunet-abd --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_abd_lookup.conf
51gnunet-namestore -D -z a
52gnunet-abd --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, $GKEY g" --ttl=5m -c test_abd_lookup.conf
53gnunet-namestore -D -z b
54
55SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
56gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
57gnunet-namestore -D -z d
58SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
59gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
60gnunet-namestore -D -z e
61SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=g --attribute="g" --subject="$HKEY h" --ttl="2019-12-12 10:00:00"`
62gnunet-abd --createSubjectSide --ego=h --import="$SIGNED"
63gnunet-namestore -D -z h
64SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
65gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
66SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=h --attribute="h" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
67gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
68gnunet-namestore -D -z f
69
70# Starting to resolve
71echo "+++ Starting to Resolve +++"
72
73DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=f -c test_abd_lookup.conf | paste -d, -s - -`
74echo $DELS
75echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' -c test_abd_lookup.conf
76gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" -c test_abd_lookup.conf
77
78RES=$?
79
80# Cleanup properly
81gnunet-namestore -z a -d -n "a" -t ATTR -c test_abd_lookup.conf
82gnunet-namestore -z b -d -n "b" -t ATTR -c test_abd_lookup.conf
83gnunet-namestore -z d -d -n "@" -t DEL -c test_abd_lookup.conf
84gnunet-namestore -z e -d -n "@" -t DEL -c test_abd_lookup.conf
85gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
86gnunet-namestore -z h -d -n "@" -t DEL -c test_abd_lookup.conf
87
88gnunet-arm -e -c test_abd_lookup.conf
89
90if [ "$RES" == 0 ]
91then
92 exit 0
93else
94 echo "FAIL: Failed to verify credential."
95 exit 1
96fi
diff --git a/src/abd/test_abd_bi_and4.sh b/src/abd/test_abd_bi_and4.sh
new file mode 100755
index 000000000..e8cd6efd6
--- /dev/null
+++ b/src/abd/test_abd_bi_and4.sh
@@ -0,0 +1,83 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_abd_lookup.conf
23
24gnunet-identity -C a -c test_abd_lookup.conf
25gnunet-identity -C b -c test_abd_lookup.conf
26gnunet-identity -C c -c test_abd_lookup.conf
27gnunet-identity -C d -c test_abd_lookup.conf
28gnunet-identity -C e -c test_abd_lookup.conf
29gnunet-identity -C f -c test_abd_lookup.conf
30gnunet-identity -C g -c test_abd_lookup.conf
31gnunet-identity -C h -c test_abd_lookup.conf
32AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
33BKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep b | awk '{print $3}')
34CKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep c | awk '{print $3}')
35DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
36EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
37FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
38GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
39HKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep h | awk '{print $3}')
40gnunet-identity -d
41
42# (1) (A.a) <- B.b
43# (2) (B.b) <- C.c AND G.g
44# (3) C.c <- (F) priv
45# (4) G.g <- (F) priv
46
47# BIDIRECTIONAL
48gnunet-abd --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_abd_lookup.conf
49gnunet-namestore -D -z a
50gnunet-abd --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, $GKEY g" --ttl=5m -c test_abd_lookup.conf
51gnunet-namestore -D -z b
52
53SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=g --attribute="g" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
54gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
55SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
56gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
57gnunet-namestore -D -z f
58
59# Starting to resolve
60echo "+++ Starting to Resolve +++"
61
62DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=f --backward -c test_abd_lookup.conf | paste -d, -s - -`
63echo $DELS
64echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --backward -c test_abd_lookup.conf
65gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --backward -c test_abd_lookup.conf
66
67RES=$?
68
69# Cleanup properly
70gnunet-namestore -z a -d -n "a" -t ATTR -c test_abd_lookup.conf
71gnunet-namestore -z b -d -n "b" -t ATTR -c test_abd_lookup.conf
72gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
73
74gnunet-arm -e -c test_abd_lookup.conf
75
76if [ "$RES" == 0 ]
77then
78 exit 0
79else
80 echo "FAIL: Failed to verify credential."
81 exit 1
82fi
83
diff --git a/src/abd/test_abd_bi_bw.sh b/src/abd/test_abd_bi_bw.sh
new file mode 100755
index 000000000..6b0e51722
--- /dev/null
+++ b/src/abd/test_abd_bi_bw.sh
@@ -0,0 +1,87 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_abd_lookup.conf
23
24gnunet-identity -C a -c test_abd_lookup.conf
25gnunet-identity -C b -c test_abd_lookup.conf
26gnunet-identity -C c -c test_abd_lookup.conf
27gnunet-identity -C d -c test_abd_lookup.conf
28gnunet-identity -C e -c test_abd_lookup.conf
29gnunet-identity -C f -c test_abd_lookup.conf
30gnunet-identity -C g -c test_abd_lookup.conf
31AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
38gnunet-identity -d
39
40# (1) (A.a) <- B.b
41# (2) (B.b) <- C.c
42# (3) C.c <- (D.D)
43# (4) D.d <- (E.e)
44# (5) E.e <- (F)
45
46# BIDIRECTIONAL
47gnunet-abd --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_abd_lookup.conf
48gnunet-namestore -D -z a
49gnunet-abd --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c" --ttl=5m -c test_abd_lookup.conf
50gnunet-namestore -D -z b
51
52SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
53gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
54gnunet-namestore -D -z d
55SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
56gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
57gnunet-namestore -D -z e
58SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
59gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
60gnunet-namestore -D -z f
61
62# Starting to resolve
63echo "+++ Starting to Resolve +++"
64
65DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=f --forward --backward -c test_abd_lookup.conf | paste -d, -s - -`
66echo $DELS
67echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --forward --backward -c test_abd_lookup.conf
68gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --forward --backward -c test_abd_lookup.conf
69
70RES=$?
71
72# Cleanup properly
73gnunet-namestore -z a -d -n "a" -t ATTR -c test_abd_lookup.conf
74gnunet-namestore -z b -d -n "b" -t ATTR -c test_abd_lookup.conf
75gnunet-namestore -z d -d -n "@" -t DEL -c test_abd_lookup.conf
76gnunet-namestore -z e -d -n "@" -t DEL -c test_abd_lookup.conf
77gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
78
79gnunet-arm -e -c test_abd_lookup.conf
80
81if [ "$RES" == 0 ]
82then
83 exit 0
84else
85 echo "FAIL: Failed to verify credential."
86 exit 1
87fi
diff --git a/src/abd/test_abd_bi_bw_link.sh b/src/abd/test_abd_bi_bw_link.sh
new file mode 100755
index 000000000..f60f78827
--- /dev/null
+++ b/src/abd/test_abd_bi_bw_link.sh
@@ -0,0 +1,92 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_abd_lookup.conf
23
24gnunet-identity -C a -c test_abd_lookup.conf
25gnunet-identity -C b -c test_abd_lookup.conf
26gnunet-identity -C c -c test_abd_lookup.conf
27gnunet-identity -C d -c test_abd_lookup.conf
28gnunet-identity -C e -c test_abd_lookup.conf
29gnunet-identity -C f -c test_abd_lookup.conf
30gnunet-identity -C g -c test_abd_lookup.conf
31AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
38gnunet-identity -d
39
40# (1) (A.a) <- B.b
41# (2) (B.b) <- G.g.c
42# (3) (G.g) <- C
43# (3) C.c <- (D.D)
44# (4) D.d <- (E.e)
45# (5) E.e <- (F)
46
47# BIDIRECTIONAL
48gnunet-abd --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_abd_lookup.conf
49gnunet-namestore -D -z a
50gnunet-abd --createIssuerSide --ego=b --attribute="b" --subject="$GKEY g.c" --ttl=5m -c test_abd_lookup.conf
51gnunet-namestore -D -z b
52gnunet-abd --createIssuerSide --ego=g --attribute="g" --subject="$CKEY" --ttl=5m -c test_abd_lookup.conf
53gnunet-namestore -D -z b
54
55SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
56gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
57gnunet-namestore -D -z d
58SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
59gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
60gnunet-namestore -D -z e
61SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
62gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
63gnunet-namestore -D -z f
64
65# Starting to resolve
66echo "+++ Starting to Resolve +++"
67
68DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=f --forward --backward -c test_abd_lookup.conf | paste -d, -s - -`
69echo $DELS
70echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --forward --backward -c test_abd_lookup.conf
71gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --forward --backward -c test_abd_lookup.conf
72
73RES=$?
74
75# Cleanup properly
76gnunet-namestore -z a -d -n "a" -t ATTR -c test_abd_lookup.conf
77gnunet-namestore -z b -d -n "b" -t ATTR -c test_abd_lookup.conf
78gnunet-namestore -z g -d -n "g" -t ATTR -c test_abd_lookup.conf
79gnunet-namestore -z d -d -n "@" -t DEL -c test_abd_lookup.conf
80gnunet-namestore -z e -d -n "@" -t DEL -c test_abd_lookup.conf
81gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
82
83gnunet-arm -e -c test_abd_lookup.conf
84
85if [ "$RES" == 0 ]
86then
87 exit 0
88else
89 echo "FAIL: Failed to verify credential."
90 exit 1
91fi
92
diff --git a/src/abd/test_abd_bi_bw_link2.sh b/src/abd/test_abd_bi_bw_link2.sh
new file mode 100755
index 000000000..b0fb49b8e
--- /dev/null
+++ b/src/abd/test_abd_bi_bw_link2.sh
@@ -0,0 +1,93 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_abd_lookup.conf
23
24gnunet-identity -C a -c test_abd_lookup.conf
25gnunet-identity -C b -c test_abd_lookup.conf
26gnunet-identity -C c -c test_abd_lookup.conf
27gnunet-identity -C d -c test_abd_lookup.conf
28gnunet-identity -C e -c test_abd_lookup.conf
29gnunet-identity -C f -c test_abd_lookup.conf
30gnunet-identity -C g -c test_abd_lookup.conf
31AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
38gnunet-identity -d
39
40# (1) (A.a) <- B.b
41# (2) (B.b) <- G.g.c
42# (3) G.g <- (C)
43# (3) C.c <- (D.d)
44# (4) D.d <- (E.e)
45# (5) E.e <- (F)
46
47# BIDIRECTIONAL
48gnunet-abd --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_abd_lookup.conf
49gnunet-namestore -D -z a
50gnunet-abd --createIssuerSide --ego=b --attribute="b" --subject="$GKEY g.c" --ttl=5m -c test_abd_lookup.conf
51gnunet-namestore -D -z b
52
53SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=g --attribute="g" --subject="$CKEY" --ttl="2019-12-12 10:00:00"`
54gnunet-abd --createSubjectSide --ego=c --import="$SIGNED"
55gnunet-namestore -D -z c
56SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
57gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
58gnunet-namestore -D -z d
59SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
60gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
61gnunet-namestore -D -z e
62SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
63gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
64gnunet-namestore -D -z f
65
66# Starting to resolve
67echo "+++ Starting to Resolve +++"
68
69DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=f --forward --backward -c test_abd_lookup.conf | paste -d, -s - -`
70echo $DELS
71echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --forward --backward -c test_abd_lookup.conf
72gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --forward --backward -c test_abd_lookup.conf
73
74RES=$?
75
76# Cleanup properly
77gnunet-namestore -z a -d -n "a" -t ATTR -c test_abd_lookup.conf
78gnunet-namestore -z b -d -n "b" -t ATTR -c test_abd_lookup.conf
79gnunet-namestore -z c -d -n "@" -t DEL -c test_abd_lookup.conf
80gnunet-namestore -z d -d -n "@" -t DEL -c test_abd_lookup.conf
81gnunet-namestore -z e -d -n "@" -t DEL -c test_abd_lookup.conf
82gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
83
84gnunet-arm -e -c test_abd_lookup.conf
85
86if [ "$RES" == 0 ]
87then
88 exit 0
89else
90 echo "FAIL: Failed to verify credential."
91 exit 1
92fi
93
diff --git a/src/abd/test_abd_bi_fw.sh b/src/abd/test_abd_bi_fw.sh
new file mode 100755
index 000000000..75a940fbe
--- /dev/null
+++ b/src/abd/test_abd_bi_fw.sh
@@ -0,0 +1,92 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_abd_lookup.conf
23
24gnunet-identity -C a -c test_abd_lookup.conf
25gnunet-identity -C b -c test_abd_lookup.conf
26gnunet-identity -C c -c test_abd_lookup.conf
27gnunet-identity -C d -c test_abd_lookup.conf
28gnunet-identity -C e -c test_abd_lookup.conf
29gnunet-identity -C f -c test_abd_lookup.conf
30gnunet-identity -C g -c test_abd_lookup.conf
31AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
38gnunet-identity -d
39
40# (1) (A.a) <- B.b
41# (2) (B.b) <- C.c
42# (3) C.c <- (D.D)
43# (4) D.d <- (E.e)
44# (5) E.e <- (F.f)
45# (6) F.f <- (G)
46
47# BIDIRECTIONAL
48gnunet-abd --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_abd_lookup.conf
49gnunet-namestore -D -z a
50gnunet-abd --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c" --ttl=5m -c test_abd_lookup.conf
51gnunet-namestore -D -z b
52
53SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
54gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
55gnunet-namestore -D -z d
56SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
57gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
58gnunet-namestore -D -z e
59SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" --subject="$FKEY f" --ttl="2019-12-12 10:00:00"`
60gnunet-abd --createSubjectSide --ego=f --import="$SIGNED"
61gnunet-namestore -D -z f
62SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=f --attribute="f" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
63gnunet-abd --createSubjectSide --ego=g --import="$SIGNED" --private
64gnunet-namestore -D -z g
65
66# Starting to resolve
67echo "+++ Starting to Resolve +++"
68
69DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=g --forward --backward -c test_abd_lookup.conf | paste -d, -s - -`
70echo $DELS
71echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate=\'$DELS\' --forward --backward -c test_abd_lookup.conf
72gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate="$DELS" --forward --backward -c test_abd_lookup.conf
73
74RES=$?
75
76# Cleanup properly
77gnunet-namestore -z a -d -n "a" -t ATTR -c test_abd_lookup.conf
78gnunet-namestore -z b -d -n "b" -t ATTR -c test_abd_lookup.conf
79gnunet-namestore -z d -d -n "@" -t DEL -c test_abd_lookup.conf
80gnunet-namestore -z e -d -n "@" -t DEL -c test_abd_lookup.conf
81gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
82gnunet-namestore -z g -d -n "@" -t DEL -c test_abd_lookup.conf
83
84gnunet-arm -e -c test_abd_lookup.conf
85
86if [ "$RES" == 0 ]
87then
88 exit 0
89else
90 echo "FAIL: Failed to verify credential."
91 exit 1
92fi
diff --git a/src/credential/test_credential_defaults.conf b/src/abd/test_abd_defaults.conf
index 39f82ad16..7b4cb576d 100644
--- a/src/credential/test_credential_defaults.conf
+++ b/src/abd/test_abd_defaults.conf
@@ -1,7 +1,7 @@
1@INLINE@ ../../contrib/conf/gnunet/no_forcestart.conf 1@INLINE@ ../../contrib/conf/gnunet/no_forcestart.conf
2 2
3[PATHS] 3[PATHS]
4GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-credential-testing/ 4GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-abd-testing/
5 5
6[namestore-sqlite] 6[namestore-sqlite]
7FILENAME = $GNUNET_TEST_HOME/namestore/sqlite_test.db 7FILENAME = $GNUNET_TEST_HOME/namestore/sqlite_test.db
diff --git a/src/abd/test_abd_issue.sh b/src/abd/test_abd_issue.sh
new file mode 100755
index 000000000..8076aa921
--- /dev/null
+++ b/src/abd/test_abd_issue.sh
@@ -0,0 +1,46 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_abd_lookup.conf
27gnunet-identity -C testissuer -c test_abd_lookup.conf
28gnunet-identity -C testsubject -c test_abd_lookup.conf
29SUBJECT_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep testsubject | awk '{print $3}')
30ISSUER_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep testissuer | awk '{print $3}')
31
32# Get abd and store it with subject (3)
33SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=testissuer --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf`
34
35STATUS=$?
36
37if test $? != 0
38then
39 echo "Error issuing..."
40 exit 1
41fi
42#Try import
43$DO_TIMEOUT gnunet-abd --createSubjectSide --ego=testsubject --import="$SIGNED" --private -c test_abd_lookup.conf
44RES=$?
45gnunet-arm -e -c test_abd_lookup.conf
46exit $RES
diff --git a/src/credential/test_credential_lookup.conf b/src/abd/test_abd_lookup.conf
index 9cd16605d..4072ba23b 100644
--- a/src/credential/test_credential_lookup.conf
+++ b/src/abd/test_abd_lookup.conf
@@ -1,7 +1,7 @@
1@INLINE@ test_credential_defaults.conf 1@INLINE@ test_abd_defaults.conf
2 2
3[PATHS] 3[PATHS]
4GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-credential-peer-1/ 4GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-abd-peer-1/
5 5
6[dht] 6[dht]
7START_ON_DEMAND = YES 7START_ON_DEMAND = YES
@@ -9,7 +9,7 @@ START_ON_DEMAND = YES
9[transport] 9[transport]
10PLUGINS = 10PLUGINS =
11 11
12[credential] 12[abd]
13START_ON_DEMAND = YES 13START_ON_DEMAND = YES
14#PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/credlog 14#PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/credlog
15 15
diff --git a/src/abd/test_abd_own.sh b/src/abd/test_abd_own.sh
new file mode 100755
index 000000000..f4780ea90
--- /dev/null
+++ b/src/abd/test_abd_own.sh
@@ -0,0 +1,140 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
21gnunet-arm -s -c test_abd_lookup.conf
22
23gnunet-identity -C a -c test_abd_lookup.conf
24gnunet-identity -C d -c test_abd_lookup.conf
25gnunet-identity -C e -c test_abd_lookup.conf
26gnunet-identity -C f -c test_abd_lookup.conf
27gnunet-identity -C g -c test_abd_lookup.conf
28AKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep a | awk '{print $3}')
29DKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep d | awk '{print $3}')
30EKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep e | awk '{print $3}')
31FKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep f | awk '{print $3}')
32GKEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep g | awk '{print $3}')
33
34############################################################################################
35# (1) EPub.discount <- EOrg.preferred
36# (2) EOrg.preferred <- StateU.student
37# (3) StateU.student <- RegistrarB.student
38# (4) RegistrarB.student <- Alice
39
40gnunet-identity -C epub -c test_abd_lookup.conf
41gnunet-identity -C eorg -c test_abd_lookup.conf
42gnunet-identity -C stateu -c test_abd_lookup.conf
43gnunet-identity -C registrarb -c test_abd_lookup.conf
44gnunet-identity -C alice -c test_abd_lookup.conf
45
46EPUB_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep epub | awk '{print $3}')
47EORG_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep eorg | awk '{print $3}')
48STATEU_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep stateu | awk '{print $3}')
49REGISTRARB_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep registrarb | awk '{print $3}')
50ALICE_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep alice | awk '{print $3}')
51
52
53DISC_ATTR="discount"
54PREF_ATTR="preferred"
55STATE_STUD_ATTR="student"
56REG_STUD_ATTR="student"
57END_ATTR="end"
58
59gnunet-identity -d
60
61# FORWARD, subject side stored (different constallations)
62SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"`
63gnunet-abd --createSubjectSide --ego=a --import="$SIGNED"
64gnunet-namestore -D -z a
65
66SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=a --attribute="b" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
67gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
68gnunet-namestore -D -z d
69
70SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" --subject="$EKEY" --ttl="2019-12-12 10:00:00"`
71gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
72gnunet-namestore -D -z e
73
74SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="c" --subject="$FKEY c" --ttl="2019-12-12 10:00:00"`
75gnunet-abd --createSubjectSide --ego=f --import="$SIGNED"
76SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="k" --subject="$FKEY c.k" --ttl="2019-12-12 10:00:00"`
77gnunet-abd --createSubjectSide --ego=f --import="$SIGNED"
78gnunet-namestore -D -z f
79
80SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=f --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
81gnunet-abd --createSubjectSide --ego=g --import="$SIGNED" --private
82SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=a --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
83gnunet-abd --createSubjectSide --ego=g --import="$SIGNED" --private
84SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="h.o" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
85gnunet-abd --createSubjectSide --ego=g --import="$SIGNED"
86gnunet-namestore -D -z g
87
88
89# BACKWARD, issuer side stored
90# (1) EPub assigns the attribute "discount" to all entities that have been assigned "preferred" by EOrg
91gnunet-abd --createIssuerSide --ego=epub --attribute=$DISC_ATTR --subject="$EORG_KEY $PREF_ATTR" --ttl=5m -c test_abd_lookup.conf
92
93# (2) EOrg assigns the attribute "preferred" to all entities that have been assigned "student" by StateU
94gnunet-abd --createIssuerSide --ego=eorg --attribute=$PREF_ATTR --subject="$STATEU_KEY $STATE_STUD_ATTR" --ttl=5m -c test_abd_lookup.conf
95
96# (3) StateU assigns the attribute "student" to all entities that have been asssigned "student" by RegistrarB
97gnunet-abd --createIssuerSide --ego=stateu --attribute=$STATE_STUD_ATTR --subject="$REGISTRARB_KEY $REG_STUD_ATTR" --ttl=5m -c test_abd_lookup.conf
98
99# (4) RegistrarB issues Alice the credential "student"
100SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"`
101gnunet-abd --createSubjectSide --ego=alice --import="$SIGNED" --private
102
103# Starting to resolve
104echo "+++ Starting to Resolve +++"
105
106# FORWARD
107#DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$AKEY --attribute="a" --ego=g --forward -c test_abd_lookup.conf | paste -d, -s - -`
108#echo $DELS
109#echo gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate=\'$DELS\' --forward -c test_abd_lookup.conf
110#RES_DELS=`gnunet-abd --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate="$DELS" --forward -c test_abd_lookup.conf`
111
112# BACKWARD
113DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_abd_lookup.conf | paste -d, -s - -`
114echo $DELS
115echo gnunet-abd --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_abd_lookup.conf
116gnunet-abd --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_abd_lookup.conf
117
118RES=$?
119
120# Cleanup properly
121gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_abd_lookup.conf
122gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_abd_lookup.conf
123gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_abd_lookup.conf
124#gnunet-namestore -z a -d -n "@" -t DEL -c test_abd_lookup.conf
125#gnunet-namestore -z d -d -n "@" -t DEL -c test_abd_lookup.conf
126#gnunet-namestore -z e -d -n "@" -t DEL -c test_abd_lookup.conf
127#gnunet-namestore -z f -d -n "@" -t DEL -c test_abd_lookup.conf
128#gnunet-namestore -z g -d -n "@" -t DEL -c test_abd_lookup.conf
129
130
131gnunet-arm -e -c test_abd_lookup.conf
132
133if [ "$RES" == 0 ]
134then
135 exit 0
136else
137 echo "FAIL: Failed to verify credential."
138 exit 1
139fi
140
diff --git a/src/abd/test_abd_verify.sh b/src/abd/test_abd_verify.sh
new file mode 100755
index 000000000..9ece91c62
--- /dev/null
+++ b/src/abd/test_abd_verify.sh
@@ -0,0 +1,87 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) Service.user -> GNU.project.member
19# (2) GNU.project -> GNUnet
20# (3) GNUnet.member -> GNUnet.developer
21# (4) GNUnet.member -> GNUnet.user
22# (5) GNUnet.developer -> Alice
23
24
25which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
26gnunet-arm -s -c test_abd_lookup.conf
27gnunet-identity -C service -c test_abd_lookup.conf
28gnunet-identity -C alice -c test_abd_lookup.conf
29gnunet-identity -C gnu -c test_abd_lookup.conf
30gnunet-identity -C gnunet -c test_abd_lookup.conf
31
32GNU_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep gnu | grep -v gnunet | awk '{print $3}')
33ALICE_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep alice | awk '{print $3}')
34GNUNET_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep gnunet | awk '{print $3}')
35SERVICE_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep service | awk '{print $3}')
36
37USER_ATTR="user"
38GNU_PROJECT_ATTR="project"
39MEMBER_ATTR="member"
40DEVELOPER_ATTR="developer"
41DEV_ATTR="developer"
42TEST_CREDENTIAL="mygnunetcreds"
43
44gnunet-identity -d
45
46# (1) A service assigns the attribute "user" to all entities that have been assigned "member" by entities that werde assigned "project" from GNU
47gnunet-abd --createIssuerSide --ego=service --attribute="$USER_ATTR" --subject="$GNU_KEY $GNU_PROJECT_ATTR.$MEMBER_ATTR" --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf
48gnunet-namestore -D -z service
49
50# (2) GNU recognized GNUnet as a GNU project and delegates the "project" attribute
51gnunet-abd --createIssuerSide --ego=gnu --attribute="$GNU_PROJECT_ATTR" --subject="$GNUNET_KEY" --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf
52gnunet-namestore -D -z gnu
53
54# (3+4) GNUnet assigns the attribute "member" to all entities gnunet has also assigned "developer" or "user"
55gnunet-abd --createIssuerSide --ego=gnunet --attribute="$MEMBER_ATTR" --subject="$GNUNET_KEY $DEVELOPER_ATTR" --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf
56gnunet-abd --createIssuerSide --ego=gnunet --attribute="$MEMBER_ATTR" --subject="$GNUNET_KEY $USER_ATTR" --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf
57gnunet-namestore -D -z gnunet
58
59# (5) GNUnet signes the delegate and Alice stores it
60SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=gnunet --attribute=$DEV_ATTR --subject=$ALICE_KEY --ttl="2019-12-12 10:00:00"`
61gnunet-abd --createSubjectSide --ego=alice --import="$SIGNED" --private
62gnunet-namestore -D -z alice
63
64# Starting to resolve
65echo "+++ Starting to Resolve +++"
66
67DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$SERVICE_KEY --attribute=$USER_ATTR --ego=alice --backward -c test_abd_lookup.conf | paste -d, -s - -`
68echo $DELS
69echo gnunet-abd --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_abd_lookup.conf
70gnunet-abd --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_abd_lookup.conf
71
72RES=$?
73
74# Cleanup properly
75gnunet-namestore -z alice -d -n "@" -t DEL -c test_abd_lookup.conf
76gnunet-namestore -z gnu -d -n $GNU_PROJECT_ATTR -t ATTR -c test_abd_lookup.conf
77gnunet-namestore -z gnunet -d -n $MEMBER_ATTR -t ATTR -c test_abd_lookup.conf
78gnunet-namestore -z service -d -n $USER_ATTR -t ATTR -c test_abd_lookup.conf
79gnunet-arm -e -c test_abd_lookup.conf
80
81if [ "$RES" == 0 ]
82then
83 exit 0
84else
85 echo "FAIL: Failed to verify credential."
86 exit 1
87fi
diff --git a/src/abd/test_abd_verify_and.sh b/src/abd/test_abd_verify_and.sh
new file mode 100755
index 000000000..c6287055e
--- /dev/null
+++ b/src/abd/test_abd_verify_and.sh
@@ -0,0 +1,86 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) Service.user -> GNU.project.member
19# (2) GNU.project -> GNUnet
20# (3) GNUnet.member -> GNUnet.developer AND GNUnet.user
21# (4) GNUnet.developer -> Alice
22
23
24which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
25gnunet-arm -s -c test_abd_lookup.conf
26gnunet-identity -C service -c test_abd_lookup.conf
27gnunet-identity -C alice -c test_abd_lookup.conf
28gnunet-identity -C gnu -c test_abd_lookup.conf
29gnunet-identity -C gnunet -c test_abd_lookup.conf
30
31GNU_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep gnu | grep -v gnunet | awk '{print $3}')
32ALICE_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep alice | awk '{print $3}')
33GNUNET_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep gnunet | awk '{print $3}')
34SERVICE_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep service | awk '{print $3}')
35
36USER_ATTR="user"
37GNU_PROJECT_ATTR="project"
38MEMBER_ATTR="member"
39DEVELOPER_ATTR="developer"
40DEV_ATTR="developer"
41
42gnunet-identity -d
43
44# (1) A service assigns the attribute "user" to all entities that have been assigned "member" by entities that werde assigned "project" from GNU
45gnunet-abd --createIssuerSide --ego=service --attribute="$USER_ATTR" --subject="$GNU_KEY $GNU_PROJECT_ATTR.$MEMBER_ATTR" --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf
46gnunet-namestore -D -z service
47
48# (2) GNU recognized GNUnet as a GNU project and delegates the "project" attribute
49gnunet-abd --createIssuerSide --ego=gnu --attribute="$GNU_PROJECT_ATTR" --subject="$GNUNET_KEY" --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf
50gnunet-namestore -D -z gnu
51
52# (3+4) GNUnet assigns the attribute "member" to all entities gnunet has also assigned "developer" or "user"
53gnunet-abd --createIssuerSide --ego=gnunet --attribute="$MEMBER_ATTR" --subject="$GNUNET_KEY $DEVELOPER_ATTR, $GNUNET_KEY $USER_ATTR" --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf
54gnunet-namestore -D -z gnunet
55
56# (5) GNUnet signes the delegates and Alice stores it
57SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=gnunet --attribute=$DEV_ATTR --subject=$ALICE_KEY --ttl="2019-12-12 10:00:00"`
58gnunet-abd --createSubjectSide --ego=alice --import="$SIGNED" --private
59SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=gnunet --attribute=$USER_ATTR --subject=$ALICE_KEY --ttl="2019-12-12 10:00:00"`
60gnunet-abd --createSubjectSide --ego=alice --import="$SIGNED" --private
61gnunet-namestore -D -z alice
62
63# Starting to resolve
64echo "+++ Starting to Resolve +++"
65
66DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$SERVICE_KEY --attribute=$USER_ATTR --ego=alice --backward -c test_abd_lookup.conf | paste -d, -s - -`
67echo $DELS
68echo gnunet-abd --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_abd_lookup.conf
69gnunet-abd --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_abd_lookup.conf
70
71RES=$?
72
73# Cleanup properly
74gnunet-namestore -z alice -d -n "@" -t DEL -c test_abd_lookup.conf
75gnunet-namestore -z gnu -d -n $GNU_PROJECT_ATTR -t ATTR -c test_abd_lookup.conf
76gnunet-namestore -z gnunet -d -n $MEMBER_ATTR -t ATTR -c test_abd_lookup.conf
77gnunet-namestore -z service -d -n $USER_ATTR -t ATTR -c test_abd_lookup.conf
78gnunet-arm -e -c test_abd_lookup.conf
79
80if [ "$RES" == 0 ]
81then
82 exit 0
83else
84 echo "FAIL: Failed to verify credentials."
85 exit 1
86fi
diff --git a/src/abd/test_abd_verify_simple.sh b/src/abd/test_abd_verify_simple.sh
new file mode 100755
index 000000000..e917f8793
--- /dev/null
+++ b/src/abd/test_abd_verify_simple.sh
@@ -0,0 +1,56 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_abd_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_abd_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) Issuer.user -> Subject
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
22gnunet-arm -s -c test_abd_lookup.conf
23gnunet-identity -C testissuer -c test_abd_lookup.conf
24gnunet-identity -C testsubject -c test_abd_lookup.conf
25
26TEST_ATTR="user"
27SUBJECT_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep testsubject | awk '{print $3}')
28ISSUER_KEY=$(gnunet-identity -d -c test_abd_lookup.conf | grep testissuer | awk '{print $3}')
29
30gnunet-identity -d
31
32# Create delegate (1)
33SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=testissuer --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --ttl="2019-12-12 10:00:00" -c test_abd_lookup.conf`
34gnunet-abd --createSubjectSide --ego=testsubject --import="$SIGNED" --private
35gnunet-namestore -D -z testsubject
36
37# Starting to resolve
38echo "+++ Starting to Resolve +++"
39
40DELS=`$DO_TIMEOUT gnunet-abd --collect --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --ego=testsubject -c test_abd_lookup.conf | paste -d, -s - -`
41echo $DELS
42gnunet-abd --verify --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --delegate="$DELS" -c test_abd_lookup.conf
43
44RES=$?
45
46# Cleanup properly
47gnunet-namestore -z testsubject -d -n "@" -t DEL -c test_abd_lookup.conf
48gnunet-arm -e -c test_abd_lookup.conf
49
50if [ "$RES" == 0 ]
51then
52 exit 0
53else
54 echo "FAIL: Failed to verify credential."
55 exit 1
56fi \ No newline at end of file
diff --git a/src/credential/test_credential_collect.sh b/src/abd/test_credential_collect.sh
index 0ae063eda..0ae063eda 100755
--- a/src/credential/test_credential_collect.sh
+++ b/src/abd/test_credential_collect.sh
diff --git a/src/credential/test_credential_collect_rest.sh b/src/abd/test_credential_collect_rest.sh
index fe59d9399..fe59d9399 100755
--- a/src/credential/test_credential_collect_rest.sh
+++ b/src/abd/test_credential_collect_rest.sh
diff --git a/src/credential/test_credential_issue_rest.sh b/src/abd/test_credential_issue_rest.sh
index c518c08ec..c518c08ec 100755
--- a/src/credential/test_credential_issue_rest.sh
+++ b/src/abd/test_credential_issue_rest.sh
diff --git a/src/credential/test_credential_verify_rest.sh b/src/abd/test_credential_verify_rest.sh
index 99db5da8a..99db5da8a 100755
--- a/src/credential/test_credential_verify_rest.sh
+++ b/src/abd/test_credential_verify_rest.sh
diff --git a/src/credential/credential.conf.in b/src/credential/credential.conf.in
deleted file mode 100644
index d5a0b1c88..000000000
--- a/src/credential/credential.conf.in
+++ /dev/null
@@ -1,5 +0,0 @@
1[credential]
2BINARY = gnunet-service-credential
3UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-credential.sock
4RUN_PER_USER = YES
5OPTIONS = -L DEBUG
diff --git a/src/credential/test_credential_bi_and.sh b/src/credential/test_credential_bi_and.sh
deleted file mode 100755
index d52fb5dbe..000000000
--- a/src/credential/test_credential_bi_and.sh
+++ /dev/null
@@ -1,98 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_credential_lookup.conf
23
24gnunet-identity -C a -c test_credential_lookup.conf
25gnunet-identity -C b -c test_credential_lookup.conf
26gnunet-identity -C c -c test_credential_lookup.conf
27gnunet-identity -C d -c test_credential_lookup.conf
28gnunet-identity -C e -c test_credential_lookup.conf
29gnunet-identity -C f -c test_credential_lookup.conf
30gnunet-identity -C g -c test_credential_lookup.conf
31gnunet-identity -C h -c test_credential_lookup.conf
32AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
33BKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep b | awk '{print $3}')
34CKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep c | awk '{print $3}')
35DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
36EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
37FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
38GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
39HKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep h | awk '{print $3}')
40gnunet-identity -d
41
42# (1) (A.a) <- B.b
43# (2) (B.b) <- C.c AND G.g
44# (3) C.c <- (D.D)
45# (4) D.d <- (E.e)
46# (5) E.e <- (F) priv
47# (6) (G.g) <- H.h
48# (7) H.h <- (F) priv
49
50# BIDIRECTIONAL
51gnunet-credential --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_credential_lookup.conf
52gnunet-namestore -D -z a
53gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, $GKEY g" --ttl=5m -c test_credential_lookup.conf
54gnunet-namestore -D -z b
55gnunet-credential --createIssuerSide --ego=g --attribute="g" --subject="$HKEY h" --ttl=5m -c test_credential_lookup.conf
56gnunet-namestore -D -z b
57
58SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
59gnunet-credential --createSubjectSide --ego=d --import="$SIGNED"
60gnunet-namestore -D -z d
61SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
62gnunet-credential --createSubjectSide --ego=e --import="$SIGNED"
63gnunet-namestore -D -z e
64SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
65gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
66gnunet-namestore -D -z f
67SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=h --attribute="h" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
68gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
69gnunet-namestore -D -z h
70
71# Starting to resolve
72echo "+++ Starting to Resolve +++"
73
74DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=f --forward --backward -c test_credential_lookup.conf | paste -d, -s - -`
75echo $DELS
76echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --forward --backward -c test_credential_lookup.conf
77gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --forward --backward -c test_credential_lookup.conf
78
79RES=$?
80
81# Cleanup properly
82gnunet-namestore -z a -d -n "a" -t ATTR -c test_credential_lookup.conf
83gnunet-namestore -z b -d -n "b" -t ATTR -c test_credential_lookup.conf
84gnunet-namestore -z g -d -n "g" -t ATTR -c test_credential_lookup.conf
85gnunet-namestore -z d -d -n "@" -t DEL -c test_credential_lookup.conf
86gnunet-namestore -z e -d -n "@" -t DEL -c test_credential_lookup.conf
87gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
88
89gnunet-arm -e -c test_credential_lookup.conf
90
91if [ "$RES" == 0 ]
92then
93 exit 0
94else
95 echo "FAIL: Failed to verify credential."
96 exit 1
97fi
98
diff --git a/src/credential/test_credential_bi_and2.sh b/src/credential/test_credential_bi_and2.sh
deleted file mode 100755
index f076c1c5c..000000000
--- a/src/credential/test_credential_bi_and2.sh
+++ /dev/null
@@ -1,94 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_credential_lookup.conf
23
24gnunet-identity -C a -c test_credential_lookup.conf
25gnunet-identity -C b -c test_credential_lookup.conf
26gnunet-identity -C c -c test_credential_lookup.conf
27gnunet-identity -C d -c test_credential_lookup.conf
28gnunet-identity -C e -c test_credential_lookup.conf
29gnunet-identity -C f -c test_credential_lookup.conf
30gnunet-identity -C g -c test_credential_lookup.conf
31gnunet-identity -C h -c test_credential_lookup.conf
32AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
33BKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep b | awk '{print $3}')
34CKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep c | awk '{print $3}')
35DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
36EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
37FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
38GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
39HKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep h | awk '{print $3}')
40gnunet-identity -d
41
42# (1) (A.a) <- B.b
43# (2) (B.b) <- C.c AND G.g
44# (3) C.c <- (D.D)
45# (4) D.d <- (E.e)
46# (5) E.e <- (F) priv
47# (6) G.g <- (F) priv
48
49# BIDIRECTIONAL
50gnunet-credential --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_credential_lookup.conf
51gnunet-namestore -D -z a
52gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, $GKEY g" --ttl=5m -c test_credential_lookup.conf
53gnunet-namestore -D -z b
54
55SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
56gnunet-credential --createSubjectSide --ego=d --import="$SIGNED"
57gnunet-namestore -D -z d
58SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
59gnunet-credential --createSubjectSide --ego=e --import="$SIGNED"
60gnunet-namestore -D -z e
61SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
62gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
63gnunet-namestore -D -z f
64SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=g --attribute="g" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
65gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
66gnunet-namestore -D -z h
67
68# Starting to resolve
69echo "+++ Starting to Resolve +++"
70
71DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=f -c test_credential_lookup.conf | paste -d, -s - -`
72echo $DELS
73echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' -c test_credential_lookup.conf
74gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" -c test_credential_lookup.conf
75
76RES=$?
77
78# Cleanup properly
79gnunet-namestore -z a -d -n "a" -t ATTR -c test_credential_lookup.conf
80gnunet-namestore -z b -d -n "b" -t ATTR -c test_credential_lookup.conf
81gnunet-namestore -z d -d -n "@" -t DEL -c test_credential_lookup.conf
82gnunet-namestore -z e -d -n "@" -t DEL -c test_credential_lookup.conf
83gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
84
85gnunet-arm -e -c test_credential_lookup.conf
86
87if [ "$RES" == 0 ]
88then
89 exit 0
90else
91 echo "FAIL: Failed to verify credential."
92 exit 1
93fi
94
diff --git a/src/credential/test_credential_bi_and3.sh b/src/credential/test_credential_bi_and3.sh
deleted file mode 100755
index 80dddcc14..000000000
--- a/src/credential/test_credential_bi_and3.sh
+++ /dev/null
@@ -1,96 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
21gnunet-arm -s -c test_credential_lookup.conf
22
23gnunet-identity -C a -c test_credential_lookup.conf
24gnunet-identity -C b -c test_credential_lookup.conf
25gnunet-identity -C c -c test_credential_lookup.conf
26gnunet-identity -C d -c test_credential_lookup.conf
27gnunet-identity -C e -c test_credential_lookup.conf
28gnunet-identity -C f -c test_credential_lookup.conf
29gnunet-identity -C g -c test_credential_lookup.conf
30gnunet-identity -C h -c test_credential_lookup.conf
31AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
38HKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep h | awk '{print $3}')
39gnunet-identity -d
40
41# (1) (A.a) <- B.b
42# (2) (B.b) <- C.c AND G.g
43# (3) C.c <- (D.d)
44# (4) D.d <- (E.e)
45# (5) E.e <- (F) priv
46# (6) G.g <- (H.h)
47# (7) H.h <- (F) priv
48
49# BIDIRECTIONAL
50gnunet-credential --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_credential_lookup.conf
51gnunet-namestore -D -z a
52gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, $GKEY g" --ttl=5m -c test_credential_lookup.conf
53gnunet-namestore -D -z b
54
55SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
56gnunet-credential --createSubjectSide --ego=d --import="$SIGNED"
57gnunet-namestore -D -z d
58SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
59gnunet-credential --createSubjectSide --ego=e --import="$SIGNED"
60gnunet-namestore -D -z e
61SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=g --attribute="g" --subject="$HKEY h" --ttl="2019-12-12 10:00:00"`
62gnunet-credential --createSubjectSide --ego=h --import="$SIGNED"
63gnunet-namestore -D -z h
64SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
65gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
66SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=h --attribute="h" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
67gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
68gnunet-namestore -D -z f
69
70# Starting to resolve
71echo "+++ Starting to Resolve +++"
72
73DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=f -c test_credential_lookup.conf | paste -d, -s - -`
74echo $DELS
75echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' -c test_credential_lookup.conf
76gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" -c test_credential_lookup.conf
77
78RES=$?
79
80# Cleanup properly
81gnunet-namestore -z a -d -n "a" -t ATTR -c test_credential_lookup.conf
82gnunet-namestore -z b -d -n "b" -t ATTR -c test_credential_lookup.conf
83gnunet-namestore -z d -d -n "@" -t DEL -c test_credential_lookup.conf
84gnunet-namestore -z e -d -n "@" -t DEL -c test_credential_lookup.conf
85gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
86gnunet-namestore -z h -d -n "@" -t DEL -c test_credential_lookup.conf
87
88gnunet-arm -e -c test_credential_lookup.conf
89
90if [ "$RES" == 0 ]
91then
92 exit 0
93else
94 echo "FAIL: Failed to verify credential."
95 exit 1
96fi
diff --git a/src/credential/test_credential_bi_and4.sh b/src/credential/test_credential_bi_and4.sh
deleted file mode 100755
index 18731d5d1..000000000
--- a/src/credential/test_credential_bi_and4.sh
+++ /dev/null
@@ -1,83 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_credential_lookup.conf
23
24gnunet-identity -C a -c test_credential_lookup.conf
25gnunet-identity -C b -c test_credential_lookup.conf
26gnunet-identity -C c -c test_credential_lookup.conf
27gnunet-identity -C d -c test_credential_lookup.conf
28gnunet-identity -C e -c test_credential_lookup.conf
29gnunet-identity -C f -c test_credential_lookup.conf
30gnunet-identity -C g -c test_credential_lookup.conf
31gnunet-identity -C h -c test_credential_lookup.conf
32AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
33BKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep b | awk '{print $3}')
34CKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep c | awk '{print $3}')
35DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
36EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
37FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
38GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
39HKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep h | awk '{print $3}')
40gnunet-identity -d
41
42# (1) (A.a) <- B.b
43# (2) (B.b) <- C.c AND G.g
44# (3) C.c <- (F) priv
45# (4) G.g <- (F) priv
46
47# BIDIRECTIONAL
48gnunet-credential --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_credential_lookup.conf
49gnunet-namestore -D -z a
50gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c, $GKEY g" --ttl=5m -c test_credential_lookup.conf
51gnunet-namestore -D -z b
52
53SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=g --attribute="g" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
54gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
55SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
56gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
57gnunet-namestore -D -z f
58
59# Starting to resolve
60echo "+++ Starting to Resolve +++"
61
62DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=f --backward -c test_credential_lookup.conf | paste -d, -s - -`
63echo $DELS
64echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf
65gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --backward -c test_credential_lookup.conf
66
67RES=$?
68
69# Cleanup properly
70gnunet-namestore -z a -d -n "a" -t ATTR -c test_credential_lookup.conf
71gnunet-namestore -z b -d -n "b" -t ATTR -c test_credential_lookup.conf
72gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
73
74gnunet-arm -e -c test_credential_lookup.conf
75
76if [ "$RES" == 0 ]
77then
78 exit 0
79else
80 echo "FAIL: Failed to verify credential."
81 exit 1
82fi
83
diff --git a/src/credential/test_credential_bi_bw.sh b/src/credential/test_credential_bi_bw.sh
deleted file mode 100755
index 618fae95f..000000000
--- a/src/credential/test_credential_bi_bw.sh
+++ /dev/null
@@ -1,87 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_credential_lookup.conf
23
24gnunet-identity -C a -c test_credential_lookup.conf
25gnunet-identity -C b -c test_credential_lookup.conf
26gnunet-identity -C c -c test_credential_lookup.conf
27gnunet-identity -C d -c test_credential_lookup.conf
28gnunet-identity -C e -c test_credential_lookup.conf
29gnunet-identity -C f -c test_credential_lookup.conf
30gnunet-identity -C g -c test_credential_lookup.conf
31AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
38gnunet-identity -d
39
40# (1) (A.a) <- B.b
41# (2) (B.b) <- C.c
42# (3) C.c <- (D.D)
43# (4) D.d <- (E.e)
44# (5) E.e <- (F)
45
46# BIDIRECTIONAL
47gnunet-credential --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_credential_lookup.conf
48gnunet-namestore -D -z a
49gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c" --ttl=5m -c test_credential_lookup.conf
50gnunet-namestore -D -z b
51
52SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
53gnunet-credential --createSubjectSide --ego=d --import="$SIGNED"
54gnunet-namestore -D -z d
55SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
56gnunet-credential --createSubjectSide --ego=e --import="$SIGNED"
57gnunet-namestore -D -z e
58SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
59gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
60gnunet-namestore -D -z f
61
62# Starting to resolve
63echo "+++ Starting to Resolve +++"
64
65DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=f --forward --backward -c test_credential_lookup.conf | paste -d, -s - -`
66echo $DELS
67echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --forward --backward -c test_credential_lookup.conf
68gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --forward --backward -c test_credential_lookup.conf
69
70RES=$?
71
72# Cleanup properly
73gnunet-namestore -z a -d -n "a" -t ATTR -c test_credential_lookup.conf
74gnunet-namestore -z b -d -n "b" -t ATTR -c test_credential_lookup.conf
75gnunet-namestore -z d -d -n "@" -t DEL -c test_credential_lookup.conf
76gnunet-namestore -z e -d -n "@" -t DEL -c test_credential_lookup.conf
77gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
78
79gnunet-arm -e -c test_credential_lookup.conf
80
81if [ "$RES" == 0 ]
82then
83 exit 0
84else
85 echo "FAIL: Failed to verify credential."
86 exit 1
87fi
diff --git a/src/credential/test_credential_bi_bw_link.sh b/src/credential/test_credential_bi_bw_link.sh
deleted file mode 100755
index f002c2141..000000000
--- a/src/credential/test_credential_bi_bw_link.sh
+++ /dev/null
@@ -1,92 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_credential_lookup.conf
23
24gnunet-identity -C a -c test_credential_lookup.conf
25gnunet-identity -C b -c test_credential_lookup.conf
26gnunet-identity -C c -c test_credential_lookup.conf
27gnunet-identity -C d -c test_credential_lookup.conf
28gnunet-identity -C e -c test_credential_lookup.conf
29gnunet-identity -C f -c test_credential_lookup.conf
30gnunet-identity -C g -c test_credential_lookup.conf
31AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
38gnunet-identity -d
39
40# (1) (A.a) <- B.b
41# (2) (B.b) <- G.g.c
42# (3) (G.g) <- C
43# (3) C.c <- (D.D)
44# (4) D.d <- (E.e)
45# (5) E.e <- (F)
46
47# BIDIRECTIONAL
48gnunet-credential --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_credential_lookup.conf
49gnunet-namestore -D -z a
50gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$GKEY g.c" --ttl=5m -c test_credential_lookup.conf
51gnunet-namestore -D -z b
52gnunet-credential --createIssuerSide --ego=g --attribute="g" --subject="$CKEY" --ttl=5m -c test_credential_lookup.conf
53gnunet-namestore -D -z b
54
55SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
56gnunet-credential --createSubjectSide --ego=d --import="$SIGNED"
57gnunet-namestore -D -z d
58SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
59gnunet-credential --createSubjectSide --ego=e --import="$SIGNED"
60gnunet-namestore -D -z e
61SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
62gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
63gnunet-namestore -D -z f
64
65# Starting to resolve
66echo "+++ Starting to Resolve +++"
67
68DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=f --forward --backward -c test_credential_lookup.conf | paste -d, -s - -`
69echo $DELS
70echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --forward --backward -c test_credential_lookup.conf
71gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --forward --backward -c test_credential_lookup.conf
72
73RES=$?
74
75# Cleanup properly
76gnunet-namestore -z a -d -n "a" -t ATTR -c test_credential_lookup.conf
77gnunet-namestore -z b -d -n "b" -t ATTR -c test_credential_lookup.conf
78gnunet-namestore -z g -d -n "g" -t ATTR -c test_credential_lookup.conf
79gnunet-namestore -z d -d -n "@" -t DEL -c test_credential_lookup.conf
80gnunet-namestore -z e -d -n "@" -t DEL -c test_credential_lookup.conf
81gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
82
83gnunet-arm -e -c test_credential_lookup.conf
84
85if [ "$RES" == 0 ]
86then
87 exit 0
88else
89 echo "FAIL: Failed to verify credential."
90 exit 1
91fi
92
diff --git a/src/credential/test_credential_bi_bw_link2.sh b/src/credential/test_credential_bi_bw_link2.sh
deleted file mode 100755
index f6055a7bb..000000000
--- a/src/credential/test_credential_bi_bw_link2.sh
+++ /dev/null
@@ -1,93 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_credential_lookup.conf
23
24gnunet-identity -C a -c test_credential_lookup.conf
25gnunet-identity -C b -c test_credential_lookup.conf
26gnunet-identity -C c -c test_credential_lookup.conf
27gnunet-identity -C d -c test_credential_lookup.conf
28gnunet-identity -C e -c test_credential_lookup.conf
29gnunet-identity -C f -c test_credential_lookup.conf
30gnunet-identity -C g -c test_credential_lookup.conf
31AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
38gnunet-identity -d
39
40# (1) (A.a) <- B.b
41# (2) (B.b) <- G.g.c
42# (3) G.g <- (C)
43# (3) C.c <- (D.d)
44# (4) D.d <- (E.e)
45# (5) E.e <- (F)
46
47# BIDIRECTIONAL
48gnunet-credential --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_credential_lookup.conf
49gnunet-namestore -D -z a
50gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$GKEY g.c" --ttl=5m -c test_credential_lookup.conf
51gnunet-namestore -D -z b
52
53SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=g --attribute="g" --subject="$CKEY" --ttl="2019-12-12 10:00:00"`
54gnunet-credential --createSubjectSide --ego=c --import="$SIGNED"
55gnunet-namestore -D -z c
56SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
57gnunet-credential --createSubjectSide --ego=d --import="$SIGNED"
58gnunet-namestore -D -z d
59SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
60gnunet-credential --createSubjectSide --ego=e --import="$SIGNED"
61gnunet-namestore -D -z e
62SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY" --ttl="2019-12-12 10:00:00"`
63gnunet-credential --createSubjectSide --ego=f --import="$SIGNED" --private
64gnunet-namestore -D -z f
65
66# Starting to resolve
67echo "+++ Starting to Resolve +++"
68
69DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=f --forward --backward -c test_credential_lookup.conf | paste -d, -s - -`
70echo $DELS
71echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate=\'$DELS\' --forward --backward -c test_credential_lookup.conf
72gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$FKEY --delegate="$DELS" --forward --backward -c test_credential_lookup.conf
73
74RES=$?
75
76# Cleanup properly
77gnunet-namestore -z a -d -n "a" -t ATTR -c test_credential_lookup.conf
78gnunet-namestore -z b -d -n "b" -t ATTR -c test_credential_lookup.conf
79gnunet-namestore -z c -d -n "@" -t DEL -c test_credential_lookup.conf
80gnunet-namestore -z d -d -n "@" -t DEL -c test_credential_lookup.conf
81gnunet-namestore -z e -d -n "@" -t DEL -c test_credential_lookup.conf
82gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
83
84gnunet-arm -e -c test_credential_lookup.conf
85
86if [ "$RES" == 0 ]
87then
88 exit 0
89else
90 echo "FAIL: Failed to verify credential."
91 exit 1
92fi
93
diff --git a/src/credential/test_credential_bi_fw.sh b/src/credential/test_credential_bi_fw.sh
deleted file mode 100755
index 7cd5e5c52..000000000
--- a/src/credential/test_credential_bi_fw.sh
+++ /dev/null
@@ -1,92 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
22gnunet-arm -s -c test_credential_lookup.conf
23
24gnunet-identity -C a -c test_credential_lookup.conf
25gnunet-identity -C b -c test_credential_lookup.conf
26gnunet-identity -C c -c test_credential_lookup.conf
27gnunet-identity -C d -c test_credential_lookup.conf
28gnunet-identity -C e -c test_credential_lookup.conf
29gnunet-identity -C f -c test_credential_lookup.conf
30gnunet-identity -C g -c test_credential_lookup.conf
31AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
32BKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep b | awk '{print $3}')
33CKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep c | awk '{print $3}')
34DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
35EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
36FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
37GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
38gnunet-identity -d
39
40# (1) (A.a) <- B.b
41# (2) (B.b) <- C.c
42# (3) C.c <- (D.D)
43# (4) D.d <- (E.e)
44# (5) E.e <- (F.f)
45# (6) F.f <- (G)
46
47# BIDIRECTIONAL
48gnunet-credential --createIssuerSide --ego=a --attribute="a" --subject="$BKEY b" --ttl=5m -c test_credential_lookup.conf
49gnunet-namestore -D -z a
50gnunet-credential --createIssuerSide --ego=b --attribute="b" --subject="$CKEY c" --ttl=5m -c test_credential_lookup.conf
51gnunet-namestore -D -z b
52
53SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=c --attribute="c" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
54gnunet-credential --createSubjectSide --ego=d --import="$SIGNED"
55gnunet-namestore -D -z d
56SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
57gnunet-credential --createSubjectSide --ego=e --import="$SIGNED"
58gnunet-namestore -D -z e
59SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="e" --subject="$FKEY f" --ttl="2019-12-12 10:00:00"`
60gnunet-credential --createSubjectSide --ego=f --import="$SIGNED"
61gnunet-namestore -D -z f
62SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=f --attribute="f" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
63gnunet-credential --createSubjectSide --ego=g --import="$SIGNED" --private
64gnunet-namestore -D -z g
65
66# Starting to resolve
67echo "+++ Starting to Resolve +++"
68
69DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g --forward --backward -c test_credential_lookup.conf | paste -d, -s - -`
70echo $DELS
71echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate=\'$DELS\' --forward --backward -c test_credential_lookup.conf
72gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate="$DELS" --forward --backward -c test_credential_lookup.conf
73
74RES=$?
75
76# Cleanup properly
77gnunet-namestore -z a -d -n "a" -t ATTR -c test_credential_lookup.conf
78gnunet-namestore -z b -d -n "b" -t ATTR -c test_credential_lookup.conf
79gnunet-namestore -z d -d -n "@" -t DEL -c test_credential_lookup.conf
80gnunet-namestore -z e -d -n "@" -t DEL -c test_credential_lookup.conf
81gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
82gnunet-namestore -z g -d -n "@" -t DEL -c test_credential_lookup.conf
83
84gnunet-arm -e -c test_credential_lookup.conf
85
86if [ "$RES" == 0 ]
87then
88 exit 0
89else
90 echo "FAIL: Failed to verify credential."
91 exit 1
92fi
diff --git a/src/credential/test_credential_issue.sh b/src/credential/test_credential_issue.sh
deleted file mode 100755
index 3d4b82cf6..000000000
--- a/src/credential/test_credential_issue.sh
+++ /dev/null
@@ -1,46 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_credential_lookup.conf
27gnunet-identity -C testissuer -c test_credential_lookup.conf
28gnunet-identity -C testsubject -c test_credential_lookup.conf
29SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}')
30ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}')
31
32# Get credential and store it with subject (3)
33SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=testissuer --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf`
34
35STATUS=$?
36
37if test $? != 0
38then
39 echo "Error issuing..."
40 exit 1
41fi
42#Try import
43$DO_TIMEOUT gnunet-credential --createSubjectSide --ego=testsubject --import="$SIGNED" --private -c test_credential_lookup.conf
44RES=$?
45gnunet-arm -e -c test_credential_lookup.conf
46exit $RES
diff --git a/src/credential/test_credential_own.sh b/src/credential/test_credential_own.sh
deleted file mode 100755
index 8a94f90e7..000000000
--- a/src/credential/test_credential_own.sh
+++ /dev/null
@@ -1,140 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18
19
20which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 10"
21gnunet-arm -s -c test_credential_lookup.conf
22
23gnunet-identity -C a -c test_credential_lookup.conf
24gnunet-identity -C d -c test_credential_lookup.conf
25gnunet-identity -C e -c test_credential_lookup.conf
26gnunet-identity -C f -c test_credential_lookup.conf
27gnunet-identity -C g -c test_credential_lookup.conf
28AKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep a | awk '{print $3}')
29DKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep d | awk '{print $3}')
30EKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep e | awk '{print $3}')
31FKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep f | awk '{print $3}')
32GKEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep g | awk '{print $3}')
33
34############################################################################################
35# (1) EPub.discount <- EOrg.preferred
36# (2) EOrg.preferred <- StateU.student
37# (3) StateU.student <- RegistrarB.student
38# (4) RegistrarB.student <- Alice
39
40gnunet-identity -C epub -c test_credential_lookup.conf
41gnunet-identity -C eorg -c test_credential_lookup.conf
42gnunet-identity -C stateu -c test_credential_lookup.conf
43gnunet-identity -C registrarb -c test_credential_lookup.conf
44gnunet-identity -C alice -c test_credential_lookup.conf
45
46EPUB_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep epub | awk '{print $3}')
47EORG_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep eorg | awk '{print $3}')
48STATEU_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep stateu | awk '{print $3}')
49REGISTRARB_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep registrarb | awk '{print $3}')
50ALICE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep alice | awk '{print $3}')
51
52
53DISC_ATTR="discount"
54PREF_ATTR="preferred"
55STATE_STUD_ATTR="student"
56REG_STUD_ATTR="student"
57END_ATTR="end"
58
59gnunet-identity -d
60
61# FORWARD, subject side stored (different constallations)
62SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="a" --subject="$AKEY b.c" --ttl="2019-12-12 10:00:00"`
63gnunet-credential --createSubjectSide --ego=a --import="$SIGNED"
64gnunet-namestore -D -z a
65
66SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="b" --subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
67gnunet-credential --createSubjectSide --ego=d --import="$SIGNED"
68gnunet-namestore -D -z d
69
70SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="d" --subject="$EKEY" --ttl="2019-12-12 10:00:00"`
71gnunet-credential --createSubjectSide --ego=e --import="$SIGNED"
72gnunet-namestore -D -z e
73
74SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="c" --subject="$FKEY c" --ttl="2019-12-12 10:00:00"`
75gnunet-credential --createSubjectSide --ego=f --import="$SIGNED"
76SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=e --attribute="k" --subject="$FKEY c.k" --ttl="2019-12-12 10:00:00"`
77gnunet-credential --createSubjectSide --ego=f --import="$SIGNED"
78gnunet-namestore -D -z f
79
80SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=f --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
81gnunet-credential --createSubjectSide --ego=g --import="$SIGNED" --private
82SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=a --attribute="c" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
83gnunet-credential --createSubjectSide --ego=g --import="$SIGNED" --private
84SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=d --attribute="h.o" --subject="$GKEY" --ttl="2019-12-12 10:00:00"`
85gnunet-credential --createSubjectSide --ego=g --import="$SIGNED"
86gnunet-namestore -D -z g
87
88
89# BACKWARD, issuer side stored
90# (1) EPub assigns the attribute "discount" to all entities that have been assigned "preferred" by EOrg
91gnunet-credential --createIssuerSide --ego=epub --attribute=$DISC_ATTR --subject="$EORG_KEY $PREF_ATTR" --ttl=5m -c test_credential_lookup.conf
92
93# (2) EOrg assigns the attribute "preferred" to all entities that have been assigned "student" by StateU
94gnunet-credential --createIssuerSide --ego=eorg --attribute=$PREF_ATTR --subject="$STATEU_KEY $STATE_STUD_ATTR" --ttl=5m -c test_credential_lookup.conf
95
96# (3) StateU assigns the attribute "student" to all entities that have been asssigned "student" by RegistrarB
97gnunet-credential --createIssuerSide --ego=stateu --attribute=$STATE_STUD_ATTR --subject="$REGISTRARB_KEY $REG_STUD_ATTR" --ttl=5m -c test_credential_lookup.conf
98
99# (4) RegistrarB issues Alice the credential "student"
100SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=registrarb --attribute="$REG_STUD_ATTR" --subject="$ALICE_KEY" --ttl="2019-12-12 10:00:00"`
101gnunet-credential --createSubjectSide --ego=alice --import="$SIGNED" --private
102
103# Starting to resolve
104echo "+++ Starting to Resolve +++"
105
106# FORWARD
107#DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$AKEY --attribute="a" --ego=g --forward -c test_credential_lookup.conf | paste -d, -s - -`
108#echo $DELS
109#echo gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate=\'$DELS\' --forward -c test_credential_lookup.conf
110#RES_DELS=`gnunet-credential --verify --issuer=$AKEY --attribute="a" --subject=$GKEY --delegate="$DELS" --forward -c test_credential_lookup.conf`
111
112# BACKWARD
113DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$EPUB_KEY --attribute=$DISC_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s - -`
114echo $DELS
115echo gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf
116gnunet-credential --verify --issuer=$EPUB_KEY --attribute=$DISC_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_credential_lookup.conf
117
118RES=$?
119
120# Cleanup properly
121gnunet-namestore -z epub -d -n $DISC_ATTR -t ATTR -c test_credential_lookup.conf
122gnunet-namestore -z eorg -d -n $PREF_ATTR -t ATTR -c test_credential_lookup.conf
123gnunet-namestore -z stateu -d -n $STATE_STUD_ATTR -t ATTR -c test_credential_lookup.conf
124#gnunet-namestore -z a -d -n "@" -t DEL -c test_credential_lookup.conf
125#gnunet-namestore -z d -d -n "@" -t DEL -c test_credential_lookup.conf
126#gnunet-namestore -z e -d -n "@" -t DEL -c test_credential_lookup.conf
127#gnunet-namestore -z f -d -n "@" -t DEL -c test_credential_lookup.conf
128#gnunet-namestore -z g -d -n "@" -t DEL -c test_credential_lookup.conf
129
130
131gnunet-arm -e -c test_credential_lookup.conf
132
133if [ "$RES" == 0 ]
134then
135 exit 0
136else
137 echo "FAIL: Failed to verify credential."
138 exit 1
139fi
140
diff --git a/src/credential/test_credential_verify.sh b/src/credential/test_credential_verify.sh
deleted file mode 100755
index 38492de8e..000000000
--- a/src/credential/test_credential_verify.sh
+++ /dev/null
@@ -1,87 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) Service.user -> GNU.project.member
19# (2) GNU.project -> GNUnet
20# (3) GNUnet.member -> GNUnet.developer
21# (4) GNUnet.member -> GNUnet.user
22# (5) GNUnet.developer -> Alice
23
24
25which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
26gnunet-arm -s -c test_credential_lookup.conf
27gnunet-identity -C service -c test_credential_lookup.conf
28gnunet-identity -C alice -c test_credential_lookup.conf
29gnunet-identity -C gnu -c test_credential_lookup.conf
30gnunet-identity -C gnunet -c test_credential_lookup.conf
31
32GNU_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep gnu | grep -v gnunet | awk '{print $3}')
33ALICE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep alice | awk '{print $3}')
34GNUNET_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep gnunet | awk '{print $3}')
35SERVICE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep service | awk '{print $3}')
36
37USER_ATTR="user"
38GNU_PROJECT_ATTR="project"
39MEMBER_ATTR="member"
40DEVELOPER_ATTR="developer"
41DEV_ATTR="developer"
42TEST_CREDENTIAL="mygnunetcreds"
43
44gnunet-identity -d
45
46# (1) A service assigns the attribute "user" to all entities that have been assigned "member" by entities that werde assigned "project" from GNU
47gnunet-credential --createIssuerSide --ego=service --attribute="$USER_ATTR" --subject="$GNU_KEY $GNU_PROJECT_ATTR.$MEMBER_ATTR" --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf
48gnunet-namestore -D -z service
49
50# (2) GNU recognized GNUnet as a GNU project and delegates the "project" attribute
51gnunet-credential --createIssuerSide --ego=gnu --attribute="$GNU_PROJECT_ATTR" --subject="$GNUNET_KEY" --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf
52gnunet-namestore -D -z gnu
53
54# (3+4) GNUnet assigns the attribute "member" to all entities gnunet has also assigned "developer" or "user"
55gnunet-credential --createIssuerSide --ego=gnunet --attribute="$MEMBER_ATTR" --subject="$GNUNET_KEY $DEVELOPER_ATTR" --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf
56gnunet-credential --createIssuerSide --ego=gnunet --attribute="$MEMBER_ATTR" --subject="$GNUNET_KEY $USER_ATTR" --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf
57gnunet-namestore -D -z gnunet
58
59# (5) GNUnet signes the delegate and Alice stores it
60SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=gnunet --attribute=$DEV_ATTR --subject=$ALICE_KEY --ttl="2019-12-12 10:00:00"`
61gnunet-credential --createSubjectSide --ego=alice --import="$SIGNED" --private
62gnunet-namestore -D -z alice
63
64# Starting to resolve
65echo "+++ Starting to Resolve +++"
66
67DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$SERVICE_KEY --attribute=$USER_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s - -`
68echo $DELS
69echo gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf
70gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_credential_lookup.conf
71
72RES=$?
73
74# Cleanup properly
75gnunet-namestore -z alice -d -n "@" -t DEL -c test_credential_lookup.conf
76gnunet-namestore -z gnu -d -n $GNU_PROJECT_ATTR -t ATTR -c test_credential_lookup.conf
77gnunet-namestore -z gnunet -d -n $MEMBER_ATTR -t ATTR -c test_credential_lookup.conf
78gnunet-namestore -z service -d -n $USER_ATTR -t ATTR -c test_credential_lookup.conf
79gnunet-arm -e -c test_credential_lookup.conf
80
81if [ "$RES" == 0 ]
82then
83 exit 0
84else
85 echo "FAIL: Failed to verify credential."
86 exit 1
87fi
diff --git a/src/credential/test_credential_verify_and.sh b/src/credential/test_credential_verify_and.sh
deleted file mode 100755
index 3a2852dc6..000000000
--- a/src/credential/test_credential_verify_and.sh
+++ /dev/null
@@ -1,87 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) Service.user -> GNU.project.member
19# (2) GNU.project -> GNUnet
20# (3) GNUnet.member -> GNUnet.developer AND GNUnet.user
21# (4) GNUnet.developer -> Alice
22
23
24which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
25gnunet-arm -s -c test_credential_lookup.conf
26gnunet-identity -C service -c test_credential_lookup.conf
27gnunet-identity -C alice -c test_credential_lookup.conf
28gnunet-identity -C gnu -c test_credential_lookup.conf
29gnunet-identity -C gnunet -c test_credential_lookup.conf
30
31GNU_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep gnu | grep -v gnunet | awk '{print $3}')
32ALICE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep alice | awk '{print $3}')
33GNUNET_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep gnunet | awk '{print $3}')
34SERVICE_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep service | awk '{print $3}')
35
36USER_ATTR="user"
37GNU_PROJECT_ATTR="project"
38MEMBER_ATTR="member"
39DEVELOPER_ATTR="developer"
40DEV_ATTR="developer"
41TEST_CREDENTIAL="mygnunetcreds"
42
43gnunet-identity -d
44
45# (1) A service assigns the attribute "user" to all entities that have been assigned "member" by entities that werde assigned "project" from GNU
46gnunet-credential --createIssuerSide --ego=service --attribute="$USER_ATTR" --subject="$GNU_KEY $GNU_PROJECT_ATTR.$MEMBER_ATTR" --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf
47gnunet-namestore -D -z service
48
49# (2) GNU recognized GNUnet as a GNU project and delegates the "project" attribute
50gnunet-credential --createIssuerSide --ego=gnu --attribute="$GNU_PROJECT_ATTR" --subject="$GNUNET_KEY" --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf
51gnunet-namestore -D -z gnu
52
53# (3+4) GNUnet assigns the attribute "member" to all entities gnunet has also assigned "developer" or "user"
54gnunet-credential --createIssuerSide --ego=gnunet --attribute="$MEMBER_ATTR" --subject="$GNUNET_KEY $DEVELOPER_ATTR, $GNUNET_KEY $USER_ATTR" --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf
55gnunet-namestore -D -z gnunet
56
57# (5) GNUnet signes the delegates and Alice stores it
58SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=gnunet --attribute=$DEV_ATTR --subject=$ALICE_KEY --ttl="2019-12-12 10:00:00"`
59gnunet-credential --createSubjectSide --ego=alice --import="$SIGNED" --private
60SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=gnunet --attribute=$USER_ATTR --subject=$ALICE_KEY --ttl="2019-12-12 10:00:00"`
61gnunet-credential --createSubjectSide --ego=alice --import="$SIGNED" --private
62gnunet-namestore -D -z alice
63
64# Starting to resolve
65echo "+++ Starting to Resolve +++"
66
67DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$SERVICE_KEY --attribute=$USER_ATTR --ego=alice --backward -c test_credential_lookup.conf | paste -d, -s - -`
68echo $DELS
69echo gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate=\'$DELS\' --backward -c test_credential_lookup.conf
70gnunet-credential --verify --issuer=$SERVICE_KEY --attribute=$USER_ATTR --subject=$ALICE_KEY --delegate="$DELS" --backward -c test_credential_lookup.conf
71
72RES=$?
73
74# Cleanup properly
75gnunet-namestore -z alice -d -n "@" -t DEL -c test_credential_lookup.conf
76gnunet-namestore -z gnu -d -n $GNU_PROJECT_ATTR -t ATTR -c test_credential_lookup.conf
77gnunet-namestore -z gnunet -d -n $MEMBER_ATTR -t ATTR -c test_credential_lookup.conf
78gnunet-namestore -z service -d -n $USER_ATTR -t ATTR -c test_credential_lookup.conf
79gnunet-arm -e -c test_credential_lookup.conf
80
81if [ "$RES" == 0 ]
82then
83 exit 0
84else
85 echo "FAIL: Failed to verify credential $RES_CRED."
86 exit 1
87fi
diff --git a/src/credential/test_credential_verify_simple.sh b/src/credential/test_credential_verify_simple.sh
deleted file mode 100755
index 3a3b0832b..000000000
--- a/src/credential/test_credential_verify_simple.sh
+++ /dev/null
@@ -1,56 +0,0 @@
1#!/usr/bin/env bash
2trap "gnunet-arm -e -c test_credential_lookup.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_credential_lookup.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) Issuer.user -> Subject
19
20
21which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
22gnunet-arm -s -c test_credential_lookup.conf
23gnunet-identity -C testissuer -c test_credential_lookup.conf
24gnunet-identity -C testsubject -c test_credential_lookup.conf
25
26TEST_ATTR="user"
27SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testsubject | awk '{print $3}')
28ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep testissuer | awk '{print $3}')
29
30gnunet-identity -d
31
32# Create delegate (1)
33SIGNED=`$DO_TIMEOUT gnunet-credential --signSubjectSide --ego=testissuer --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --ttl="2019-12-12 10:00:00" -c test_credential_lookup.conf`
34gnunet-credential --createSubjectSide --ego=testsubject --import="$SIGNED" --private
35gnunet-namestore -D -z testsubject
36
37# Starting to resolve
38echo "+++ Starting to Resolve +++"
39
40DELS=`$DO_TIMEOUT gnunet-credential --collect --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --ego=testsubject -c test_credential_lookup.conf | paste -d, -s - -`
41echo $DELS
42gnunet-credential --verify --issuer=$ISSUER_KEY --attribute=$TEST_ATTR --subject=$SUBJECT_KEY --delegate="$DELS" -c test_credential_lookup.conf
43
44RES=$?
45
46# Cleanup properly
47gnunet-namestore -z testsubject -d -n "@" -t DEL -c test_credential_lookup.conf
48gnunet-arm -e -c test_credential_lookup.conf
49
50if [ "$RES" == 0 ]
51then
52 exit 0
53else
54 echo "FAIL: Failed to verify credential."
55 exit 1
56fi \ No newline at end of file
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 9e0813425..c81f8e7d8 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -23,6 +23,7 @@ else
23gnunetinclude_HEADERS = \ 23gnunetinclude_HEADERS = \
24 platform.h gettext.h \ 24 platform.h gettext.h \
25 compat.h \ 25 compat.h \
26 gnunet_abd_service.h \
26 gnunet_applications.h \ 27 gnunet_applications.h \
27 gnunet_arm_service.h \ 28 gnunet_arm_service.h \
28 gnunet_ats_service.h \ 29 gnunet_ats_service.h \
@@ -42,7 +43,6 @@ gnunetinclude_HEADERS = \
42 gnunet_container_lib.h \ 43 gnunet_container_lib.h \
43 gnunet_conversation_service.h \ 44 gnunet_conversation_service.h \
44 gnunet_core_service.h \ 45 gnunet_core_service.h \
45 gnunet_credential_service.h \
46 gnunet_crypto_lib.h \ 46 gnunet_crypto_lib.h \
47 gnunet_curl_lib.h \ 47 gnunet_curl_lib.h \
48 gnunet_datacache_lib.h \ 48 gnunet_datacache_lib.h \
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_abd_service.h
index 325296ecc..b50ff8b86 100644
--- a/src/include/gnunet_credential_service.h
+++ b/src/include/gnunet_abd_service.h
@@ -24,13 +24,13 @@
24 * @file 24 * @file
25 * API to the Credential service 25 * API to the Credential service
26 * 26 *
27 * @defgroup credential Credential service 27 * @defgroup abd Credential service
28 * Credentials 28 * Credentials
29 * 29 *
30 * @{ 30 * @{
31 */ 31 */
32#ifndef GNUNET_CREDENTIAL_SERVICE_H 32#ifndef GNUNET_ABD_SERVICE_H
33#define GNUNET_CREDENTIAL_SERVICE_H 33#define GNUNET_ABD_SERVICE_H
34 34
35#include "gnunet_util_lib.h" 35#include "gnunet_util_lib.h"
36#include "gnunet_gns_service.h" 36#include "gnunet_gns_service.h"
@@ -48,26 +48,26 @@ extern "C"
48/** 48/**
49 * Connection to the Credential service. 49 * Connection to the Credential service.
50 */ 50 */
51struct GNUNET_CREDENTIAL_Handle; 51struct GNUNET_ABD_Handle;
52 52
53/** 53/**
54 * Handle to control a lookup operation. 54 * Handle to control a lookup operation.
55 */ 55 */
56struct GNUNET_CREDENTIAL_Request; 56struct GNUNET_ABD_Request;
57 57
58/* 58/*
59* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject 59* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
60*/ 60*/
61enum GNUNET_CREDENTIAL_CredentialFlags { 61enum GNUNET_ABD_CredentialFlags {
62 62
63 //Subject had credentials before, but have been revoked now 63 //Subject had credentials before, but have been revoked now
64 GNUNET_CREDENTIAL_FLAG_REVOKED=0, 64 GNUNET_ABD_FLAG_REVOKED=0,
65 65
66 //Subject flag indicates that the subject is a holder of this credential and may present it as such 66 //Subject flag indicates that the subject is a holder of this credential and may present it as such
67 GNUNET_CREDENTIAL_FLAG_SUBJECT=1, 67 GNUNET_ABD_FLAG_SUBJECT=1,
68 68
69 //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance 69 //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
70 GNUNET_CREDENTIAL_FLAG_ISSUER=2 70 GNUNET_ABD_FLAG_ISSUER=2
71 71
72}; 72};
73 73
@@ -75,7 +75,7 @@ GNUNET_NETWORK_STRUCT_BEGIN
75/** 75/**
76 * The attribute delegation record 76 * The attribute delegation record
77 */ 77 */
78struct GNUNET_CREDENTIAL_DelegationRecord { 78struct GNUNET_ABD_DelegationRecord {
79 79
80 /** 80 /**
81 * Number of delegation sets in this record 81 * Number of delegation sets in this record
@@ -95,7 +95,7 @@ struct GNUNET_CREDENTIAL_DelegationRecord {
95/** 95/**
96 * The attribute delegation record 96 * The attribute delegation record
97 */ 97 */
98struct GNUNET_CREDENTIAL_DelegationRecordSet { 98struct GNUNET_ABD_DelegationRecordSet {
99 99
100 /** 100 /**
101 * Public key of the subject this attribute was delegated to 101 * Public key of the subject this attribute was delegated to
@@ -114,7 +114,7 @@ GNUNET_NETWORK_STRUCT_END
114/** 114/**
115 * The attribute delegation record 115 * The attribute delegation record
116 */ 116 */
117struct GNUNET_CREDENTIAL_DelegationSet { 117struct GNUNET_ABD_DelegationSet {
118 118
119 /** 119 /**
120 * Public key of the subject this attribute was delegated to 120 * Public key of the subject this attribute was delegated to
@@ -133,7 +133,7 @@ struct GNUNET_CREDENTIAL_DelegationSet {
133/** 133/**
134 * A delegation 134 * A delegation
135 */ 135 */
136struct GNUNET_CREDENTIAL_Delegation { 136struct GNUNET_ABD_Delegation {
137 137
138 /** 138 /**
139 * The issuer of the delegation 139 * The issuer of the delegation
@@ -170,7 +170,7 @@ struct GNUNET_CREDENTIAL_Delegation {
170/** 170/**
171 * A delegate 171 * A delegate
172 */ 172 */
173struct GNUNET_CREDENTIAL_Delegate { 173struct GNUNET_ABD_Delegate {
174 174
175 /** 175 /**
176 * The issuer of the credential 176 * The issuer of the credential
@@ -217,13 +217,13 @@ struct GNUNET_CREDENTIAL_Delegate {
217/* 217/*
218* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject 218* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
219*/ 219*/
220enum GNUNET_CREDENTIAL_AlgoDirectionFlags { 220enum GNUNET_ABD_AlgoDirectionFlags {
221 221
222 //Subject had credentials before, but have been revoked now 222 //Subject had credentials before, but have been revoked now
223 GNUNET_CREDENTIAL_FLAG_FORWARD=1 << 0, 223 GNUNET_ABD_FLAG_FORWARD=1 << 0,
224 224
225 //Subject flag indicates that the subject is a holder of this credential and may present it as such 225 //Subject flag indicates that the subject is a holder of this credential and may present it as such
226 GNUNET_CREDENTIAL_FLAG_BACKWARD=1 << 1 226 GNUNET_ABD_FLAG_BACKWARD=1 << 1
227 227
228}; 228};
229 229
@@ -233,8 +233,8 @@ enum GNUNET_CREDENTIAL_AlgoDirectionFlags {
233 * @param cfg configuration to use 233 * @param cfg configuration to use
234 * @return handle to the Credential service, or NULL on error 234 * @return handle to the Credential service, or NULL on error
235 */ 235 */
236struct GNUNET_CREDENTIAL_Handle * 236struct GNUNET_ABD_Handle *
237GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); 237GNUNET_ABD_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
238 238
239 239
240/** 240/**
@@ -243,7 +243,7 @@ GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
243 * @param handle connection to shut down 243 * @param handle connection to shut down
244 */ 244 */
245void 245void
246GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle); 246GNUNET_ABD_disconnect (struct GNUNET_ABD_Handle *handle);
247 247
248 248
249/** 249/**
@@ -252,17 +252,17 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle);
252 * @param cls closure 252 * @param cls closure
253 * @param d_count the number of delegations processed 253 * @param d_count the number of delegations processed
254 * @param delegation_chain the delegations processed 254 * @param delegation_chain the delegations processed
255 * @param c_count the number of credentials found 255 * @param c_count the number of delegates found
256 * @param credential the credentials 256 * @param delegate the delegates
257 */ 257 */
258typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls, 258typedef void (*GNUNET_ABD_CredentialResultProcessor) (void *cls,
259 unsigned int d_count, 259 unsigned int d_count,
260 struct GNUNET_CREDENTIAL_Delegation *delegation_chain, 260 struct GNUNET_ABD_Delegation *delegation_chain,
261 unsigned int c_count, 261 unsigned int c_count,
262 struct GNUNET_CREDENTIAL_Delegate *delegte); 262 struct GNUNET_ABD_Delegate *delegte);
263 263
264typedef void (*GNUNET_CREDENTIAL_IntermediateResultProcessor) (void *cls, 264typedef void (*GNUNET_ABD_IntermediateResultProcessor) (void *cls,
265 struct GNUNET_CREDENTIAL_Delegation *delegation, 265 struct GNUNET_ABD_Delegation *delegation,
266 bool is_bw); 266 bool is_bw);
267 267
268/** 268/**
@@ -272,7 +272,7 @@ typedef void (*GNUNET_CREDENTIAL_IntermediateResultProcessor) (void *cls,
272 * @param success GNUNET_YES if successful 272 * @param success GNUNET_YES if successful
273 * @param result the record data that can be handed to the subject 273 * @param result the record data that can be handed to the subject
274 */ 274 */
275typedef void (*GNUNET_CREDENTIAL_DelegateResultProcessor) (void *cls, 275typedef void (*GNUNET_ABD_DelegateResultProcessor) (void *cls,
276 uint32_t success); 276 uint32_t success);
277 277
278/** 278/**
@@ -282,7 +282,7 @@ typedef void (*GNUNET_CREDENTIAL_DelegateResultProcessor) (void *cls,
282 * @param success GNUNET_YES if successful 282 * @param success GNUNET_YES if successful
283 * @param result the record data that can be handed to the subject 283 * @param result the record data that can be handed to the subject
284 */ 284 */
285typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls, 285typedef void (*GNUNET_ABD_RemoveDelegateResultProcessor) (void *cls,
286 uint32_t success); 286 uint32_t success);
287 287
288 288
@@ -298,34 +298,34 @@ typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls,
298 * @param issuer_key the issuer public key 298 * @param issuer_key the issuer public key
299 * @param issuer_attribute the issuer attribute 299 * @param issuer_attribute the issuer attribute
300 * @param subject_key the subject public key 300 * @param subject_key the subject public key
301 * @param credential_count number of credentials 301 * @param delegate_count number of delegates
302 * @param credentials the subject credentials 302 * @param delegates the subject delegates
303 * @param proc function to call on result 303 * @param proc function to call on result
304 * @param proc_cls closure for processor 304 * @param proc_cls closure for processor
305 * @return handle to the queued request 305 * @return handle to the queued request
306 */ 306 */
307struct GNUNET_CREDENTIAL_Request* 307struct GNUNET_ABD_Request*
308GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, 308GNUNET_ABD_verify (struct GNUNET_ABD_Handle *handle,
309 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 309 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
310 const char *issuer_attribute, 310 const char *issuer_attribute,
311 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, 311 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
312 uint32_t credential_count, 312 uint32_t delegate_count,
313 const struct GNUNET_CREDENTIAL_Delegate *delegates, 313 const struct GNUNET_ABD_Delegate *delegates,
314 enum GNUNET_CREDENTIAL_AlgoDirectionFlags direction, 314 enum GNUNET_ABD_AlgoDirectionFlags direction,
315 GNUNET_CREDENTIAL_CredentialResultProcessor proc, 315 GNUNET_ABD_CredentialResultProcessor proc,
316 void *proc_cls, 316 void *proc_cls,
317 GNUNET_CREDENTIAL_IntermediateResultProcessor, 317 GNUNET_ABD_IntermediateResultProcessor,
318 void *proc2_cls); 318 void *proc2_cls);
319 319
320struct GNUNET_CREDENTIAL_Request* 320struct GNUNET_ABD_Request*
321GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, 321GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle,
322 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 322 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
323 const char *issuer_attribute, 323 const char *issuer_attribute,
324 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, 324 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
325 enum GNUNET_CREDENTIAL_AlgoDirectionFlags direction, 325 enum GNUNET_ABD_AlgoDirectionFlags direction,
326 GNUNET_CREDENTIAL_CredentialResultProcessor proc, 326 GNUNET_ABD_CredentialResultProcessor proc,
327 void *proc_cls, 327 void *proc_cls,
328 GNUNET_CREDENTIAL_IntermediateResultProcessor, 328 GNUNET_ABD_IntermediateResultProcessor,
329 void *proc2_cls); 329 void *proc2_cls);
330 330
331/** 331/**
@@ -340,13 +340,13 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle,
340 * @param proc_cls the result closure context 340 * @param proc_cls the result closure context
341 * @return handle to the queued request 341 * @return handle to the queued request
342 */ 342 */
343struct GNUNET_CREDENTIAL_Request * 343struct GNUNET_ABD_Request *
344GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle, 344GNUNET_ABD_add_delegation (struct GNUNET_ABD_Handle *handle,
345 struct GNUNET_IDENTITY_Ego *issuer, 345 struct GNUNET_IDENTITY_Ego *issuer,
346 const char *attribute, 346 const char *attribute,
347 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 347 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
348 const char *delegated_attribute, 348 const char *delegated_attribute,
349 GNUNET_CREDENTIAL_DelegateResultProcessor proc, 349 GNUNET_ABD_DelegateResultProcessor proc,
350 void *proc_cls); 350 void *proc_cls);
351 351
352/** 352/**
@@ -359,11 +359,11 @@ GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
359 * @param proc_cls callback closure 359 * @param proc_cls callback closure
360 * @return handle to the queued request 360 * @return handle to the queued request
361 */ 361 */
362struct GNUNET_CREDENTIAL_Request * 362struct GNUNET_ABD_Request *
363GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, 363GNUNET_ABD_remove_delegation (struct GNUNET_ABD_Handle *handle,
364 struct GNUNET_IDENTITY_Ego *issuer, 364 struct GNUNET_IDENTITY_Ego *issuer,
365 const char *attribute, 365 const char *attribute,
366 GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc, 366 GNUNET_ABD_RemoveDelegateResultProcessor proc,
367 void *proc_cls); 367 void *proc_cls);
368 368
369 369
@@ -377,8 +377,8 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
377 * @param expiration the TTL of the credential 377 * @param expiration the TTL of the credential
378 * @return handle to the queued request 378 * @return handle to the queued request
379 */ 379 */
380struct GNUNET_CREDENTIAL_Delegate* 380struct GNUNET_ABD_Delegate*
381GNUNET_CREDENTIAL_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, 381GNUNET_ABD_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
382 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 382 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
383 const char *iss_attr, 383 const char *iss_attr,
384 const char *sub_attr, 384 const char *sub_attr,
@@ -391,7 +391,7 @@ GNUNET_CREDENTIAL_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *is
391 * @param lr the lookup request to cancel 391 * @param lr the lookup request to cancel
392 */ 392 */
393void 393void
394GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr); 394GNUNET_ABD_request_cancel (struct GNUNET_ABD_Request *lr);
395 395
396 396
397#if 0 /* keep Emacsens' auto-indent happy */ 397#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h
index ea91f9eb9..3a49d98b9 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -107,9 +107,8 @@ extern "C" {
107 */ 107 */
108 108
109/** 109/**
110 * Record type for credential 110 * 65547 deleted, free to use
111 */ 111 */
112#define GNUNET_GNSRECORD_TYPE_CREDENTIAL 65547
113 112
114/** 113/**
115 * Record type for policies 114 * Record type for policies
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 4ca1ad47a..cd7cb50de 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -2716,17 +2716,17 @@ extern "C" {
2716 2716
2717/************************************************** 2717/**************************************************
2718 * 2718 *
2719 * CREDENTIAL MESSAGE TYPES 2719 * ABD MESSAGE TYPES
2720 */ 2720 */
2721#define GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY 981 2721#define GNUNET_MESSAGE_TYPE_ABD_VERIFY 981
2722 2722
2723#define GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT 982 2723#define GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT 982
2724 2724
2725#define GNUNET_MESSAGE_TYPE_CREDENTIAL_COLLECT 983 2725#define GNUNET_MESSAGE_TYPE_ABD_COLLECT 983
2726 2726
2727#define GNUNET_MESSAGE_TYPE_CREDENTIAL_COLLECT_RESULT 984 2727#define GNUNET_MESSAGE_TYPE_ABD_COLLECT_RESULT 984
2728 2728
2729#define GNUNET_MESSAGE_TYPE_CREDENTIAL_INTERMEDIATE_RESULT 985 2729#define GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT 985
2730 2730
2731/******************************************************************************/ 2731/******************************************************************************/
2732 2732