gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] Main GNUnet code base. branch credentials updated.


From: gitolite
Subject: [GNUnet-SVN] [gnunet] Main GNUnet code base. branch credentials updated. initial-import-from-subversion-38251-15-g18f1061
Date: Sun, 20 Nov 2016 00:24:00 +0100 (CET)

The branch, credentials has been updated
       via  18f106166cf64cc72206cd35301276aa21ca100a (commit)
       via  691aa85bfaec80c08330db772499a123b2ac2373 (commit)
       via  ffc906fa758dcc89eaabce14b754d311d3321dd4 (commit)
       via  12597da2a33fe196a785a656136cba7675a06e21 (commit)
       via  cdeb1253bfda209def1ef48b436ff09cf7ab8be6 (commit)
       via  e697fe7d7bda59cf23186d73d0522b984cd758b4 (commit)
       via  ce9687f34f0e82698f4bb66c01980d8bd6d7be06 (commit)
       via  0f024bfe565f05fb31383235676c9fa6e6539219 (commit)
      from  39981eee3163a1795026e8670ac5b669426f268b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 18f106166cf64cc72206cd35301276aa21ca100a
Author: Schanzenbach, Martin <address@hidden>
Date:   Sun Nov 20 00:23:49 2016 +0100

    - move towards verification

commit 691aa85bfaec80c08330db772499a123b2ac2373
Merge: 39981ee ffc906f
Author: Schanzenbach, Martin <address@hidden>
Date:   Sun Nov 20 00:23:07 2016 +0100

    Merge branch 'master' into credentials

-----------------------------------------------------------------------

Summary of changes:
 guix-env.scm                                 |  12 +-
 src/ats/plugin_ats_ril.c                     |   2 +-
 src/cadet/gnunet-service-cadet_channel.c     |   8 +-
 src/cadet/gnunet-service-cadet_connection.c  |   8 +-
 src/credential/credential.h                  |  16 +-
 src/credential/credential_api.c              | 153 +++++++++---------
 src/credential/gnunet-credential.c           |  26 ++-
 src/credential/gnunet-service-credential.c   | 227 +++++++++++++++------------
 src/credential/plugin_gnsrecord_credential.c |  48 +++---
 src/fragmentation/defragmentation.c          |   4 +-
 src/fragmentation/fragmentation.c            |  20 ++-
 src/fs/fs_api.c                              |   4 +-
 src/fs/fs_search.c                           |   4 +-
 src/fs/gnunet-auto-share.c                   |  12 +-
 src/fs/gnunet-service-fs_pr.c                |   2 +-
 src/include/gnunet_credential_service.h      |  25 ++-
 src/include/gnunet_gnsrecord_lib.h           |   4 +
 src/include/gnunet_protocols.h               |   4 +-
 src/include/gnunet_time_lib.h                |  12 ++
 src/regex/gnunet-regex-profiler.c            |   2 +-
 src/rps/gnunet-service-rps.c                 |   4 +-
 src/util/Makefile.am                         |   2 +-
 src/util/bandwidth.c                         |   4 +-
 src/util/client_new.c                        |  11 +-
 src/util/time.c                              |  26 +++
 src/vpn/vpn_api.c                            |   2 +-
 26 files changed, 347 insertions(+), 295 deletions(-)

diff --git a/guix-env.scm b/guix-env.scm
index 8da3eff..67fe661 100644
--- a/guix-env.scm
+++ b/guix-env.scm
@@ -104,8 +104,6 @@
 
 (define %source-dir (dirname (current-filename)))
 
