removing 'publicKey' argument from CORE init callback
authorChristian Grothoff <christian@grothoff.org>
Fri, 7 Oct 2011 11:08:40 +0000 (11:08 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 7 Oct 2011 11:08:40 +0000 (11:08 +0000)
25 files changed:
src/chat/gnunet-service-chat.c
src/core/core.h
src/core/core_api.c
src/core/gnunet-service-core.c
src/core/gnunet-service-core_clients.c
src/core/test_core_api.c
src/core/test_core_api_preferences.c
src/core/test_core_api_reliability.c
src/core/test_core_api_start_only.c
src/core/test_core_quota_compliance.c
src/dht/gnunet-service-dht_neighbours.c
src/dv/gnunet-service-dv.c
src/dv/test_transport_api_dv.c
src/fs/gnunet-service-fs.c
src/hostlist/gnunet-daemon-hostlist.c
src/include/gnunet_core_service.h
src/include/gnunet_transport_service.h
src/mesh/gnunet-service-mesh.c
src/mesh/mesh_api.c
src/nse/gnunet-service-nse.c
src/testing/test_testing_large_topology.c
src/testing/test_testing_topology.c
src/testing/testing.c
src/testing/testing_group.c
src/topology/gnunet-daemon-topology.c

index ed8dfb9e9f1d831bd1e25ccff24c7ab57e7cee62..2d6f192ece4f4efbca1043b6fd00b02f3c974de9 100644 (file)
@@ -1641,12 +1641,10 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * @param cls closure, NULL
  * @param server handle to the server for this service
  * @param my_identity the public identity of this peer
- * @param publicKey the public key of this peer
  */
 static void
 core_init (void *cls, struct GNUNET_CORE_Handle *server,
-           const struct GNUNET_PeerIdentity *my_identity,
-           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+           const struct GNUNET_PeerIdentity *my_identity)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Core initialized\n");
   me = my_identity;
index 17a4c8fd4500183a4eae1fa2ca7e1417b364672c..8c208a2ede13a3bd4b2f4ac86fa68f02c0ee4eec 100644 (file)
@@ -95,7 +95,7 @@ struct InitReplyMessage
   /**
    * Public key of the local peer.
    */
-  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded publicKey;
+  struct GNUNET_PeerIdentity my_identity;
 
 };
 
index 3624a6e7f5901a07d5cb65b6cb4aeec6e8289ffb..24013b7cf66b385e3815d2c33500bcb6a957fb26 100644 (file)
@@ -870,9 +870,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
       trigger_next_request (h, GNUNET_NO);
     }
     h->retry_backoff = GNUNET_TIME_UNIT_MILLISECONDS;
-    GNUNET_CRYPTO_hash (&m->publicKey,
-                        sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
-                        &h->me.hashPubKey);
+    h->me = m->my_identity;
     if (NULL != (init = h->init))
     {
       /* mark so we don't call init on reconnect */
@@ -882,7 +880,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
                   "Connected to core service of peer `%s'.\n",
                   GNUNET_i2s (&h->me));
 #endif
-      init (h->cls, h, &h->me, &m->publicKey);
+      init (h->cls, h, &h->me);
     }
     else
     {
index 76ed02d2f4ef8049997e6965013430cfe1799181..34b35f92a122136f9cffcb2394398b5ba9a77a7d 100644 (file)
@@ -1393,8 +1393,7 @@ handle_client_init (void *cls, struct GNUNET_SERVER_Client *client,
   irm.header.size = htons (sizeof (struct InitReplyMessage));
   irm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY);
   irm.reserved = htonl (0);
-  memcpy (&irm.publicKey, &my_public_key,
-          sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded));
+  irm.my_identity = my_identity;
 #if DEBUG_CORE_CLIENT
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message to client.\n",
               "INIT_REPLY");
index 7b884f44fd80a1edc57f3d8c35438043de73893f..94fecb4ca6fecb2355d302a7f2a7da3d72ba0c7c 100644 (file)
@@ -289,7 +289,7 @@ handle_client_init (void *cls, struct GNUNET_SERVER_Client *client,
   irm.header.size = htons (sizeof (struct InitReplyMessage));
   irm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY);
   irm.reserved = htonl (0);
-  irm.publicKey = GSC_my_public_key;
+  irm.my_identity = GSC_my_identity;
   send_to_client (c, &irm.header, GNUNET_NO);
   if (0 != (c->options & GNUNET_CORE_OPTION_SEND_CONNECT))
     GSC_SESSIONS_notify_client_about_sessions (c);
