gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36795 - in gnunet/src: . identity identity-provider includ


From: gnunet
Subject: [GNUnet-SVN] r36795 - in gnunet/src: . identity identity-provider include rest
Date: Thu, 7 Jan 2016 22:10:24 +0100

Author: schanzen
Date: 2016-01-07 22:10:24 +0100 (Thu, 07 Jan 2016)
New Revision: 36795

Added:
   gnunet/src/identity-provider/
   gnunet/src/include/gnunet_identity_provider_lib.h
Removed:
   gnunet/src/identity-provider/identity-token.h
   gnunet/src/identity-token/
Modified:
   gnunet/src/Makefile.am
   gnunet/src/identity/plugin_gnsrecord_identity.c
   gnunet/src/include/gnunet_signatures.h
   gnunet/src/rest/gnunet-rest-server.c
Log:
- Finish refactoring


Modified: gnunet/src/Makefile.am
===================================================================
--- gnunet/src/Makefile.am      2016-01-07 21:02:11 UTC (rev 36794)
+++ gnunet/src/Makefile.am      2016-01-07 21:10:24 UTC (rev 36795)
@@ -28,7 +28,7 @@
 endif
 
 if HAVE_REST
-       EXP_DIR += identity-token
+       EXP_DIR += identity-provider
 endif
 
 if BUILD_PULSE_HELPERS

Modified: gnunet/src/identity/plugin_gnsrecord_identity.c
===================================================================
--- gnunet/src/identity/plugin_gnsrecord_identity.c     2016-01-07 21:02:11 UTC 
(rev 36794)
+++ gnunet/src/identity/plugin_gnsrecord_identity.c     2016-01-07 21:10:24 UTC 
(rev 36795)
@@ -44,11 +44,31 @@
                  const void *data,
                  size_t data_size)
 {
+  const struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey;
+  const struct GNUNET_CRYPTO_EcdsaPublicKey *audience_pubkey;
+  const char *scopes;
+  char *ecdhe_str;
+  char *aud_str;
+  char *result;
+
   switch (type)
   {
     case GNUNET_GNSRECORD_TYPE_ID_ATTR:
     case GNUNET_GNSRECORD_TYPE_ID_TOKEN:
       return GNUNET_strndup (data, data_size);
+    case GNUNET_GNSRECORD_TYPE_ID_TOKEN_METADATA:
+        ecdhe_privkey = data;
+        audience_pubkey = data+sizeof (struct GNUNET_CRYPTO_EcdhePrivateKey);
+        scopes =  (char*) audience_pubkey+(sizeof (struct 
GNUNET_CRYPTO_EcdsaPublicKey));
+        ecdhe_str = GNUNET_STRINGS_data_to_string_alloc (ecdhe_privkey,
+                                                        sizeof (struct 
GNUNET_CRYPTO_EcdhePrivateKey));
+        aud_str = GNUNET_STRINGS_data_to_string_alloc (audience_pubkey,
+                                                       sizeof (struct 
GNUNET_CRYPTO_EcdsaPublicKey));
+        GNUNET_asprintf (&result,
+                         "%s;%s;%s",
+                         ecdhe_str, aud_str, scopes);
+        return result;
+
     default:
       return NULL;
   }
@@ -73,6 +93,12 @@
                  void **data,
                  size_t *data_size)
 {
+  char* ecdhe_str;
+  char* aud_keystr;
+  char* write_ptr;
+  char* tmp_tok;
+  char* str;
+
   if (NULL == s)
     return GNUNET_SYSERR;
   switch (type)
@@ -82,6 +108,46 @@
       *data = GNUNET_strdup (s);
       *data_size = strlen (s);
       return GNUNET_OK;
+    case GNUNET_GNSRECORD_TYPE_ID_TOKEN_METADATA:
+            tmp_tok = GNUNET_strdup (s);
+      ecdhe_str = strtok (tmp_tok, ";");
+      if (NULL == ecdhe_str)
+      {
+        GNUNET_free (tmp_tok);
+        return GNUNET_SYSERR;
+      }
+      aud_keystr = strtok (NULL, ";");
+      if (NULL == aud_keystr)
+      {
+        GNUNET_free (tmp_tok);
+        return GNUNET_SYSERR;
+      }
+      str = strtok (NULL, ";");
+      if (NULL == str)
+      {
+        GNUNET_free (tmp_tok);
+        return GNUNET_SYSERR;
+      }
+      *data_size = strlen (str) + 1
+        +sizeof (struct GNUNET_CRYPTO_EcdhePrivateKey)
+        +sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
+      *data = GNUNET_malloc (*data_size);
+
+      write_ptr = *data;
+      GNUNET_STRINGS_string_to_data (ecdhe_str,
+                                     strlen (ecdhe_str),
+                                     write_ptr,
+                                     sizeof (struct 
GNUNET_CRYPTO_EcdhePrivateKey));
+      write_ptr += sizeof (struct GNUNET_CRYPTO_EcdhePrivateKey);
+      GNUNET_STRINGS_string_to_data (aud_keystr,
+                                     strlen (aud_keystr),
+                                     write_ptr,
+                                     sizeof (struct 
GNUNET_CRYPTO_EcdsaPublicKey));
+      write_ptr += sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
+      memcpy (write_ptr, str, strlen (str) + 1); //with 0-Terminator
+      GNUNET_free (tmp_tok);
+      return GNUNET_OK;
+
     default:
       return GNUNET_SYSERR;
   }
