diff options
author | Tristan Schwieren <tristan.schwieren@tum.de> | 2022-01-10 16:50:30 +0100 |
---|---|---|
committer | Tristan Schwieren <tristan.schwieren@tum.de> | 2022-01-10 16:50:30 +0100 |
commit | 0923829e896d2f06a5cbd488fc899b6455d29454 (patch) | |
tree | 299bd30c3ff909c76da6b9f873d92ae9bce89707 | |
parent | 54eea8dc8c714db6d518068213d5da6e1df6e1a6 (diff) | |
download | gnunet-0923829e896d2f06a5cbd488fc899b6455d29454.tar.gz gnunet-0923829e896d2f06a5cbd488fc899b6455d29454.zip |
-w3cvc extend reclaim plugin api header
-rw-r--r-- | src/include/gnunet_reclaim_lib.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_reclaim_plugin.h | 2 | ||||
-rw-r--r-- | src/reclaim/Makefile.am | 1 | ||||
-rw-r--r-- | src/reclaim/gnunet-service-reclaim_tickets.c | 1 | ||||
-rw-r--r-- | src/reclaim/plugin_reclaim_credential_jwt.c | 2 | ||||
-rw-r--r-- | src/reclaim/plugin_reclaim_credential_vc.c | 7 | ||||
-rw-r--r-- | src/reclaim/reclaim_credential.c | 3 |
7 files changed, 18 insertions, 0 deletions
diff --git a/src/include/gnunet_reclaim_lib.h b/src/include/gnunet_reclaim_lib.h index ae3e7cd14..33e42fd09 100644 --- a/src/include/gnunet_reclaim_lib.h +++ b/src/include/gnunet_reclaim_lib.h | |||
@@ -38,6 +38,7 @@ extern "C" { | |||
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #include "gnunet_util_lib.h" | 40 | #include "gnunet_util_lib.h" |
41 | #include "gnunet_identity_service.h" | ||
41 | 42 | ||
42 | enum GNUNET_RECLAIM_AttributeType { | 43 | enum GNUNET_RECLAIM_AttributeType { |
43 | /** | 44 | /** |
@@ -847,6 +848,7 @@ int | |||
847 | GNUNET_RECLAIM_credential_get_presentation ( | 848 | GNUNET_RECLAIM_credential_get_presentation ( |
848 | const struct GNUNET_RECLAIM_Credential *cred, | 849 | const struct GNUNET_RECLAIM_Credential *cred, |
849 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 850 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
851 | const struct GNUNET_IDENTITY_Ego *ego, | ||
850 | struct GNUNET_RECLAIM_Presentation **presentation); | 852 | struct GNUNET_RECLAIM_Presentation **presentation); |
851 | 853 | ||
852 | 854 | ||
diff --git a/src/include/gnunet_reclaim_plugin.h b/src/include/gnunet_reclaim_plugin.h index 11d5d76f7..163995adb 100644 --- a/src/include/gnunet_reclaim_plugin.h +++ b/src/include/gnunet_reclaim_plugin.h | |||
@@ -32,6 +32,7 @@ | |||
32 | 32 | ||
33 | #include "gnunet_util_lib.h" | 33 | #include "gnunet_util_lib.h" |
34 | #include "gnunet_reclaim_lib.h" | 34 | #include "gnunet_reclaim_lib.h" |
35 | #include "gnunet_identity_service.h" | ||
35 | 36 | ||
36 | #ifdef __cplusplus | 37 | #ifdef __cplusplus |
37 | extern "C" { | 38 | extern "C" { |
@@ -305,6 +306,7 @@ typedef int (*GNUNET_RECLAIM_CredentialToPresentation) ( | |||
305 | void *cls, | 306 | void *cls, |
306 | const struct GNUNET_RECLAIM_Credential *cred, | 307 | const struct GNUNET_RECLAIM_Credential *cred, |
307 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 308 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
309 | const struct GNUNET_IDENTITY_Ego *ego, | ||
308 | struct GNUNET_RECLAIM_Presentation **presentation); | 310 | struct GNUNET_RECLAIM_Presentation **presentation); |
309 | 311 | ||
310 | /** | 312 | /** |
diff --git a/src/reclaim/Makefile.am b/src/reclaim/Makefile.am index 8c6555abb..1b8a92b38 100644 --- a/src/reclaim/Makefile.am +++ b/src/reclaim/Makefile.am | |||
@@ -177,6 +177,7 @@ libgnunet_plugin_reclaim_credential_vc_la_SOURCES = \ | |||
177 | plugin_reclaim_credential_vc.c | 177 | plugin_reclaim_credential_vc.c |
178 | libgnunet_plugin_reclaim_credential_vc_la_LIBADD = \ | 178 | libgnunet_plugin_reclaim_credential_vc_la_LIBADD = \ |
179 | $(top_builddir)/src/util/libgnunetutil.la \ | 179 | $(top_builddir)/src/util/libgnunetutil.la \ |
180 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
180 | libgnunetreclaim.la \ | 181 | libgnunetreclaim.la \ |
181 | -ljansson\ | 182 | -ljansson\ |
182 | $(LTLIBINTL) | 183 | $(LTLIBINTL) |
diff --git a/src/reclaim/gnunet-service-reclaim_tickets.c b/src/reclaim/gnunet-service-reclaim_tickets.c index 0dd87aee9..e9e3c3dd1 100644 --- a/src/reclaim/gnunet-service-reclaim_tickets.c +++ b/src/reclaim/gnunet-service-reclaim_tickets.c | |||
@@ -1527,6 +1527,7 @@ filter_tickets_cb (void *cls, | |||
1527 | if (GNUNET_OK != GNUNET_RECLAIM_credential_get_presentation ( | 1527 | if (GNUNET_OK != GNUNET_RECLAIM_credential_get_presentation ( |
1528 | cred, | 1528 | cred, |
1529 | tih->attrs, | 1529 | tih->attrs, |
1530 | NULL, | ||
1530 | &presentation)) | 1531 | &presentation)) |
1531 | { | 1532 | { |
1532 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1533 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
diff --git a/src/reclaim/plugin_reclaim_credential_jwt.c b/src/reclaim/plugin_reclaim_credential_jwt.c index 5d5e221f9..bab8125ad 100644 --- a/src/reclaim/plugin_reclaim_credential_jwt.c +++ b/src/reclaim/plugin_reclaim_credential_jwt.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "platform.h" | 28 | #include "platform.h" |
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_util_lib.h" |
30 | #include "gnunet_reclaim_plugin.h" | 30 | #include "gnunet_reclaim_plugin.h" |
31 | #include "gnunet_identity_service.h" | ||
31 | #include <inttypes.h> | 32 | #include <inttypes.h> |
32 | #include <jansson.h> | 33 | #include <jansson.h> |
33 | 34 | ||
@@ -437,6 +438,7 @@ enum GNUNET_GenericReturnValue | |||
437 | jwt_create_presentation (void *cls, | 438 | jwt_create_presentation (void *cls, |
438 | const struct GNUNET_RECLAIM_Credential *cred, | 439 | const struct GNUNET_RECLAIM_Credential *cred, |
439 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 440 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
441 | const struct GNUNET_IDENTITY_Ego *ego, | ||
440 | struct GNUNET_RECLAIM_Presentation **presentation) | 442 | struct GNUNET_RECLAIM_Presentation **presentation) |
441 | { | 443 | { |
442 | if (GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT != cred->type) | 444 | if (GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT != cred->type) |
diff --git a/src/reclaim/plugin_reclaim_credential_vc.c b/src/reclaim/plugin_reclaim_credential_vc.c index db30a3745..735e33e78 100644 --- a/src/reclaim/plugin_reclaim_credential_vc.c +++ b/src/reclaim/plugin_reclaim_credential_vc.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "platform.h" | 28 | #include "platform.h" |
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_util_lib.h" |
30 | #include "gnunet_reclaim_plugin.h" | 30 | #include "gnunet_reclaim_plugin.h" |
31 | #include "gnunet_identity_service.h" | ||
31 | #include <inttypes.h> | 32 | #include <inttypes.h> |
32 | #include <jansson.h> | 33 | #include <jansson.h> |
33 | 34 | ||
@@ -451,6 +452,7 @@ enum GNUNET_GenericReturnValue | |||
451 | vc_create_presentation (void *cls, | 452 | vc_create_presentation (void *cls, |
452 | const struct GNUNET_RECLAIM_Credential *cred, | 453 | const struct GNUNET_RECLAIM_Credential *cred, |
453 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 454 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
455 | const struct GNUNET_IDENTITY_Ego *ego, | ||
454 | struct GNUNET_RECLAIM_Presentation **presentation) | 456 | struct GNUNET_RECLAIM_Presentation **presentation) |
455 | { | 457 | { |
456 | // Check if Ego has a DID Docuement | 458 | // Check if Ego has a DID Docuement |
@@ -461,6 +463,11 @@ vc_create_presentation (void *cls, | |||
461 | json_t * credential; | 463 | json_t * credential; |
462 | json_t * proof; | 464 | json_t * proof; |
463 | 465 | ||
466 | struct GNUNET_IDENTITY_PublicKey pkey; | ||
467 | GNUNET_IDENTITY_ego_get_public_key(ego, &pkey); | ||
468 | |||
469 | printf("DEBUG - %s\n", GNUNET_IDENTITY_public_key_to_string(&pkey)); | ||
470 | |||
464 | char * json_str; | 471 | char * json_str; |
465 | char * presentation_str; | 472 | char * presentation_str; |
466 | const char * now; | 473 | const char * now; |
diff --git a/src/reclaim/reclaim_credential.c b/src/reclaim/reclaim_credential.c index b4aeedf29..6d4707fb1 100644 --- a/src/reclaim/reclaim_credential.c +++ b/src/reclaim/reclaim_credential.c | |||
@@ -1036,6 +1036,7 @@ GNUNET_RECLAIM_presentation_get_expiration (const struct | |||
1036 | * | 1036 | * |
1037 | * @param cred the credential to use | 1037 | * @param cred the credential to use |
1038 | * @param attrs the attributes to present from the credential | 1038 | * @param attrs the attributes to present from the credential |
1039 | * @param ego the ego (subject) who creates the presentation | ||
1039 | * @return the credential presentation presenting the attributes according | 1040 | * @return the credential presentation presenting the attributes according |
1040 | * to the presentation mechanism of the credential | 1041 | * to the presentation mechanism of the credential |
1041 | * or NULL on error. | 1042 | * or NULL on error. |
@@ -1044,6 +1045,7 @@ int | |||
1044 | GNUNET_RECLAIM_credential_get_presentation ( | 1045 | GNUNET_RECLAIM_credential_get_presentation ( |
1045 | const struct GNUNET_RECLAIM_Credential *cred, | 1046 | const struct GNUNET_RECLAIM_Credential *cred, |
1046 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 1047 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
1048 | const struct GNUNET_IDENTITY_Ego *ego, | ||
1047 | struct GNUNET_RECLAIM_Presentation **presentation) | 1049 | struct GNUNET_RECLAIM_Presentation **presentation) |
1048 | { | 1050 | { |
1049 | unsigned int i; | 1051 | unsigned int i; |
@@ -1055,6 +1057,7 @@ GNUNET_RECLAIM_credential_get_presentation ( | |||
1055 | if (GNUNET_OK != plugin->api->create_presentation (plugin->api->cls, | 1057 | if (GNUNET_OK != plugin->api->create_presentation (plugin->api->cls, |
1056 | cred, | 1058 | cred, |
1057 | attrs, | 1059 | attrs, |
1060 | ego, | ||
1058 | presentation)) | 1061 | presentation)) |
1059 | continue; | 1062 | continue; |
1060 | (*presentation)->credential_id = cred->id; | 1063 | (*presentation)->credential_id = cred->id; |