[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35600 - gnunet/src/cadet
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35600 - gnunet/src/cadet |
Date: |
Mon, 27 Apr 2015 21:14:44 +0200 |
Author: bartpolot
Date: 2015-04-27 21:14:44 +0200 (Mon, 27 Apr 2015)
New Revision: 35600
Modified:
gnunet/src/cadet/cadet_protocol.h
gnunet/src/cadet/gnunet-service-cadet_connection.c
gnunet/src/cadet/gnunet-service-cadet_peer.c
gnunet/src/cadet/gnunet-service-cadet_tunnel.c
Log:
- refactor kx sending, unify under send_kx
Modified: gnunet/src/cadet/cadet_protocol.h
===================================================================
--- gnunet/src/cadet/cadet_protocol.h 2015-04-27 19:14:42 UTC (rev 35599)
+++ gnunet/src/cadet/cadet_protocol.h 2015-04-27 19:14:44 UTC (rev 35600)
@@ -120,11 +120,6 @@
* Type: GNUNET_MESSAGE_TYPE_CADET_AX_KX.
*/
struct GNUNET_MessageHeader header;
-
- /**
- * ID of the connection.
- */
- struct GNUNET_CADET_Hash cid;
/**
* Sender's ephemeral public ECC key (always for NIST P-521) encoded in a
Modified: gnunet/src/cadet/gnunet-service-cadet_connection.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_connection.c 2015-04-27 19:14:42 UTC
(rev 35599)
+++ gnunet/src/cadet/gnunet-service-cadet_connection.c 2015-04-27 19:14:44 UTC
(rev 35600)
@@ -3108,7 +3108,6 @@
{
struct GNUNET_CADET_Encrypted *emsg;
struct GNUNET_CADET_KX *kmsg;
- struct GNUNET_CADET_AX_KX *axkxmsg;
struct GNUNET_CADET_ACK *amsg;
struct GNUNET_CADET_Poll *pmsg;
struct GNUNET_CADET_ConnectionDestroy *dmsg;
@@ -3149,11 +3148,6 @@
kmsg->cid = c->id;
break;
- case GNUNET_MESSAGE_TYPE_CADET_AX_KX:
- axkxmsg = (struct GNUNET_CADET_AX_KX *) data;
- axkxmsg->cid = c->id;
- break;
-
case GNUNET_MESSAGE_TYPE_CADET_ACK:
amsg = (struct GNUNET_CADET_ACK *) data;
amsg->cid = c->id;
Modified: gnunet/src/cadet/gnunet-service-cadet_peer.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_peer.c 2015-04-27 19:14:42 UTC
(rev 35599)
+++ gnunet/src/cadet/gnunet-service-cadet_peer.c 2015-04-27 19:14:44 UTC
(rev 35600)
@@ -926,8 +926,6 @@
case GNUNET_MESSAGE_TYPE_CADET_ACK:
case GNUNET_MESSAGE_TYPE_CADET_POLL:
case GNUNET_MESSAGE_TYPE_CADET_KX:
- case GNUNET_MESSAGE_TYPE_CADET_AX_KX:
- case GNUNET_MESSAGE_TYPE_CADET_AX:
case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE:
case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_ACK:
case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY:
@@ -935,6 +933,7 @@
return GNUNET_YES;
case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED:
+ case GNUNET_MESSAGE_TYPE_CADET_AX:
break;
default:
Modified: gnunet/src/cadet/gnunet-service-cadet_tunnel.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_tunnel.c 2015-04-27 19:14:42 UTC
(rev 35599)
+++ gnunet/src/cadet/gnunet-service-cadet_tunnel.c 2015-04-27 19:14:44 UTC
(rev 35600)
@@ -1570,7 +1570,7 @@
uint16_t type, int fwd, size_t size)
{
struct CadetTunnel *t = cls;
- LOG (GNUNET_ERROR_TYPE_DEBUG, "ephm_sent %s\n", GC_m2s (type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "ephemeral sent %s\n", GC_m2s (type));
t->ephm_h = NULL;
}
@@ -1621,7 +1621,6 @@
/* Avoid loopback. */
if (GCT_is_loopback (t))
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, " loopback!\n");
GNUNET_break (0);
return NULL;
}
@@ -1635,7 +1634,7 @@
/* Must have a connection, or be looking for one. */
if (NULL == t->connection_head)
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, "%s while no connection\n", GC_m2s (type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "%s with no connection\n", GC_m2s (type));
if (CADET_TUNNEL_SEARCHING != t->cstate)
{
GNUNET_break (0);
@@ -1651,8 +1650,7 @@
c = tunnel_get_connection (t);
if (NULL == c)
{
- if (NULL == t->destroy_task
- && CADET_TUNNEL_READY == t->cstate)
+ if (NULL == t->destroy_task && CADET_TUNNEL_READY == t->cstate)
{
GNUNET_break (0);
GCT_debug (t, GNUNET_ERROR_TYPE_ERROR);
@@ -1662,20 +1660,20 @@
switch (type)
{
case GNUNET_MESSAGE_TYPE_CADET_KX_EPHEMERAL:
+ case GNUNET_MESSAGE_TYPE_CADET_AX_KX:
GNUNET_assert (NULL == t->ephm_h);
cont = &ephm_sent;
- memcpy (&msg[1], message, size);
break;
case GNUNET_MESSAGE_TYPE_CADET_KX_PONG:
GNUNET_assert (NULL == t->pong_h);
cont = &pong_sent;
- memcpy (&msg[1], message, size);
break;
default:
LOG (GNUNET_ERROR_TYPE_DEBUG, "unkown type %s\n", GC_m2s (type));
GNUNET_assert (0);
}
+ memcpy (&msg[1], message, size);
fwd = GCC_is_origin (c, GNUNET_YES);
@@ -3639,7 +3637,6 @@
GCT_send_ax_kx (struct CadetTunnel *t)
{
struct GNUNET_CADET_AX_KX msg;
- struct CadetConnection *c;
LOG (GNUNET_ERROR_TYPE_INFO, "===> AX_KX for %s\n", GCT_2s (t));
@@ -3648,11 +3645,7 @@
GNUNET_CRYPTO_ecdhe_key_get_public (t->ax->kx_0, &msg.ephemeral_key);
GNUNET_CRYPTO_ecdhe_key_get_public (t->ax->DHRs, &msg.ratchet_key);
- c = tunnel_get_connection (t);
- /* TODO: save queue */
- GCC_send_prebuilt_message (&msg.header, GNUNET_MESSAGE_TYPE_CADET_AX_KX, 0,
- c, GCC_is_origin (c, GNUNET_YES), GNUNET_NO,
- NULL, NULL);
+ t->ephm_h = send_kx (t, &msg);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35600 - gnunet/src/cadet,
gnunet <=