@@ -92,14 +158,15 @@
  * Mapping of record type numbers to human-readable
  * record type names.
  */
-static struct {
-  const char *name;
-  uint32_t number;
-} name_map[] = {
-  { "ID_ATTR", GNUNET_GNSRECORD_TYPE_ID_ATTR },
-  { "ID_TOKEN", GNUNET_GNSRECORD_TYPE_ID_TOKEN },
-  { NULL, UINT32_MAX }
-};
+        static struct {
+          const char *name;
+          uint32_t number;
+        } name_map[] = {
+          { "ID_ATTR", GNUNET_GNSRECORD_TYPE_ID_ATTR },
+          { "ID_TOKEN", GNUNET_GNSRECORD_TYPE_ID_TOKEN },
+          { "ID_TOKEN_METADATA", GNUNET_GNSRECORD_TYPE_ID_TOKEN_METADATA },
+          { NULL, UINT32_MAX }
+        };
 
 
 /**

Deleted: gnunet/src/identity-provider/identity-token.h
===================================================================
--- gnunet/src/identity-token/identity-token.h  2016-01-07 21:02:11 UTC (rev 
36794)
+++ gnunet/src/identity-provider/identity-token.h       2016-01-07 21:10:24 UTC 
(rev 36795)
@@ -1,269 +0,0 @@
-/*
-   This file is part of GNUnet.
-   Copyright (C) 2012-2015 Christian Grothoff (and other contributing authors)
-
-   GNUnet is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published
-   by the Free Software Foundation; either version 3, or (at your
-   option) any later version.
-
-   GNUnet is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with GNUnet; see the file COPYING.  If not, write to the
-   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-   */
-/**
- * @author Martin Schanzenbach
- * @file include/gnunet_identity_provider_lib.h
- * @brief GNUnet Identity Provider library
- *
- */
-#ifndef GNUNET_IDENTITY_PROVIDER_LIB_H
-#define GNUNET_IDENTITY_PROVIDER_LIB_H
-
-#include "gnunet_crypto_lib.h"
-#include <jansson.h>
-
-struct GNUNET_IDENTITY_PROVIDER_Token
-{
-  /**
-   * JSON header
-   */
-  json_t *header;
-
-  /**
-   * JSON Payload
-   */
-  json_t *payload;
-
-  /**
-   * Token Signature
-   */
-  struct GNUNET_CRYPTO_EcdsaSignature signature;
-  
-  /**
-   * Audience Pubkey
-   */
-  struct GNUNET_CRYPTO_EcdsaPublicKey aud_key;
-};
-
-struct GNUNET_IDENTITY_PROVIDER_TokenTicketPayload
-{
-  /**
-   * Nonce
-   */
-  char* nonce;
-
-  /**
-   * Label
-   */
-  char *label;
-
-  /**
-   * Issuing Identity
-   */
-  struct GNUNET_CRYPTO_EcdsaPublicKey identity_key;
-};
-
-
-struct GNUNET_IDENTITY_PROVIDER_TokenTicket
-{
-  /**
-   * Meta info
-   */
-  struct GNUNET_IDENTITY_PROVIDER_TokenTicketPayload *payload;
-
-  /**
-   * ECDH Pubkey
-   */
-  struct GNUNET_CRYPTO_EcdhePublicKey ecdh_pubkey;
-
-  /**
-   * Signature
-   */
-  struct GNUNET_CRYPTO_EcdsaSignature signature;
-
-  /**
-   * Target identity
-   */
-  struct GNUNET_CRYPTO_EcdsaPublicKey aud_key;
-};
-
-
-
-/**
- * Create an identity token
- *
- * @param iss the issuer string for the token
- * @param aud the audience of the token
- *
- * @return a new token
- */
-struct GNUNET_IDENTITY_PROVIDER_Token*
-GNUNET_IDENTITY_PROVIDER_token_create (const struct 
GNUNET_CRYPTO_EcdsaPublicKey *iss,
-                                       const struct 
GNUNET_CRYPTO_EcdsaPublicKey* aud);
-
-/**
- * Destroy an identity token
- *
- * @param token the token to destroy
- */
-void
-GNUNET_IDENTITY_PROVIDER_token_destroy (struct GNUNET_IDENTITY_PROVIDER_Token 
*token);
-
-/**
- * Add a new key value pair to the token
- * 
- * @param token the token to modify
- * @param key the key
- * @param value the value
- */
-void
-GNUNET_IDENTITY_PROVIDER_token_add_attr (const struct 
GNUNET_IDENTITY_PROVIDER_Token *token,
-                                         const char* key,
-                                         const char* value);
-
-/**
- * Add a new key value pair to the token with the value as json
- *
- * @param the token to modify
- * @param key the key
- * @param value the value
- *
- */
-void
-GNUNET_IDENTITY_PROVIDER_token_add_json (const struct 
GNUNET_IDENTITY_PROVIDER_Token *token,
-                         const char* key,
-                         json_t* value);
-
-/**
- * Serialize a token. The token will be signed and base64 according to the
- * JWT format. The signature is base32-encoded ECDSA.
- * The resulting JWT is encrypted using 
- * ECDHE for the audience and Base64
- * encoded in result. The audience requires the ECDHE public key P 
- * to decrypt the token T. The key P is included in the result and prepended
- * before the token
- *
- * @param token the token to serialize
- * @param priv_key the private key used to sign the token
- * @param ecdhe_privkey the ECDHE private key used to encrypt the token
- * @param result P,Base64(E(T))
- *
- * @return GNUNET_OK on success
- */
-int 
-GNUNET_IDENTITY_PROVIDER_token_serialize (const struct 
GNUNET_IDENTITY_PROVIDER_Token *token,
-                          const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key,
-                          struct GNUNET_CRYPTO_EcdhePrivateKey **ecdhe_privkey,
-                          char **result);
-
-/**
- * Parses the serialized token and returns a token
- *
- * @param data the serialized token
- * @param priv_key the private key of the audience
- * @param result the token
- *
- * @return GNUNET_OK on success
- */
-int
-GNUNET_IDENTITY_PROVIDER_token_parse (const char* data,
-                      const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key,
-                      struct GNUNET_IDENTITY_PROVIDER_Token **result);
-
-/**
- * Parses the serialized token and returns a token
- * This variant is intended for the party that issued the token and also
- * wants to decrypt the serialized token.
- *
- * @param data the serialized token
- * @param priv_key the private (!) ECDHE key
- * @param aud_key the identity of the audience
- * @param result the token
- *
- * @return GNUNET_OK on success
- */
-int
-GNUNET_IDENTITY_PROVIDER_token_parse2 (const char* data,
-                       const struct GNUNET_CRYPTO_EcdhePrivateKey *priv_key,
-                       const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
-                       struct GNUNET_IDENTITY_PROVIDER_Token **result);
-
-
-/**
- *
- * Returns a JWT-string representation of the token
- *
- * @param token the token
- * @param priv_key the private key used to sign the JWT
- * @param result the JWT
- *
- * @return GNUNET_OK on success
- */
-int
-GNUNET_IDENTITY_PROVIDER_token_to_string (const struct 
GNUNET_IDENTITY_PROVIDER_Token *token,
-                          const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key,
-                          char **result);
-
-/**
- *
- * Creates a ticket that can be exchanged by the audience for 
- * the token. The token must be placed under the label
- *
- * @param nonce_str nonce provided by the audience that requested the ticket
- * @param iss_pkey the issuer pubkey used to sign the ticket
- * @param label the label encoded in the ticket
- * @param aud_ley the audience pubkey used to encrypt the ticket payload
- *
- * @return the ticket
- */
-struct GNUNET_IDENTITY_PROVIDER_TokenTicket*
-GNUNET_IDENTITY_PROVIDER_ticket_create (const char* nonce_str,
-                            const struct GNUNET_CRYPTO_EcdsaPublicKey* 
iss_pkey,
-                            const char* lbl_str,
-                            const struct GNUNET_CRYPTO_EcdsaPublicKey 
*aud_key);
-
-/**
- * Serialize a ticket. Returns the Base64 representation of the ticket.
- * Format: Base64( { payload: E(Payload), ecdhe: K, signature: signature } )
- *
- * @param ticket the ticket to serialize
- * @param priv_key the issuer private key to sign the ticket payload
- * @param result the serialized ticket
- *
- * @return GNUNET_OK on success
- */
-int
-GNUNET_IDENTITY_PROVIDER_ticket_serialize (struct 
GNUNET_IDENTITY_PROVIDER_TokenTicket *ticket,
-                               const struct GNUNET_CRYPTO_EcdsaPrivateKey 
*priv_key,
-                               char **result);
-
-/**
- * Destroys a ticket
- *
- * @param the ticket to destroy
- */
-void
-GNUNET_IDENTITY_PROVIDER_ticket_destroy (struct 
GNUNET_IDENTITY_PROVIDER_TokenTicket *ticket);
-
-/**
- * Parses a serialized ticket
- *
- * @param data the serialized ticket
- * @param priv_key the audience private key
- * @param ticket the ticket
- *
- * @return GNUNET_OK on success
- */
-int
-GNUNET_IDENTITY_PROVIDER_ticket_parse (const char* raw_data,
-                           const struct GNUNET_CRYPTO_EcdsaPrivateKey 
*priv_key,
-                           struct GNUNET_IDENTITY_PROVIDER_TokenTicket 
**ticket);
-
-#endif

