Browse Source

Merge branch 'master' of git+ssh://gnunet.org/gnunet

Christian Grothoff 3 years ago
parent
commit
debba1a49a

+ 2 - 1
.buildbot/build.sh

@@ -1,3 +1,4 @@
 #!/bin/bash
-
+echo "Cleanup old installation..."
+rm -rf /tmp/gnunet
 ./bootstrap && ./configure --prefix=/tmp/gnunet --enable-experimental && make

+ 2 - 4
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);

+ 17 - 0
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 **/
 

+ 1 - 0
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);