gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 01/03: fixes


From: gnunet
Subject: [gnunet] 01/03: fixes
Date: Mon, 21 Dec 2020 15:53:19 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

commit 90cab809e8adaa868155e3325f04bcdbfe26fe60
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Tue Dec 15 15:52:27 2020 +0900

    fixes
---
 src/reclaim/json_reclaim.c               |  6 ++----
 src/reclaim/oidc_helper.c                | 17 +++++++++++++++++
 src/reclaim/plugin_rest_openid_connect.c |  1 +
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/reclaim/json_reclaim.c b/src/reclaim/json_reclaim.c
index 8a3479b8a..6c945036a 100644
--- a/src/reclaim/json_reclaim.c
+++ b/src/reclaim/json_reclaim.c
@@ -211,8 +211,7 @@ parse_ticket (void *cls, json_t *root, struct 
GNUNET_JSON_Specification *spec)
       GNUNET_STRINGS_string_to_data (id_str,
                                      strlen (id_str),
                                      &ticket->identity,
-                                     sizeof(
-                                       struct GNUNET_CRYPTO_EcdsaPublicKey)))
+                                     sizeof(ticket->identity)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Identity invalid\n");
     GNUNET_free (ticket);
@@ -223,8 +222,7 @@ parse_ticket (void *cls, json_t *root, struct 
GNUNET_JSON_Specification *spec)
       GNUNET_STRINGS_string_to_data (aud_str,
                                      strlen (aud_str),
                                      &ticket->audience,
-                                     sizeof(struct
-                                            GNUNET_CRYPTO_EcdsaPublicKey)))
+                                     sizeof(ticket->audience)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Audience invalid\n");
     GNUNET_free (ticket);
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c
index 1dde7b673..40cc5751e 100644
--- a/src/reclaim/oidc_helper.c
+++ b/src/reclaim/oidc_helper.c
@@ -256,6 +256,18 @@ generate_userinfo_json (const struct 
GNUNET_IDENTITY_PublicKey *sub_key,
       int j = 0;
       for (ple = presentations->list_head; NULL != ple; ple = ple->next)
       {
+        char *tmp;
+        tmp = GNUNET_STRINGS_data_to_string_alloc (&le->attribute->credential,
+                                                   sizeof 
(le->attribute->credential));
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "Checking : %s\n", tmp);
+        GNUNET_free (tmp);
+
+        tmp = GNUNET_STRINGS_data_to_string_alloc 
(&ple->presentation->credential_id,
+                                                   sizeof 
(ple->presentation->credential_id));
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    " against: %s\n", tmp);
+        GNUNET_free (tmp);
         if (GNUNET_YES ==
             GNUNET_RECLAIM_id_is_equal (&ple->presentation->credential_id,
                                         &le->attribute->credential))
@@ -498,6 +510,9 @@ OIDC_build_authz_code (const struct 
GNUNET_IDENTITY_PrivateKey *issuer,
   if (NULL != presentations)
   {
     // Get length
+    // FIXME only add presentations relevant for attribute list!!!
+    // This is important because of the distinction between id_token and
+    // userinfo in OIDC
     pres_list_len =
       GNUNET_RECLAIM_presentation_list_serialize_get_size (presentations);
     params.pres_list_len = htonl (pres_list_len);
@@ -524,8 +539,10 @@ OIDC_build_authz_code (const struct 
GNUNET_IDENTITY_PrivateKey *issuer,
   }
   if (0 < attr_list_len)
     GNUNET_RECLAIM_attribute_list_serialize (attrs, tmp);
+  tmp += attr_list_len;
   if (0 < pres_list_len)
     GNUNET_RECLAIM_presentation_list_serialize (presentations, tmp);
+  tmp += pres_list_len;
 
   /** END **/
 
diff --git a/src/reclaim/plugin_rest_openid_connect.c 
b/src/reclaim/plugin_rest_openid_connect.c
index 698dbfe18..5eb1ff093 100644
--- a/src/reclaim/plugin_rest_openid_connect.c
+++ b/src/reclaim/plugin_rest_openid_connect.c
@@ -2243,6 +2243,7 @@ consume_ticket (void *cls,
     atle->presentation = GNUNET_RECLAIM_presentation_new (pres->type,
                                                           pres->data,
                                                           pres->data_size);
+    atle->presentation->credential_id = pres->credential_id;
     GNUNET_CONTAINER_DLL_insert (handle->presentations->list_head,
                                  handle->presentations->list_tail,
                                  atle);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]