Copied: gnunet/src/include/gnunet_identity_provider_lib.h (from rev 36794, 
gnunet/src/identity-token/identity-token.h)
===================================================================
--- gnunet/src/include/gnunet_identity_provider_lib.h                           
(rev 0)
+++ gnunet/src/include/gnunet_identity_provider_lib.h   2016-01-07 21:10:24 UTC 
(rev 36795)
@@ -0,0 +1,269 @@
+/*
+   This file is part of GNUnet.
+   Copyright (C) 2012-2015 Christian Grothoff (and other contributing authors)
+
+   GNUnet is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GNUnet is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GNUnet; see the file COPYING.  If not, write to the
+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+   */
+/**
+ * @author Martin Schanzenbach
+ * @file include/gnunet_identity_provider_lib.h
+ * @brief GNUnet Identity Provider library
+ *
+ */
+#ifndef GNUNET_IDENTITY_PROVIDER_LIB_H
+#define GNUNET_IDENTITY_PROVIDER_LIB_H
+
+#include "gnunet_crypto_lib.h"
+#include <jansson.h>
+
+struct GNUNET_IDENTITY_PROVIDER_Token
+{
+  /**
+   * JSON header
+   */
+  json_t *header;
+
+  /**
+   * JSON Payload
+   */
+  json_t *payload;
+
+  /**
+   * Token Signature
+   */
+  struct GNUNET_CRYPTO_EcdsaSignature signature;
+  
+  /**
+   * Audience Pubkey
+   */
+  struct GNUNET_CRYPTO_EcdsaPublicKey aud_key;
+};
+
+struct GNUNET_IDENTITY_PROVIDER_TokenTicketPayload
+{
+  /**
+   * Nonce
+   */
+  char* nonce;
+
+  /**
+   * Label
+   */
+  char *label;
+
+  /**
+   * Issuing Identity
+   */
+  struct GNUNET_CRYPTO_EcdsaPublicKey identity_key;
+};
+
+
+struct GNUNET_IDENTITY_PROVIDER_TokenTicket
+{
+  /**
+   * Meta info
+   */
+  struct GNUNET_IDENTITY_PROVIDER_TokenTicketPayload *payload;
+
+  /**
+   * ECDH Pubkey
+   */
+  struct GNUNET_CRYPTO_EcdhePublicKey ecdh_pubkey;
+
+  /**
+   * Signature
+   */
+  struct GNUNET_CRYPTO_EcdsaSignature signature;
+
+  /**
+   * Target identity
+   */
+  struct GNUNET_CRYPTO_EcdsaPublicKey aud_key;
+};
+
+
+
+/**
+ * Create an identity token
+ *
+ * @param iss the issuer string for the token
+ * @param aud the audience of the token
+ *
+ * @return a new token
+ */
+struct GNUNET_IDENTITY_PROVIDER_Token*
+GNUNET_IDENTITY_PROVIDER_token_create (const struct 
GNUNET_CRYPTO_EcdsaPublicKey *iss,
+                                       const struct 
GNUNET_CRYPTO_EcdsaPublicKey* aud);
+
+/**
+ * Destroy an identity token
+ *
+ * @param token the token to destroy
+ */
+void
+GNUNET_IDENTITY_PROVIDER_token_destroy (struct GNUNET_IDENTITY_PROVIDER_Token 
*token);
+
+/**
+ * Add a new key value pair to the token
+ * 
+ * @param token the token to modify
+ * @param key the key
+ * @param value the value
+ */
+void
+GNUNET_IDENTITY_PROVIDER_token_add_attr (const struct 
GNUNET_IDENTITY_PROVIDER_Token *token,
+                                         const char* key,
+                                         const char* value);
+
+/**
+ * Add a new key value pair to the token with the value as json
+ *
+ * @param the token to modify
+ * @param key the key
+ * @param value the value
+ *
+ */
+void
+GNUNET_IDENTITY_PROVIDER_token_add_json (const struct 
GNUNET_IDENTITY_PROVIDER_Token *token,
+                         const char* key,
+                         json_t* value);
+
+/**
+ * Serialize a token. The token will be signed and base64 according to the
+ * JWT format. The signature is base32-encoded ECDSA.
+ * The resulting JWT is encrypted using 
+ * ECDHE for the audience and Base64
+ * encoded in result. The audience requires the ECDHE public key P 
+ * to decrypt the token T. The key P is included in the result and prepended
+ * before the token
+ *
+ * @param token the token to serialize
+ * @param priv_key the private key used to sign the token
+ * @param ecdhe_privkey the ECDHE private key used to encrypt the token
+ * @param result P,Base64(E(T))
+ *
+ * @return GNUNET_OK on success
+ */
+int 
+GNUNET_IDENTITY_PROVIDER_token_serialize (const struct 
GNUNET_IDENTITY_PROVIDER_Token *token,
+                          const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key,
+                          struct GNUNET_CRYPTO_EcdhePrivateKey **ecdhe_privkey,
+                          char **result);
+
+/**
+ * Parses the serialized token and returns a token
+ *
+ * @param data the serialized token
+ * @param priv_key the private key of the audience
+ * @param result the token
+ *
+ * @return GNUNET_OK on success
+ */
+int
+GNUNET_IDENTITY_PROVIDER_token_parse (const char* data,
+                      const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key,
+                      struct GNUNET_IDENTITY_PROVIDER_Token **result);
+
+/**
+ * Parses the serialized token and returns a token
+ * This variant is intended for the party that issued the token and also
+ * wants to decrypt the serialized token.
+ *
+ * @param data the serialized token
+ * @param priv_key the private (!) ECDHE key
+ * @param aud_key the identity of the audience
+ * @param result the token
+ *
+ * @return GNUNET_OK on success
+ */
+int
+GNUNET_IDENTITY_PROVIDER_token_parse2 (const char* data,
+                       const struct GNUNET_CRYPTO_EcdhePrivateKey *priv_key,
+                       const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
+                       struct GNUNET_IDENTITY_PROVIDER_Token **result);
+
+
+/**
+ *
+ * Returns a JWT-string representation of the token
+ *
+ * @param token the token
+ * @param priv_key the private key used to sign the JWT
+ * @param result the JWT
+ *
+ * @return GNUNET_OK on success
+ */
+int
+GNUNET_IDENTITY_PROVIDER_token_to_string (const struct 
GNUNET_IDENTITY_PROVIDER_Token *token,
+                          const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key,
+                          char **result);
+
+/**
+ *
+ * Creates a ticket that can be exchanged by the audience for 
+ * the token. The token must be placed under the label
+ *
+ * @param nonce_str nonce provided by the audience that requested the ticket
+ * @param iss_pkey the issuer pubkey used to sign the ticket
+ * @param label the label encoded in the ticket
+ * @param aud_ley the audience pubkey used to encrypt the ticket payload
+ *
+ * @return the ticket
+ */
+struct GNUNET_IDENTITY_PROVIDER_TokenTicket*
+GNUNET_IDENTITY_PROVIDER_ticket_create (const char* nonce_str,
+                            const struct GNUNET_CRYPTO_EcdsaPublicKey* 
iss_pkey,
+                            const char* lbl_str,
+                            const struct GNUNET_CRYPTO_EcdsaPublicKey 
*aud_key);
+
+/**
+ * Serialize a ticket. Returns the Base64 representation of the ticket.
+ * Format: Base64( { payload: E(Payload), ecdhe: K, signature: signature } )
+ *
+ * @param ticket the ticket to serialize
+ * @param priv_key the issuer private key to sign the ticket payload
+ * @param result the serialized ticket
+ *
+ * @return GNUNET_OK on success
+ */
+int
+GNUNET_IDENTITY_PROVIDER_ticket_serialize (struct 
GNUNET_IDENTITY_PROVIDER_TokenTicket *ticket,
+                               const struct GNUNET_CRYPTO_EcdsaPrivateKey 
*priv_key,
+                               char **result);
+
+/**
+ * Destroys a ticket
+ *
+ * @param the ticket to destroy
+ */
+void
+GNUNET_IDENTITY_PROVIDER_ticket_destroy (struct 
GNUNET_IDENTITY_PROVIDER_TokenTicket *ticket);
+
+/**
+ * Parses a serialized ticket
+ *
+ * @param data the serialized ticket
+ * @param priv_key the audience private key
+ * @param ticket the ticket
+ *
+ * @return GNUNET_OK on success
+ */
+int
+GNUNET_IDENTITY_PROVIDER_ticket_parse (const char* raw_data,
+                           const struct GNUNET_CRYPTO_EcdsaPrivateKey 
*priv_key,
+                           struct GNUNET_IDENTITY_PROVIDER_TokenTicket 
**ticket);
+
+#endif