-;; This will be needed when gnunet source moves to git.
-;; Taken from https://gitlab.com/dustyweb/pubstrate/blob/master/guix.scm
 (define git-file?
   (let* ((pipe (with-directory-excursion %source-dir
                  (open-pipe* OPEN_READ "git" "ls-files")))
@@ -123,14 +121,14 @@
          (any (cut string-suffix? <> file) files))
         (_ #f)))))
 
-(define gnunet-svn
+(define gnunet-git
   (package
-    (name "gnunet-svn")
+    (name "gnunet-git")
     (version (string-append "0.10.1-" "dev"))
     (source
      (local-file %source-dir
                  #:recursive? #t))
-                 ;;#:select? git-file?))
+                 ;;#:select? git-file?)) ; XXX: FIXME.
     (build-system gnu-build-system)
     (inputs
      `(("glpk" ,glpk)
@@ -176,7 +174,7 @@
        (list (string-append "--with-nssdir=" %output "/lib")
              "--enable-experimental"
              ;; These appear to be "broken" on Guix, needs debugging.
-             ;;"--enable-gcc-hardening"
+             "--enable-gcc-hardening"
              "--enable-linker-hardening"
              "--enable-logging=verbose"
              "--enable-poisoning"
@@ -217,4 +215,4 @@ kinds of basic applications for the foundation of a GNU 
internet.")
     (license license:gpl3+)
     (home-page "https://gnunet.org/";)))
 
-gnunet-svn
+gnunet-git
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c
index a3bdf20..ea79207 100644
--- a/src/ats/plugin_ats_ril.c
+++ b/src/ats/plugin_ats_ril.c
@@ -1835,7 +1835,7 @@ ril_step_schedule_next (struct GAS_RIL_Handle *solver)
   GNUNET_assert(y <= (double) solver->parameters.step_time_max.rel_value_us);
   GNUNET_assert(y >= (double) solver->parameters.step_time_min.rel_value_us);
 
-  time_next = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS, 
(unsigned long long) y);
+  time_next = GNUNET_TIME_relative_saturating_multiply 
(GNUNET_TIME_UNIT_MICROSECONDS, (unsigned long long) y);
 
 //  LOG (GNUNET_ERROR_TYPE_INFO, "ratio: %f, factor: %f, offset: %f, y: %f\n",
 //      used_ratio,
diff --git a/src/cadet/gnunet-service-cadet_channel.c 
b/src/cadet/gnunet-service-cadet_channel.c
index 0e9b7a3..22349aa 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -819,8 +819,8 @@ ch_message_sent (void *cls,
         if (0 != rel->expected_delay.rel_value_us)
         {
           rel->retry_timer =
-              GNUNET_TIME_relative_multiply (rel->expected_delay,
-                                             CADET_RETRANSMIT_MARGIN);
+              GNUNET_TIME_relative_saturating_multiply (rel->expected_delay,
+                                                        
CADET_RETRANSMIT_MARGIN);
         }
         else
         {
@@ -2110,8 +2110,8 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
         struct GNUNET_TIME_Absolute new_target;
         struct GNUNET_TIME_Relative delay;
 
-        delay = GNUNET_TIME_relative_multiply (rel->retry_timer,
-                                               CADET_RETRANSMIT_MARGIN);
+        delay = GNUNET_TIME_relative_saturating_multiply (rel->retry_timer,
+                                                          
CADET_RETRANSMIT_MARGIN);
         new_target = GNUNET_TIME_absolute_add (rel->head_sent->timestamp,
                                                delay);
         delay = GNUNET_TIME_absolute_get_remaining (new_target);
diff --git a/src/cadet/gnunet-service-cadet_connection.c 
b/src/cadet/gnunet-service-cadet_connection.c
index face765..1c500f7 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -1318,8 +1318,8 @@ schedule_next_keepalive (struct CadetConnection *c, int 
fwd)
   {
     if (1 > c->create_retry)
       c->create_retry = 1;
-    delay = GNUNET_TIME_relative_multiply (create_connection_time,
-                                           c->create_retry);
+    delay = GNUNET_TIME_relative_saturating_multiply (create_connection_time,
+                                                      c->create_retry);
     if (c->create_retry < 64) // TODO make configurable
       c->create_retry *= 2;
   }
@@ -1548,7 +1548,7 @@ connection_reset_timeout (struct CadetConnection *c, int 
fwd)
 
     if (NULL != *ti)
       GNUNET_SCHEDULER_cancel (*ti);
-    delay = GNUNET_TIME_relative_multiply (refresh_connection_time, 4);
+    delay = GNUNET_TIME_relative_saturating_multiply (refresh_connection_time, 
4);
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "  timing out in %s\n",
          GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_NO));
@@ -1681,7 +1681,7 @@ schedule_check_duplicates (struct CadetConnection *c)
 
   if (NULL != c->check_duplicates_task)
     return;
-  delay = GNUNET_TIME_relative_multiply (refresh_connection_time, 5);
+  delay = GNUNET_TIME_relative_saturating_multiply (refresh_connection_time, 
5);
   c->check_duplicates_task = GNUNET_SCHEDULER_add_delayed (delay,
                                                            &check_duplicates,
                                                            c);
diff --git a/src/credential/credential.h b/src/credential/credential.h
index 597c34a..2acaf73 100644
--- a/src/credential/credential.h
+++ b/src/credential/credential.h
@@ -30,12 +30,12 @@
 GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
- * Message from client to Credential service to lookup credentials.
+ * Message from client to Credential service to verify attributes.
  */
-struct LookupMessage
+struct VerifyMessage
 {
   /**
-   * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_LOOKUP
+   * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY
    */
   struct GNUNET_MessageHeader header;
 
@@ -54,7 +54,7 @@ struct LookupMessage
    */
   uint32_t id GNUNET_PACKED;
 
-  /* Followed by the zero-terminated credential to look up */
+  /* Followed by the zero-terminated attributes to look up */
 
 };
 
@@ -62,10 +62,10 @@ struct LookupMessage
 /**
  * Message from CREDENTIAL service to client: new results.
  */
-struct LookupResultMessage
+struct VerifyResultMessage
 {
   /**
-    * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_LOOKUP_RESULT
+    * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT
    */
   struct GNUNET_MessageHeader header;
 
@@ -78,9 +78,9 @@ struct LookupResultMessage
   /**
    * The number of credentials in the response
    */
-  uint32_t cd_count GNUNET_PACKED;
+  uint32_t ad_count GNUNET_PACKED;
 
-  /* followed by cd_count GNUNET_CREDENTIAL_RecordData structs*/
+  /* followed by ad_count GNUNET_CREDENTIAL_RecordData structs*/
 
 };
 
diff --git a/src/credential/credential_api.c b/src/credential/credential_api.c
index 1efe2d0..4864d54 100644
--- a/src/credential/credential_api.c
+++ b/src/credential/credential_api.c
@@ -36,20 +36,20 @@
 #define LOG(kind,...) GNUNET_log_from (kind, "credential-api",__VA_ARGS__)
 
 /**
- * Handle to a lookup request
+ * Handle to a verify request
  */
-struct GNUNET_CREDENTIAL_LookupRequest
+struct GNUNET_CREDENTIAL_VerifyRequest
 {
 
   /**
    * DLL
    */
-  struct GNUNET_CREDENTIAL_LookupRequest *next;
+  struct GNUNET_CREDENTIAL_VerifyRequest *next;
 
   /**
    * DLL
    */
-  struct GNUNET_CREDENTIAL_LookupRequest *prev;
+  struct GNUNET_CREDENTIAL_VerifyRequest *prev;
 
   /**
    * handle to credential service
@@ -57,12 +57,12 @@ struct GNUNET_CREDENTIAL_LookupRequest
   struct GNUNET_CREDENTIAL_Handle *credential_handle;
 
   /**
-   * processor to call on lookup result
+   * processor to call on verify result
    */
-  GNUNET_CREDENTIAL_LookupResultProcessor lookup_proc;
+  GNUNET_CREDENTIAL_VerifyResultProcessor verify_proc;
 
   /**
-   * @e lookup_proc closure
+   * @e verify_proc closure
    */
   void *proc_cls;
 
@@ -96,14 +96,14 @@ struct GNUNET_CREDENTIAL_Handle
   struct GNUNET_MQ_Handle *mq;
 
   /**
-   * Head of linked list of active lookup requests.
+   * Head of linked list of active verify requests.
    */
-  struct GNUNET_CREDENTIAL_LookupRequest *lookup_head;
+  struct GNUNET_CREDENTIAL_VerifyRequest *verify_head;
 
   /**
-   * Tail of linked list of active lookup requests.
+   * Tail of linked list of active verify requests.
    */
-  struct GNUNET_CREDENTIAL_LookupRequest *lookup_tail;
+  struct GNUNET_CREDENTIAL_VerifyRequest *verify_tail;
 
   /**
    * Reconnect task
@@ -192,7 +192,7 @@ mq_error_handler (void *cls,
  */
 static int
 check_result (void *cls,
-              const struct LookupResultMessage *lookup_msg)
+              const struct VerifyResultMessage *vr_msg)
 {
   //TODO
   return GNUNET_OK;
@@ -207,30 +207,30 @@ check_result (void *cls,
  */
 static void
 handle_result (void *cls,
-               const struct LookupResultMessage *lookup_msg)
+               const struct VerifyResultMessage *vr_msg)
 {
   struct GNUNET_CREDENTIAL_Handle *handle = cls;
-  uint32_t cd_count = ntohl (lookup_msg->cd_count);
-  struct GNUNET_CREDENTIAL_RecordData cd[cd_count];
-  uint32_t r_id = ntohl (lookup_msg->id);
-  struct GNUNET_CREDENTIAL_LookupRequest *lr;
-  GNUNET_CREDENTIAL_LookupResultProcessor proc;
+  uint32_t ad_count = ntohl (vr_msg->ad_count);
+  struct GNUNET_CREDENTIAL_RecordData ad[ad_count];
+  uint32_t r_id = ntohl (vr_msg->id);
+  struct GNUNET_CREDENTIAL_VerifyRequest *vr;
+  GNUNET_CREDENTIAL_VerifyResultProcessor proc;
   void *proc_cls;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Received lookup reply from CREDENTIAL service (%u credentials)\n",
-       (unsigned int) cd_count);
-  for (lr = handle->lookup_head; NULL != lr; lr = lr->next)
-    if (lr->r_id == r_id)
+       "Received verify reply from CREDENTIAL service (%u credentials)\n",
+       (unsigned int) ad_count);
+  for (vr = handle->verify_head; NULL != vr; vr = vr->next)
+    if (vr->r_id == r_id)
       break;
-  if (NULL == lr)
+  if (NULL == vr)
     return;
-  proc = lr->lookup_proc;
-  proc_cls = lr->proc_cls;
-  GNUNET_CONTAINER_DLL_remove (handle->lookup_head,
-                               handle->lookup_tail,
-                               lr);
-  GNUNET_free (lr);
+  proc = vr->verify_proc;
+  proc_cls = vr->proc_cls;
+  GNUNET_CONTAINER_DLL_remove (handle->verify_head,
+                               handle->verify_tail,
+                               vr);
+  GNUNET_free (vr);
   /**
   GNUNET_assert (GNUNET_OK ==
                  GNUNET_CREDENTIAL_records_deserialize (mlen,
@@ -240,8 +240,8 @@ handle_result (void *cls,
                                                          */
   proc (proc_cls,
         NULL,
-        cd_count,
-        cd); // TODO
+        ad_count,
+        ad); // TODO
 }
 
 
@@ -255,12 +255,12 @@ reconnect (struct GNUNET_CREDENTIAL_Handle *handle)
 {
   struct GNUNET_MQ_MessageHandler handlers[] = {
     GNUNET_MQ_hd_var_size (result,
-                           GNUNET_MESSAGE_TYPE_CREDENTIAL_LOOKUP_RESULT,
-                           struct LookupResultMessage,
+                           GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT,
+                           struct VerifyResultMessage,
                            NULL),
     GNUNET_MQ_handler_end ()
   };
-  struct GNUNET_CREDENTIAL_LookupRequest *lh;
+  struct GNUNET_CREDENTIAL_VerifyRequest *vr;
 
   GNUNET_assert (NULL == handle->mq);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -272,9 +272,9 @@ reconnect (struct GNUNET_CREDENTIAL_Handle *handle)
                                       handle);
   if (NULL == handle->mq)
     return;
-  for (lh = handle->lookup_head; NULL != lh; lh = lh->next)
+  for (vr = handle->verify_head; NULL != vr; vr = vr->next)
     GNUNET_MQ_send_copy (handle->mq,
-                         lh->env);
+                         vr->env);
 }
 
 
@@ -319,31 +319,31 @@ GNUNET_CREDENTIAL_disconnect (struct 
GNUNET_CREDENTIAL_Handle *handle)
     GNUNET_SCHEDULER_cancel (handle->reconnect_task);
     handle->reconnect_task = NULL;
   }
-  GNUNET_assert (NULL == handle->lookup_head);
+  GNUNET_assert (NULL == handle->verify_head);
   GNUNET_free (handle);
 }
 
 
 /**
- * Cancel pending lookup request
+ * Cancel pending verify request
  *
- * @param lr the lookup request to cancel
+ * @param lr the verify request to cancel
  */
 void
-GNUNET_CREDENTIAL_lookup_cancel (struct GNUNET_CREDENTIAL_LookupRequest *lr)
+GNUNET_CREDENTIAL_verify_cancel (struct GNUNET_CREDENTIAL_VerifyRequest *vr)
 {
-  struct GNUNET_CREDENTIAL_Handle *handle = lr->credential_handle;
+  struct GNUNET_CREDENTIAL_Handle *handle = vr->credential_handle;
 
-  GNUNET_CONTAINER_DLL_remove (handle->lookup_head,
-                               handle->lookup_tail,
-                               lr);
-  GNUNET_MQ_discard (lr->env);
-  GNUNET_free (lr);
+  GNUNET_CONTAINER_DLL_remove (handle->verify_head,
+                               handle->verify_tail,
+                               vr);
+  GNUNET_MQ_discard (vr->env);
+  GNUNET_free (vr);
 }
 
 
 /**
- * Perform an asynchronous lookup operation for a credential.
+ * Perform an asynchronous verify operation for a credential.
  *
  * @param handle handle to the Credential service
  * @param credential the credential to look up
@@ -352,58 +352,57 @@ GNUNET_CREDENTIAL_lookup_cancel (struct 
GNUNET_CREDENTIAL_LookupRequest *lr)
  * @param proc_cls closure for processor
  * @return handle to the queued request
  */
-struct GNUNET_CREDENTIAL_LookupRequest*
-GNUNET_CREDENTIAL_lookup (struct GNUNET_CREDENTIAL_Handle *handle,
-                          const char *credential,
-                          const struct GNUNET_IDENTITY_Ego *subject,
+struct GNUNET_CREDENTIAL_VerifyRequest*
+GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle,
+                          const char *issuer_attribute,
+                          const char *subject_attribute,
                           const struct GNUNET_CRYPTO_EcdsaPublicKey 
*subject_key,
                           const struct GNUNET_CRYPTO_EcdsaPublicKey 
*issuer_key,
                           uint32_t credential_flags,
-                          uint32_t max_delegation_depth,
-                          GNUNET_CREDENTIAL_LookupResultProcessor proc,
+                          GNUNET_CREDENTIAL_VerifyResultProcessor proc,
                           void *proc_cls)
 {
   /* IPC to shorten credential names, return shorten_handle */
-  struct LookupMessage *lookup_msg;
-  struct GNUNET_CREDENTIAL_LookupRequest *lr;
+  struct VerifyMessage *v_msg;
+  struct GNUNET_CREDENTIAL_VerifyRequest *vr;
   size_t nlen;
 
-  if (NULL == credential)
+  if (NULL == issuer_attribute)
   {
     GNUNET_break (0);
     return NULL;
   }
   //DEBUG LOG
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Trying to lookup `%s' in CREDENTIAL\n",
-       credential);
-  nlen = strlen (credential) + 1;
-  if (nlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (*lr))
+       "Trying to verify `%s' in CREDENTIAL\n",
+       issuer_attribute);
+  nlen = strlen (issuer_attribute) + 1;
+  if (nlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (*vr))
   {
     GNUNET_break (0);
     return NULL;
   }
-  lr = GNUNET_new (struct GNUNET_CREDENTIAL_LookupRequest);
-  lr->credential_handle = handle;
-  lr->lookup_proc = proc;
-  lr->proc_cls = proc_cls;
-  lr->r_id = handle->r_id_gen++;
-  lr->env = GNUNET_MQ_msg_extra (lookup_msg,
+  vr = GNUNET_new (struct GNUNET_CREDENTIAL_VerifyRequest);
+  vr->credential_handle = handle;
+  vr->verify_proc = proc;
+  vr->proc_cls = proc_cls;
+  vr->r_id = handle->r_id_gen++;
+  vr->env = GNUNET_MQ_msg_extra (v_msg,
                                  nlen,
-                                 GNUNET_MESSAGE_TYPE_CREDENTIAL_LOOKUP);
-  lookup_msg->id = htonl (lr->r_id);
-  lookup_msg->subject_key = *subject_key;
-  lookup_msg->issuer_key =  *issuer_key;
-  GNUNET_memcpy (&lookup_msg[1],
-                 credential,
+                                 GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY);
+  v_msg->id = htonl (vr->r_id);
+  v_msg->subject_key = *subject_key;
+  v_msg->issuer_key =  *issuer_key;
+  GNUNET_memcpy (&v_msg[1],
+                 subject_attribute,
                  nlen);
-  GNUNET_CONTAINER_DLL_insert (handle->lookup_head,
-                               handle->lookup_tail,
-                               lr);
+  GNUNET_CONTAINER_DLL_insert (handle->verify_head,
+                               handle->verify_tail,
+                               vr);
   if (NULL != handle->mq)
     GNUNET_MQ_send_copy (handle->mq,
-                         lr->env);
-  return lr;
+                         vr->env);
+  return vr;
 }
 
 
diff --git a/src/credential/gnunet-credential.c 
b/src/credential/gnunet-credential.c
index 363ed03..94a4b38 100644
--- a/src/credential/gnunet-credential.c
+++ b/src/credential/gnunet-credential.c
@@ -48,9 +48,9 @@ static struct GNUNET_TIME_Relative timeout;
 static char *lookup_credential;
 
 /**
- * Handle to lookup request
+ * Handle to verify request
  */
-static struct GNUNET_CREDENTIAL_LookupRequest *lookup_request;
+static struct GNUNET_CREDENTIAL_VerifyRequest *verify_request;
 
 /**
  * Lookup an ego with the identity service.
@@ -87,11 +87,6 @@ static char *issuer_key;
  */
 static int credential_flags;
 
-/*
- * Maximum delegation depth
- */
-static int max_delegation_depth;
-
 
 
 /**
@@ -118,10 +113,10 @@ do_shutdown (void *cls)
     GNUNET_IDENTITY_cancel (id_op);
     id_op = NULL;
   }
-  if (NULL != lookup_request)
+  if (NULL != verify_request)
   {
-    GNUNET_CREDENTIAL_lookup_cancel (lookup_request);
-    lookup_request = NULL;
+    GNUNET_CREDENTIAL_verify_cancel (verify_request);
+    verify_request = NULL;
   }
   if (NULL != identity)
   {
@@ -162,14 +157,14 @@ do_timeout (void *cls)
  * @param cd array of @a cd_count records with the results
  */
 static void
-handle_lookup_result (void *cls,
+handle_verify_result (void *cls,
                                struct GNUNET_IDENTITY_Ego *issuer,
                uint16_t issuer_len,
                                const struct GNUNET_CREDENTIAL_RecordData *data)
 {
   
 
-  lookup_request = NULL;
+  verify_request = NULL;
   if (0 == issuer_len)
     printf ("No results.\n");
   else
@@ -223,14 +218,13 @@ lookup_credentials (struct GNUNET_IDENTITY_Ego *ego)
       return;
     }
     
-  lookup_request = GNUNET_CREDENTIAL_lookup(credential,
+  verify_request = GNUNET_CREDENTIAL_verify(credential,
+                    "",
                     lookup_credential,
-                    ego,
                     &subject_pkey,
                     &issuer_pkey,
                     credential_flags,
-                    max_delegation_depth,
-                    &handle_lookup_result,
+                    &handle_verify_result,
                     NULL);
    return;
   }
diff --git a/src/credential/gnunet-service-credential.c 
b/src/credential/gnunet-service-credential.c
index de05926..114041b 100644
--- a/src/credential/gnunet-service-credential.c
+++ b/src/credential/gnunet-service-credential.c
@@ -45,17 +45,17 @@
 /**
  * DLL for record
  */
-struct CredentialRecordEntry
+struct AttributeRecordEntry
 {
   /**
    * DLL
    */
-  struct CredentialRecordEntry *next;
+  struct AttributeRecordEntry *next;
 
   /**
    * DLL
    */
-  struct CredentialRecordEntry *prev;
+  struct AttributeRecordEntry *prev;
 
 
   /**
@@ -67,18 +67,18 @@ struct CredentialRecordEntry
 /**
  * Handle to a lookup operation from api
  */
-struct ClientLookupHandle
+struct VerifyRequestHandle
 {
 
   /**
    * We keep these in a DLL.
    */
-  struct ClientLookupHandle *next;
+  struct VerifyRequestHandle *next;
 
   /**
    * We keep these in a DLL.
    */
-  struct ClientLookupHandle *prev;
+  struct VerifyRequestHandle *prev;
 
   /**
    * Handle to the requesting client
@@ -91,19 +91,24 @@ struct ClientLookupHandle
   struct GNUNET_GNS_LookupRequest *lookup_request;
 
   /**
-   * Authority public key
+   * Issuer public key
    */
   struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
 
   /**
-   * Credential Chain
+   * Subject public key
    */
-  struct CredentialRecordEntry *cred_chain_head;
+  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
 
   /**
-   * Credential Chain
+   * Attribute Chain
    */
-  struct CredentialRecordEntry *cred_chain_tail;
+  struct AttributeRecordEntry *attr_chain_head;
+
+  /**
+   * Attribute Chain
+   */
+  struct AttributeRecordEntry *attr_chain_tail;
 
   /**
    * request id
@@ -116,12 +121,12 @@ struct ClientLookupHandle
 /**
  * Head of the DLL.
  */
-static struct ClientLookupHandle *clh_head;
+static struct VerifyRequestHandle *vrh_head;
 
 /**
  * Tail of the DLL.
  */
-static struct ClientLookupHandle *clh_tail;
+static struct VerifyRequestHandle *vrh_tail;
 
 /**
  * Handle to the statistics service
@@ -144,17 +149,17 @@ static struct GNUNET_GNS_Handle *gns;
 static void
 shutdown_task (void *cls)
 {
-  struct ClientLookupHandle *clh;
+  struct VerifyRequestHandle *vrh;
   
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Shutting down!\n");
-  while (NULL != (clh = clh_head))
+  while (NULL != (vrh = vrh_head))
   {
     //CREDENTIAL_resolver_lookup_cancel (clh->lookup);
-    GNUNET_CONTAINER_DLL_remove (clh_head,
-                                 clh_tail,
-                                 clh);
-    GNUNET_free (clh);
+    GNUNET_CONTAINER_DLL_remove (vrh_head,
+                                 vrh_tail,
+                                 vrh);
+    GNUNET_free (vrh);
   }
 
   
@@ -168,28 +173,38 @@ shutdown_task (void *cls)
 }
 
 /**
- * Checks a #GNUNET_MESSAGE_TYPE_CREDENTIAL_LOOKUP message
+ * Checks a #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY message
  *
  * @param cls client sending the message
- * @param l_msg message of type `struct LookupMessage`
- * @return #GNUNET_OK if @a l_msg is well-formed
+ * @param v_msg message of type `struct VerifyMessage`
+ * @return #GNUNET_OK if @a v_msg is well-formed
  */
 static int
-check_lookup (void *cls,
-                   const struct LookupMessage *l_msg)
+check_verify (void *cls,
+                   const struct VerifyMessage *v_msg)
 {
   size_t msg_size;
-  const char* cred;
+  size_t attr_len;
+  const char* s_attr;
+  const char* i_attr;
 
-  msg_size = ntohs (l_msg->header.size);
-  if (msg_size < sizeof (struct LookupMessage))
+  msg_size = ntohs (v_msg->header.size);
+  if (msg_size < sizeof (struct VerifyMessage))
+  {
+    GNUNET_break (0);
+    return GNUNET_SYSERR;
+  }
+  i_attr = (const char *) &v_msg[1];
+  if ( ('\0' != i_attr[v_msg->header.size - sizeof (struct VerifyMessage) - 
1]) ||
+       (strlen (i_attr) > GNUNET_CREDENTIAL_MAX_LENGTH) )
   {
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }
-  cred = (const char *) &l_msg[1];
-  if ( ('\0' != cred[l_msg->header.size - sizeof (struct LookupMessage) - 1]) 
||
-       (strlen (cred) > GNUNET_CREDENTIAL_MAX_LENGTH) )
+  attr_len = strlen (i_attr);
+  s_attr = ((const char *) &v_msg[1]) + attr_len + 1;
+  if ( ('\0' != s_attr[v_msg->header.size - sizeof (struct VerifyMessage) - 
1]) ||
+       (strlen (s_attr) > GNUNET_CREDENTIAL_MAX_LENGTH) )
   {
     GNUNET_break (0);
     return GNUNET_SYSERR;
@@ -199,7 +214,7 @@ check_lookup (void *cls,
 
 
 /**
- * Reply to client with the result from our lookup.
+ * Result from GNS lookup.
  *
  * @param cls the closure (our client lookup handle)
  * @param rd_count the number of records in @a rd
@@ -210,139 +225,147 @@ send_lookup_response (void* cls,
                       uint32_t rd_count,
                       const struct GNUNET_GNSRECORD_Data *rd)
 {
-  struct ClientLookupHandle *clh = cls;
+  struct VerifyRequestHandle *vrh = cls;
   size_t len;
   int i;
-  int cred_record_count;
+  int attr_record_count;
   struct GNUNET_MQ_Envelope *env;
-  struct LookupResultMessage *rmsg;
-  const struct GNUNET_CREDENTIAL_RecordData *crd;
-  struct CredentialRecordEntry *cr_entry;
+  struct VerifyResultMessage *rmsg;
+  const struct GNUNET_CREDENTIAL_RecordData *ard;
+  struct AttributeRecordEntry *ar_entry;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Sending LOOKUP_RESULT message with %u results\n",
-              (unsigned int) rd_count);
-  
-  cred_record_count = 0;
+  attr_record_count = 0;
   for (i=0; i < rd_count; i++)
   {
-    if (GNUNET_GNSRECORD_TYPE_CREDENTIAL != rd[i].record_type)
+    if (GNUNET_GNSRECORD_TYPE_ATTRIBUTE != rd[i].record_type)
       continue;
-    cred_record_count++;
-    crd = rd[i].data;
+    attr_record_count++;
+    ard = rd[i].data;
     /**
-     * TODO: Check for:
-     * - First time we come here subject must be subject prvided by client
-     * - After that is has to be the prev issuer
-     * - Terminate condition: issuer is clh->authority_key
-     *
-     *   In any case:
-     *   Append crd to result list of RecordData
+     * TODO:
+     * Check if we have already found our credential here
+     * If so return success
+     * Else
+     *  Save all found attributes/issues and prepare forward
+     *  resolution of issuer attribute
      */
-    cr_entry = GNUNET_new (struct CredentialRecordEntry);
-    cr_entry->record_data = *crd;
-    GNUNET_CONTAINER_DLL_insert_tail (clh->cred_chain_head,
-                                      clh->cred_chain_tail,
-                                      cr_entry);
+    ar_entry = GNUNET_new (struct AttributeRecordEntry);
+    ar_entry->record_data = *ard;
+    GNUNET_CONTAINER_DLL_insert_tail (vrh->attr_chain_head,
+                                      vrh->attr_chain_tail,
+                                      ar_entry);
 
   }
 
   /**
    * Get serialized record data size
    */
-  len = cred_record_count * sizeof (struct GNUNET_CREDENTIAL_RecordData);
-  
+  len = attr_record_count * sizeof (struct GNUNET_CREDENTIAL_RecordData);
+
   /**
    * Prepare a lookup result response message for the client
    */
   env = GNUNET_MQ_msg_extra (rmsg,
                              len,
-                             GNUNET_MESSAGE_TYPE_CREDENTIAL_LOOKUP_RESULT);
+                             GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT);
   //Assign id so that client can find associated request
-  rmsg->id = clh->request_id;
-  rmsg->cd_count = htonl (cred_record_count);
-  
+  rmsg->id = vrh->request_id;
+  rmsg->ad_count = htonl (attr_record_count);
+
   /**
    * Get serialized record data
    * Append at the end of rmsg
    */
   i = 0;
   struct GNUNET_CREDENTIAL_RecordData *tmp_record = (struct 
GNUNET_CREDENTIAL_RecordData*) &rmsg[1];
-  for (cr_entry = clh->cred_chain_head; NULL != cr_entry; cr_entry = 
cr_entry->next)
+  for (ar_entry = vrh->attr_chain_head; NULL != ar_entry; ar_entry = 
ar_entry->next)
   {
     memcpy (tmp_record,
-            &cr_entry->record_data,
+            &ar_entry->record_data,
             sizeof (struct GNUNET_CREDENTIAL_RecordData));
     tmp_record++;
   }
-  GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(clh->client),
+  GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(vrh->client),
                   env);
 
-  GNUNET_CONTAINER_DLL_remove (clh_head, clh_tail, clh);
-  
+  GNUNET_CONTAINER_DLL_remove (vrh_head, vrh_tail, vrh);
+
   /**
    * TODO:
    * - Free DLL
    * - Refactor into cleanup_handle() function for this
    */
-  GNUNET_free (clh);
+  GNUNET_free (vrh);
 
   GNUNET_STATISTICS_update (statistics,
-                            "Completed lookups", 1,
+                            "Completed verifications", 1,
                             GNUNET_NO);
   GNUNET_STATISTICS_update (statistics,
-                            "Records resolved",
+                            "Attributes resolved",
                             rd_count,
                             GNUNET_NO);
 }
 
 /**
- * Handle lookup requests from client
+ * Handle attribute verification requests from client
  *
  * @param cls the closure
  * @param client the client
  * @param message the message
  */
 static void
-handle_lookup (void *cls,
-               const struct LookupMessage *l_msg) 
+handle_verify (void *cls,
+               const struct VerifyMessage *v_msg) 
 {
-  char credential[GNUNET_CREDENTIAL_MAX_LENGTH + 1];
-  struct ClientLookupHandle *clh;
+  char issuer_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1];
+  char subject_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1];
+  size_t issuer_attribute_len;
+  struct VerifyRequestHandle *vrh;
   struct GNUNET_SERVICE_Client *client = cls;
-  char *credentialptr = credential;
+  char *attrptr = issuer_attribute;
   const char *utf_in;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Received LOOKUP message\n");
-
-  utf_in = (const char *) &l_msg[1];
-  GNUNET_STRINGS_utf8_tolower (utf_in, credentialptr);
-  clh = GNUNET_new (struct ClientLookupHandle);
-  GNUNET_CONTAINER_DLL_insert (clh_head, clh_tail, clh);
-  clh->client = client;
-  clh->request_id = l_msg->id;
-  clh->issuer_key = l_msg->issuer_key;
-
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Sending LOOKUP_RESULT message with >%u results\n",
-              0);
-
-  if (NULL == credential)
+              "Received VERIFY message\n");
+
+  utf_in = (const char *) &v_msg[1];
+  GNUNET_STRINGS_utf8_tolower (utf_in, attrptr);
+  issuer_attribute_len = strlen (utf_in);
+  utf_in = (const char *) (&v_msg[1] + issuer_attribute_len + 1);
+  attrptr = subject_attribute;
+  GNUNET_STRINGS_utf8_tolower (utf_in, attrptr);
+  vrh = GNUNET_new (struct VerifyRequestHandle);
+  GNUNET_CONTAINER_DLL_insert (vrh_head, vrh_tail, vrh);
+  vrh->client = client;
+  vrh->request_id = v_msg->id;
+  vrh->issuer_key = v_msg->issuer_key;
+  vrh->subject_key = v_msg->subject_key;
+
+  if (NULL == subject_attribute)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 
-                "No credential provided\n");
-    send_lookup_response (clh, 0, NULL);
+                "No subject attribute provided!\n");
+    send_lookup_response (vrh, 0, NULL);
     return;
   }
-  clh->lookup_request = GNUNET_GNS_lookup (gns,
-                                           credential,
-                                           &l_msg->subject_key, //subject_pkey,
-                                           GNUNET_GNSRECORD_TYPE_CREDENTIAL,
-                                           GNUNET_GNS_LO_DEFAULT, //TODO 
configurable? credential.conf
+  if (NULL == issuer_attribute)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 
+                "No issuer attribute provided!\n");
+    send_lookup_response (vrh, 0, NULL);
+    return;
+  }
+  /**
+   * First, get attribute from subject
+   */
+  vrh->lookup_request = GNUNET_GNS_lookup (gns,
+                                           subject_attribute,
+                                           &v_msg->subject_key, //subject_pkey,
+                                           GNUNET_GNSRECORD_TYPE_ATTRIBUTE,
+                                           GNUNET_GNS_LO_DEFAULT,
                                            NULL, //shorten_key, always NULL
                                            &send_lookup_response,
-                                           clh);
+                                           vrh);
 }
 
 