index 3028f32b0c60ff91eebecd8a0e7c821da6a6c5df..7695f9e86b893fe3df79cf5fb744a2493effa5b6 100644 (file)
@@ -283,8 +283,7 @@ connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 init_notify (void *cls, struct GNUNET_CORE_Handle *server,
-             const struct GNUNET_PeerIdentity *my_identity,
-             const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+             const struct GNUNET_PeerIdentity *my_identity)
 {
   struct PeerContext *p = cls;
 
index 3aeb925726c12c655292d8c94054b804b577b671..19d51ef60d725fb5a252a473ca0825cb31c990ee 100644 (file)
@@ -346,8 +346,7 @@ ask_connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 init_notify (void *cls, struct GNUNET_CORE_Handle *server,
-             const struct GNUNET_PeerIdentity *my_identity,
-             const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+             const struct GNUNET_PeerIdentity *my_identity)
 {
   struct PeerContext *p = cls;
 
index 7627a32c062268862dfe76ab4e2b51eaceca2b04..a696c7cbdb9a8ee5dcb169ee5b8d2372d9efa8a2 100644 (file)
@@ -365,8 +365,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = {
 
 static void
 init_notify (void *cls, struct GNUNET_CORE_Handle *server,
-             const struct GNUNET_PeerIdentity *my_identity,
-             const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+             const struct GNUNET_PeerIdentity *my_identity)
 {
   struct PeerContext *p = cls;
 
index ff4b564bfe7bbebccca4842cb7888f53c985c5bb..6b1f3da1c88587e99bad47edb1db1515ac2315d9 100644 (file)
@@ -116,8 +116,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 init_notify (void *cls, struct GNUNET_CORE_Handle *server,
-             const struct GNUNET_PeerIdentity *my_identity,
-             const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+             const struct GNUNET_PeerIdentity *my_identity)
 {
   struct PeerContext *p = cls;
 
index 6f10635febcb5b0aac8016e2dfebae3d59b0d0fe..5fce06b31d0f8d7118c31d0bd9587a2e1584d558 100644 (file)
@@ -504,8 +504,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = {
 
 static void
 init_notify (void *cls, struct GNUNET_CORE_Handle *server,
-             const struct GNUNET_PeerIdentity *my_identity,
-             const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+             const struct GNUNET_PeerIdentity *my_identity)
 {
   struct PeerContext *p = cls;
 
index 418474c74aa60270f3bb48648e903ea44bad5ec5..9d4885b78aad5df2dcf18d694b8cd75d1647965c 100644 (file)
@@ -1527,12 +1527,10 @@ GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target,
  * @param cls service closure
  * @param server handle to the server for this service
  * @param identity the public identity of this peer
- * @param publicKey the public key of this peer
  */
 static void
 core_init (void *cls, struct GNUNET_CORE_Handle *server,
-           const struct GNUNET_PeerIdentity *identity,
-           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+           const struct GNUNET_PeerIdentity *identity)
 {
   GNUNET_assert (server != NULL);
   my_identity = *identity;
index 6699fef1128e3edae2ce5525a4c1ab96e8a5e10b..0940fd9f0cef82b6cf2fdcf07db3fd1ca5dc89f6 100644 (file)
@@ -2286,8 +2286,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  */
 void
 core_init (void *cls, struct GNUNET_CORE_Handle *server,
-           const struct GNUNET_PeerIdentity *identity,
-           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+           const struct GNUNET_PeerIdentity *identity)
 {
 
   if (server == NULL)
index 0e8444bd45c8598b0eace635213220b502dd8e58..21fe7225ec69c425ddd4fc032dd53e973f64be48 100644 (file)
@@ -560,9 +560,7 @@ connect_notify_peer2 (void *cls, const struct GNUNET_PeerIdentity *peer,
 
 static void
 init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server,
-                   const struct GNUNET_PeerIdentity *my_identity,
-                   const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                   *publicKey)
+                   const struct GNUNET_PeerIdentity *my_identity)
 {
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -605,9 +603,7 @@ connect_notify_peer1 (void *cls, const struct GNUNET_PeerIdentity *peer,
 
 static void
 init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server,
-                   const struct GNUNET_PeerIdentity *my_identity,
-                   const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                   *publicKey)
+                   const struct GNUNET_PeerIdentity *my_identity)
 {
   total_server_connections++;
 #if VERBOSE
index 2e3c7742f55f645e88bd6c8ea8ac0a9c658215a8..f2770df3e59ec1bf5d992aae36aaa8e48314480d 100644 (file)
@@ -462,13 +462,10 @@ peer_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
  * @param cls closure
  * @param server handle to the server, NULL if we failed
  * @param my_identity ID of this peer, NULL if we failed
- * @param publicKey public key of this peer, NULL if we failed
  */
 static void
 peer_init_handler (void *cls, struct GNUNET_CORE_Handle *server,
-                   const struct GNUNET_PeerIdentity *my_identity,
-                   const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                   *publicKey)
+                   const struct GNUNET_PeerIdentity *my_identity)
 {
   my_id = *my_identity;
 }
index 9d47dfa9cfffb1dc1427990af82ddb219f191336..859f8498c51409e07fe17bfafc04ff06e742b1c9 100644 (file)
@@ -129,8 +129,7 @@ static struct GNUNET_PeerIdentity me;
 
 static void
 core_init (void *cls, struct GNUNET_CORE_Handle *server,
-           const struct GNUNET_PeerIdentity *my_identity,
-           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+           const struct GNUNET_PeerIdentity *my_identity)
 {
   me = *my_identity;
 }
index 11514ae29f0df0d0b462eed7475c5e3eadf8b0d6..f33a78926c9f9a72981808862e443d876be956d7 100644 (file)
@@ -153,24 +153,19 @@ struct GNUNET_CORE_MessageHandler
 
 
 /**
- * Function called after GNUNET_CORE_connect has succeeded
- * (or failed for good).  Note that the private key of the
- * peer is intentionally not exposed here; if you need it,
- * your process should try to read the private key file
- * directly (which should work if you are authorized...).
+ * Function called after GNUNET_CORE_connect has succeeded (or failed
+ * for good).  Note that the private key of the peer is intentionally
+ * not exposed here; if you need it, your process should try to read
+ * the private key file directly (which should work if you are
+ * authorized...).
  *
  * @param cls closure
  * @param server handle to the server, NULL if we failed
  * @param my_identity ID of this peer, NULL if we failed
- * @param publicKey public key of this peer, NULL if we failed
  */
 typedef void (*GNUNET_CORE_StartupCallback) (void *cls,
                                              struct GNUNET_CORE_Handle * server,
-                                             const struct GNUNET_PeerIdentity *
-                                             my_identity,
-                                             const struct
-                                             GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                                             * publicKey);
+                                             const struct GNUNET_PeerIdentity *my_identity);
 
 
 /**
index 8b9472cdb8a24924a2a89b4298f484e16e0fa4e9..2b6675c89b661b75ede5420fd96519f6297ca600 100644 (file)
@@ -547,7 +547,7 @@ struct GNUNET_TRANSPORT_TransmitHandle;
  * @param handle connection to transport service
  * @param target who should receive the message
  * @param size how big is the message we want to transmit?
- * @param priority how important is the message?
+ * @param priority how important is the message? @deprecated - remove?
  * @param timeout after how long should we give up (and call
  *        notify with buf NULL and size 0)?
  * @param notify function to call when we are ready to
index c9ac99708310935bfd18db164fb4516fe0673031..a35ef9a66b18c0b79f37c7373ece2e50ad878686 100644 (file)
@@ -3141,12 +3141,10 @@ static struct GNUNET_SERVER_MessageHandler client_handlers[] = {
  * @param cls service closure
  * @param server handle to the server for this service
  * @param identity the public identity of this peer
- * @param publicKey the public key of this peer
  */
 static void
 core_init (void *cls, struct GNUNET_CORE_Handle *server,
-           const struct GNUNET_PeerIdentity *identity,
-           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+           const struct GNUNET_PeerIdentity *identity)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: Core init\n");
   core_handle = server;
index a1396cd085e6f6dc85a2e7c0468aeb888530c8b6..4e510e596e19d015d4b30f23de5b657263b45473 100644 (file)
@@ -182,9 +182,7 @@ call_connect_handler (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 static void
 core_startup (void *cls, struct GNUNET_CORE_Handle *core
               __attribute__ ((unused)),
-              const struct GNUNET_PeerIdentity *my_identity,
-              const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey
-              __attribute__ ((unused)))
+              const struct GNUNET_PeerIdentity *my_identity)
 {
   struct GNUNET_MESH_Handle *handle = cls;
 
index 543e4794aed97b8807bb19cc999bd0f70cc4f29e..47014fd60bc559d79b58785413f1a50ff4184e57 100644 (file)
@@ -1211,12 +1211,10 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * @param cls service closure
  * @param server handle to the server for this service
  * @param identity the public identity of this peer
- * @param publicKey the public key of this peer
  */
 static void
 core_init (void *cls, struct GNUNET_CORE_Handle *server,
-           const struct GNUNET_PeerIdentity *identity,
-           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+           const struct GNUNET_PeerIdentity *identity)
 {
   struct GNUNET_TIME_Absolute now;
   struct GNUNET_TIME_Absolute prev_time;
index 9581dc9b2a59e94620a124704ed524f4814199cd..33a9eb7879a29c5c2f0bd83e30a5b975eedf7431 100644 (file)
@@ -459,9 +459,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = {
 
 static void
 init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server,
-                   const struct GNUNET_PeerIdentity *my_identity,
-                   const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                   *publicKey)
+                   const struct GNUNET_PeerIdentity *my_identity)
 {
   struct TestMessageContext *pos = cls;
 
@@ -547,9 +545,7 @@ connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer,
 
 static void
 init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server,
-                   const struct GNUNET_PeerIdentity *my_identity,
-                   const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                   *publicKey)
+                   const struct GNUNET_PeerIdentity *my_identity)
 {
   struct TestMessageContext *pos = cls;
 
index 152b5cdcc6f1128ad05f7fc682bfce6b25138a41..e29a3ff321d44663eb64bfcb50678db26469b8e4 100644 (file)
@@ -498,9 +498,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = {
 
 static void
 init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server,
-                   const struct GNUNET_PeerIdentity *my_identity,
-                   const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                   *publicKey)
+                   const struct GNUNET_PeerIdentity *my_identity)
 {
   struct TestMessageContext *pos = cls;
 
@@ -586,9 +584,7 @@ connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer,
 
 static void
 init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server,
-                   const struct GNUNET_PeerIdentity *my_identity,
-                   const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                   *publicKey)
+                   const struct GNUNET_PeerIdentity *my_identity)
 {
   struct TestMessageContext *pos = cls;
 
index 8b080d800fee3946bfe24e46484a889d612fc1f7..ca7ed637640e91d1158bd11ce87cb4d29db49cfc 100644 (file)
@@ -1952,13 +1952,10 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * @param cls a ConnectContext
  * @param server handle to the core service
  * @param my_identity the peer identity of this peer
- * @param publicKey the public key of the peer
  */
 void
 core_init_notify (void *cls, struct GNUNET_CORE_Handle *server,
-                  const struct GNUNET_PeerIdentity *my_identity,
-                  const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                  *publicKey)
+                  const struct GNUNET_PeerIdentity *my_identity)
 {
   struct GNUNET_TESTING_ConnectContext *connect_ctx = cls;
 
index 3f31c6e1a94ae2cd402f37c61e9dba79d6a5f614..1889cf7dfd86864091024201ee8b08da87cacd56 100644 (file)
@@ -3483,12 +3483,10 @@ core_connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
  * @param cls a struct SendHelloContext *
  * @param server handle to the core service
  * @param my_identity the peer identity of this peer
- * @param publicKey the public key of the peer
  */
 void
 core_init (void *cls, struct GNUNET_CORE_Handle *server,
-           const struct GNUNET_PeerIdentity *my_identity,
-           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+          struct GNUNET_PeerIdentity *my_identity)
 {
   struct SendHelloContext *send_hello_context = cls;
 
index 6f55419d9010c9b254c863008f67c40bb2b9913c..e8704552bfcfc2dd0f1dc9a5c1e968e86c4d824a 100644 (file)
@@ -938,12 +938,10 @@ process_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
  * @param cls closure
  * @param server handle to the server, NULL if we failed
  * @param my_id ID of this peer, NULL if we failed
- * @param publicKey public key of this peer, NULL if we failed
  */
 static void
 core_init (void *cls, struct GNUNET_CORE_Handle *server,
-           const struct GNUNET_PeerIdentity *my_id,
-           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+           const struct GNUNET_PeerIdentity *my_id)
 {
   if (server == NULL)
   {