Modified: gnunet/src/include/gnunet_signatures.h
===================================================================
--- gnunet/src/include/gnunet_signatures.h      2016-01-07 21:02:11 UTC (rev 
36794)
+++ gnunet/src/include/gnunet_signatures.h      2016-01-07 21:10:24 UTC (rev 
36795)
@@ -182,9 +182,9 @@
 #define GNUNET_SIGNATURE_PURPOSE_GNUID_TOKEN 26
 
 /**
- * Signature for a GNUid Token Reference
+ * Signature for a GNUid Ticket
  */
-#define GNUNET_SIGNATURE_PURPOSE_GNUID_TOKEN_CODE 27
+#define GNUNET_SIGNATURE_PURPOSE_GNUID_TICKET 27
 
 #if 0                           /* keep Emacsens' auto-indent happy */
 {

Modified: gnunet/src/rest/gnunet-rest-server.c
===================================================================
--- gnunet/src/rest/gnunet-rest-server.c        2016-01-07 21:02:11 UTC (rev 
36794)
+++ gnunet/src/rest/gnunet-rest-server.c        2016-01-07 21:10:24 UTC (rev 
36795)
@@ -464,16 +464,9 @@
   }
   if (NULL != httpd_task)
     GNUNET_SCHEDULER_cancel (httpd_task);
-  if ( (MHD_YES != haveto) &&
-       (-1 == max))
+  if ( (MHD_YES == haveto) ||
+       (-1 != max))
   {
-    /* daemon is idle, kill after timeout */
-    httpd_task = GNUNET_SCHEDULER_add_delayed (MHD_CACHE_TIMEOUT,
-                                               &kill_httpd_task,
-                                               NULL);
-  }
-  else
-  {
     httpd_task =
       GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
                                    tv, wrs, wws,




reply via email to

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