@@ -416,9 +439,9 @@ GNUNET_SERVICE_MAIN
  &client_connect_cb,
  &client_disconnect_cb,
  NULL,
- GNUNET_MQ_hd_var_size (lookup,
-                        GNUNET_MESSAGE_TYPE_CREDENTIAL_LOOKUP,
-                        struct LookupMessage,
+ GNUNET_MQ_hd_var_size (verify,
+                        GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY,
+                        struct VerifyMessage,
                         NULL),
  GNUNET_MQ_handler_end());
 
diff --git a/src/credential/plugin_gnsrecord_credential.c 
b/src/credential/plugin_gnsrecord_credential.c
index 6ae3b89..3ff0073 100644
--- a/src/credential/plugin_gnsrecord_credential.c
+++ b/src/credential/plugin_gnsrecord_credential.c
@@ -58,7 +58,6 @@ credential_value_to_string (void *cls,
     char *subject_pkey;
     char *issuer_pkey;
     uint32_t cf; // Credential flags
-    uint32_t mdd; // Max delegation depth
     if (data_size < sizeof (struct GNUNET_CREDENTIAL_RecordData))
         return NULL; /* malformed */
     memcpy (&cred,
@@ -68,14 +67,12 @@ credential_value_to_string (void *cls,
     subject_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string 
(&cred.subject_key);
     issuer_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred.issuer_key);
     cf = ntohl (cred.credential_flags);
-    mdd = ntohl (cred.max_delegation_depth);
 
      GNUNET_asprintf (&cred_str,
-                     "%s %s %u %u %s",
+                     "%s %s %u %s",
                      subject_pkey,
                      issuer_pkey,
                      (unsigned int) cf,
-                     (unsigned int) mdd,
                      &cdata[sizeof (cred)]);
       GNUNET_free (subject_pkey);
       GNUNET_free (issuer_pkey);
@@ -112,26 +109,24 @@ credential_string_to_value (void *cls,
     return GNUNET_SYSERR;
   switch (type)
   {
-   case GNUNET_GNSRECORD_TYPE_CREDENTIAL:
-    { 
-      struct GNUNET_CREDENTIAL_RecordData *cred;
-      unsigned int cf; // credential flags
-      unsigned int mdd; // max delegation depth
+    case GNUNET_GNSRECORD_TYPE_CREDENTIAL:
+      { 
+        struct GNUNET_CREDENTIAL_RecordData *cred;
+        unsigned int cf; // credential flags
 
-      size_t enclen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8;
+        size_t enclen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8;
         if (enclen % 5 > 0)
           enclen += 5 - enclen % 5;
         enclen /= 5; /* 260/5 = 52 */
-      char subject_pkey[enclen + 1];
-      char issuer_pkey[enclen + 1];
-      char name[253 + 1];
+        char subject_pkey[enclen + 1];
+        char issuer_pkey[enclen + 1];
+        char name[253 + 1];
 
-      if (5 != SSCANF (s,
-                         "%52s %52s %u %u %253s",
+        if (5 != SSCANF (s,
+                         "%52s %52s %u %253s",
                          subject_pkey,
                          issuer_pkey,
                          &cf,
-                         &mdd,
                          name))
         {
           GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -148,18 +143,17 @@ credential_string_to_value (void *cls,
                                                     strlen (issuer_pkey),
                                                     &cred->issuer_key);
         cred->credential_flags = htonl (cf);
-        cred->max_delegation_depth = htonl (mdd);
         GNUNET_memcpy (&cred[1],
                        name,
                        strlen (name));
 
 
-      *data = GNUNET_strdup (s);
-      *data_size = strlen (s);
-      return GNUNET_OK;
-    }
-  default:
-    return GNUNET_SYSERR;
+        *data = GNUNET_strdup (s);
+        *data_size = strlen (s);
+        return GNUNET_OK;
+      }
+    default:
+      return GNUNET_SYSERR;
   }
 }
 
@@ -186,13 +180,13 @@ static struct {
  */
 static uint32_t
 credential_typename_to_number (void *cls,
-                        const char *gns_typename)
+                               const char *gns_typename)
 {
   unsigned int i;
 
   i=0;
   while ( (name_map[i].name != NULL) &&
-         (0 != strcasecmp (gns_typename, name_map[i].name)) )
+          (0 != strcasecmp (gns_typename, name_map[i].name)) )
     i++;
   return name_map[i].number;
 }
@@ -207,13 +201,13 @@ credential_typename_to_number (void *cls,
  */
 static const char *
 credential_number_to_typename (void *cls,
-                        uint32_t type)
+                               uint32_t type)
 {
   unsigned int i;
 
   i=0;
   while ( (name_map[i].name != NULL) &&
-         (type != name_map[i].number) )
+          (type != name_map[i].number) )
     i++;
   return name_map[i].name;
 }
diff --git a/src/fragmentation/defragmentation.c 
b/src/fragmentation/defragmentation.c
index bc40143..cc0f5a8 100644
--- a/src/fragmentation/defragmentation.c
+++ b/src/fragmentation/defragmentation.c
@@ -564,8 +564,8 @@ GNUNET_DEFRAGMENT_process_fragment (struct 
GNUNET_DEFRAGMENT_Context *dc,
   {
     dc->latency = estimate_latency (mc);
   }
-  delay = GNUNET_TIME_relative_multiply (dc->latency,
-                                         bc + 1);
+  delay = GNUNET_TIME_relative_saturating_multiply (dc->latency,
+                                                    bc + 1);
   if ( (last + fid == num_fragments) ||
        (0 == mc->bits) ||
        (GNUNET_YES == duplicate) )
diff --git a/src/fragmentation/fragmentation.c 
b/src/fragmentation/fragmentation.c
index 21bbc53..02444cf 100644
--- a/src/fragmentation/fragmentation.c
+++ b/src/fragmentation/fragmentation.c
@@ -258,14 +258,18 @@ transmit_next (void *cls)
                                                 fsize);
   else
     delay = GNUNET_TIME_UNIT_ZERO;
-  delay = GNUNET_TIME_relative_max (delay,
-                                   GNUNET_TIME_relative_multiply 
(fc->msg_delay,
-                                                                  (1ULL << 
fc->num_rounds)));
+  if (fc->num_rounds < 64)
+    delay = GNUNET_TIME_relative_max (delay,
+                                      GNUNET_TIME_relative_saturating_multiply
+                                      (fc->msg_delay,
+                                       (1ULL << fc->num_rounds)));
+  else
+    delay = GNUNET_TIME_UNIT_FOREVER_REL;
   if (wrap)
   {
     /* full round transmitted wait 2x delay for ACK before going again */
     fc->num_rounds++;
-    delay = GNUNET_TIME_relative_multiply (fc->ack_delay, 2);
+    delay = GNUNET_TIME_relative_saturating_multiply (fc->ack_delay, 2);
     /* never use zero, need some time for ACK always */
     delay = GNUNET_TIME_relative_max (MIN_ACK_DELAY, delay);
     fc->wack = GNUNET_YES;
@@ -428,8 +432,8 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context 
*fc,
     if (0 == ack_cnt)
     {
       /* complete loss */
-      fc->msg_delay = GNUNET_TIME_relative_multiply (fc->msg_delay,
-                                                    snd_cnt);
+      fc->msg_delay = GNUNET_TIME_relative_saturating_multiply (fc->msg_delay,
+                                                                snd_cnt);
     }
     else if (snd_cnt > ack_cnt)
     {
@@ -511,8 +515,8 @@ GNUNET_FRAGMENT_context_destroy (struct 
GNUNET_FRAGMENT_Context *fc,
   if (NULL != ack_delay)
     *ack_delay = fc->ack_delay;
   if (NULL != msg_delay)
-    *msg_delay = GNUNET_TIME_relative_multiply (fc->msg_delay,
-                                               fc->num_rounds);
+    *msg_delay = GNUNET_TIME_relative_saturating_multiply (fc->msg_delay,
+                                                           fc->num_rounds);
   GNUNET_free (fc);
 }
 
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index 1e8af23..7e76948 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -178,8 +178,8 @@ process_job_queue (void *cls)
       break;
     case GNUNET_FS_QUEUE_PRIORITY_NORMAL:
       run_time =
-        GNUNET_TIME_relative_multiply (h->avg_block_latency,
-                                       qe->blocks * qe->start_times);
+        GNUNET_TIME_relative_saturating_multiply (h->avg_block_latency,
+                                                  qe->blocks * 
qe->start_times);
       end_time = GNUNET_TIME_absolute_add (qe->start_time, run_time);
       rst = GNUNET_TIME_absolute_get_remaining (end_time);
       if (0 == rst.rel_value_us)
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 7874bb6..198577b 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -458,8 +458,8 @@ GNUNET_FS_search_start_probe_ (struct 
GNUNET_FS_SearchResult *sr)
              (unsigned long long) off,
              sr);
   sr->remaining_probe_time =
-      GNUNET_TIME_relative_multiply (sr->h->avg_block_latency,
-                                     2 * (1 + sr->availability_trials));
+      GNUNET_TIME_relative_saturating_multiply (sr->h->avg_block_latency,
+                                                2 * (1 + 
sr->availability_trials));
   sr->probe_ctx =
       GNUNET_FS_download_start (sr->h, sr->uri, sr->meta, NULL, NULL, off,
                                 len, sr->anonymity,
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index 96f86bf..cc01111 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -29,9 +29,9 @@
 #include "platform.h"
 #include "gnunet_util_lib.h"
 
-#define MIN_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
+#define MAX_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
 
-#define MAX_FREQUENCY GNUNET_TIME_UNIT_MINUTES
+#define MIN_DELAY GNUNET_TIME_UNIT_MINUTES
 
 
 /**
@@ -672,11 +672,11 @@ schedule_next_task ()
     /* delay by at most 4h, at least 1s, and otherwise in between depending
        on how long it took to scan */
     delay = GNUNET_TIME_absolute_get_duration (start_time);
-    delay = GNUNET_TIME_relative_min (MIN_FREQUENCY,
-                                     GNUNET_TIME_relative_multiply (delay,
-                                                                    100));
+    delay = GNUNET_TIME_relative_saturating_multiply (delay, 100);
+    delay = GNUNET_TIME_relative_min (delay,
+                                      MAX_DELAY);
     delay = GNUNET_TIME_relative_max (delay,
-                                     MAX_FREQUENCY);
+                                      MIN_DELAY);
     run_task = GNUNET_SCHEDULER_add_delayed (delay,
                                             &scan,
                                             NULL);
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index f8a7b61..63462f7 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -1036,7 +1036,7 @@ put_migration_continuation (void *cls, int success,
                                                       ppd->migration_delay);
       mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 
(GNUNET_CRYPTO_QUALITY_WEAK,
                                                         
ppd->migration_delay.rel_value_us);
-      ppd->migration_delay = GNUNET_TIME_relative_multiply 
(ppd->migration_delay, 2);
+      ppd->migration_delay = GNUNET_TIME_relative_saturating_multiply 
(ppd->migration_delay, 2);
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "Replicated content already exists locally, asking to stop 
migration for %s\n",
                  GNUNET_STRINGS_relative_time_to_string (mig_pause,
diff --git a/src/include/gnunet_credential_service.h 
b/src/include/gnunet_credential_service.h
index 55deb78..739e6fe 100644
--- a/src/include/gnunet_credential_service.h
+++ b/src/include/gnunet_credential_service.h
@@ -87,7 +87,6 @@ struct GNUNET_CREDENTIAL_RecordData {
 
   uint32_t credential_flags GNUNET_PACKED;
 
-  uint32_t max_delegation_depth GNUNET_PACKED;
 };
 
 GNUNET_NETWORK_STRUCT_END
@@ -121,7 +120,7 @@ GNUNET_CREDENTIAL_disconnect (struct 
GNUNET_CREDENTIAL_Handle *handle);
  * @param issuer_len length of issuer chain
  * @param rd the records in reply
  */
-typedef void (*GNUNET_CREDENTIAL_LookupResultProcessor) (void *cls,
+typedef void (*GNUNET_CREDENTIAL_VerifyResultProcessor) (void *cls,
                                                  struct GNUNET_IDENTITY_Ego 
*issuer,
               uint16_t issuer_len,
                                                  const struct 
GNUNET_CREDENTIAL_RecordData *data);
@@ -137,17 +136,15 @@ typedef void (*GNUNET_CREDENTIAL_LookupResultProcessor) 
(void *cls,
  * @param proc_cls closure for processor
  * @return handle to the queued request
  */
-struct GNUNET_CREDENTIAL_LookupRequest *
-GNUNET_CREDENTIAL_lookup (struct GNUNET_CREDENTIAL_Handle *handle,
-                  const char *credential,
-                  const struct GNUNET_IDENTITY_Ego *subject,
-       const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
-       const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
-       uint32_t credential_flags,
-       uint32_t max_delegation_depth,
-       GNUNET_CREDENTIAL_LookupResultProcessor proc,
-                  void *proc_cls);
-
+struct GNUNET_CREDENTIAL_VerifyRequest*
+GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle,
+                          const char *issuer_attribute,
+                          const char *subject_attribute,
+                          const struct GNUNET_CRYPTO_EcdsaPublicKey 
*subject_key,
+                          const struct GNUNET_CRYPTO_EcdsaPublicKey 
*issuer_key,
+                          uint32_t credential_flags,
+                          GNUNET_CREDENTIAL_VerifyResultProcessor proc,
+                          void *proc_cls);
 
 /**
  * Issue a credential to an identity
@@ -194,7 +191,7 @@ GNUNET_CREDENTIAL_remove (struct GNUNET_CREDENTIAL_Handle 
*handle,
  * @param lr the lookup request to cancel
  */
 void
-GNUNET_CREDENTIAL_lookup_cancel (struct GNUNET_CREDENTIAL_LookupRequest *lr);
+GNUNET_CREDENTIAL_verify_cancel (struct GNUNET_CREDENTIAL_VerifyRequest *vr);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_gnsrecord_lib.h 
b/src/include/gnunet_gnsrecord_lib.h
index 7e0a1a9..4f96d50 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -118,6 +118,10 @@ extern "C"
  */
 #define GNUNET_GNSRECORD_TYPE_REVERSE 65548
 
+/**
+ * Record type for reverse lookups
+ */
+#define GNUNET_GNSRECORD_TYPE_ATTRIBUTE 65549
 
 
 /**
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 3e16350..c117920 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -2612,9 +2612,9 @@ extern "C"
  *
  * CREDENTIAL MESSAGE TYPES
  */
-#define GNUNET_MESSAGE_TYPE_CREDENTIAL_LOOKUP     971
+#define GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY     971
 
-#define GNUNET_MESSAGE_TYPE_CREDENTIAL_LOOKUP_RESULT 972
+#define GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT 972
 
 
/******************************************************************************/
 
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h
index 64c5769..224edc0 100644
--- a/src/include/gnunet_time_lib.h
+++ b/src/include/gnunet_time_lib.h
@@ -421,6 +421,18 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative 
rel,
 
 
 /**
+ * Saturating multiply relative time by a given factor.
+ *
+ * @param rel some duration
+ * @param factor integer to multiply with
+ * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor
+ */
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_saturating_multiply (struct GNUNET_TIME_Relative rel,
+                                          unsigned long long factor);
+
+
+/**
  * Divide relative time by a given factor.
  *
  * @param rel some duration
diff --git a/src/regex/gnunet-regex-profiler.c 
b/src/regex/gnunet-regex-profiler.c
index c5ecf3b..dfbcd38 100644
--- a/src/regex/gnunet-regex-profiler.c
+++ b/src/regex/gnunet-regex-profiler.c
@@ -950,7 +950,7 @@ daemon_started (void *cls,
   }
   peers[search_peer].search_str = search_strings[peer->id];
   peers[search_peer].search_str_matched = GNUNET_NO;
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(
+  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_saturating_multiply(
                                   reannounce_period_max,
                                   2),
                                 &find_string,
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 90aab93..9de1f8d 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -1508,7 +1508,7 @@ compute_rand_delay (struct GNUNET_TIME_Relative mean,
    * via multiplying round_interval with a 'fraction' (0 to value)/value
    */
   rand_delay = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 
max_rand_delay);
-  ret = GNUNET_TIME_relative_multiply (mean,  rand_delay);
+  ret = GNUNET_TIME_relative_saturating_multiply (mean,  rand_delay);
   ret = GNUNET_TIME_relative_divide   (ret, max_rand_delay);
   ret = GNUNET_TIME_relative_add      (ret, half_interval);
 
@@ -2394,7 +2394,7 @@ run (void *cls,
   struct GNUNET_TIME_Relative half_round_interval;
   struct GNUNET_TIME_Relative  max_round_interval;
 
-  half_round_interval = GNUNET_TIME_relative_multiply (round_interval, .5);
+  half_round_interval = GNUNET_TIME_relative_divide (round_interval, 2);
   max_round_interval = GNUNET_TIME_relative_add (round_interval, 
half_round_interval);
 
   prot_sampler =   RPS_sampler_init     (sampler_size_est_need, 
max_round_interval);
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index f28861f..6581864 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -196,7 +196,7 @@ endif
 do_subst = $(SED) -e 's,address@hidden@],$(PYTHON),g'
 
 gnunet-qr: gnunet-qr.py.in Makefile
-       $(do_subst) < gnunet-qr.py.in > gnunet-qr
+       $(do_subst) < $(top_srcdir)/src/util/gnunet-qr.py.in > gnunet-qr
        chmod +x gnunet-qr
 
 gnunet_service_resolver_SOURCES = \
diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c
index 980af76..a059fc7 100644
--- a/src/util/bandwidth.c
+++ b/src/util/bandwidth.c
@@ -204,8 +204,8 @@ update_excess (struct GNUNET_BANDWIDTH_Tracker *av)
   else
   {
     double factor = 1.0 * left_bytes / (double) av->available_bytes_per_s__; 
-    delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
-                                           (unsigned long long) factor);
+    delay = GNUNET_TIME_relative_saturating_multiply (GNUNET_TIME_UNIT_SECONDS,
+                                                      (unsigned long long) 
factor);
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "At %llu bps it will take us %s for %lld bytes to reach excess 
threshold\n",
diff --git a/src/util/client_new.c b/src/util/client_new.c
index 593d3a2..337d067 100644
--- a/src/util/client_new.c
+++ b/src/util/client_new.c
@@ -495,11 +495,12 @@ try_unixpath (const char *service_name,
     sock = GNUNET_NETWORK_socket_create (AF_UNIX,
                                          SOCK_STREAM,
                                          0);
-    if ( (GNUNET_OK ==
-          GNUNET_NETWORK_socket_connect (sock,
-                                         (struct sockaddr *) &s_un,
-                                         sizeof (s_un))) ||
-         (EINPROGRESS == errno) )
+    if ( (NULL != sock) &&
+         ( (GNUNET_OK ==
+            GNUNET_NETWORK_socket_connect (sock,
+                                           (struct sockaddr *) &s_un,
+                                           sizeof (s_un))) ||
+           (EINPROGRESS == errno) ) )
     {
       LOG (GNUNET_ERROR_TYPE_DEBUG,
            "Successfully connected to unixpath `%s'!\n",
diff --git a/src/util/time.c b/src/util/time.c
index eb168d5..89b0c2d 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -446,6 +446,32 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative 
rel,
 
 
 /**
+ * Saturating multiply relative time by a given factor.
+ *
+ * @param rel some duration
+ * @param factor integer to multiply with
+ * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor
+ */
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_saturating_multiply (struct GNUNET_TIME_Relative rel,
+                                          unsigned long long factor)
+{
+  struct GNUNET_TIME_Relative ret;
+
+  if (0 == factor)
+    return GNUNET_TIME_UNIT_ZERO;
+  if (rel.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us)
+    return GNUNET_TIME_UNIT_FOREVER_REL;
+  ret.rel_value_us = rel.rel_value_us * factor;
+  if (ret.rel_value_us / factor != rel.rel_value_us)
+  {
+    return GNUNET_TIME_UNIT_FOREVER_REL;
+  }
+  return ret;
+}
+
+
+/**
  * Divide relative time by a given factor.
  *
  * @param rel some duration
diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c
index b22b805..4add41c 100644
--- a/src/vpn/vpn_api.c
+++ b/src/vpn/vpn_api.c
@@ -352,7 +352,7 @@ reconnect (struct GNUNET_VPN_Handle *vh)
   for (rr = vh->rr_head; NULL != rr; rr = rr->next)
     rr->request_id = 0;
   vh->backoff = GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS,
-                                         GNUNET_TIME_relative_min 
(GNUNET_TIME_relative_multiply (vh->backoff, 2),
+                                         GNUNET_TIME_relative_min 
(GNUNET_TIME_relative_saturating_multiply (vh->backoff, 2),
                                                                    
GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)));
   vh->rt = GNUNET_SCHEDULER_add_delayed (vh->backoff,
                                         &connect_task,


hooks/post-receive
-- 
Main GNUnet code base.



reply via email to

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