aboutsummaryrefslogtreecommitdiff
path: root/src/core/gnunet-service-core_kx.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-06 21:38:21 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-06 21:38:21 +0000
commitfb40065c4ef973b7fee53473c1a383007a0abf50 (patch)
tree78b87172ddf31aee66a2aebb6305e5352a8c9cc7 /src/core/gnunet-service-core_kx.h
parentca1cd117f6a59c0d19f841f72ac37340284ada57 (diff)
downloadgnunet-fb40065c4ef973b7fee53473c1a383007a0abf50.tar.gz
gnunet-fb40065c4ef973b7fee53473c1a383007a0abf50.zip
make opaque
Diffstat (limited to 'src/core/gnunet-service-core_kx.h')
-rw-r--r--src/core/gnunet-service-core_kx.h141
1 files changed, 1 insertions, 140 deletions
diff --git a/src/core/gnunet-service-core_kx.h b/src/core/gnunet-service-core_kx.h
index 071665a19..5517001da 100644
--- a/src/core/gnunet-service-core_kx.h
+++ b/src/core/gnunet-service-core_kx.h
@@ -30,148 +30,9 @@
30 30
31 31
32/** 32/**
33 * State machine for our P2P encryption handshake. Everyone starts in
34 * "DOWN", if we receive the other peer's key (other peer initiated)
35 * we start in state RECEIVED (since we will immediately send our
36 * own); otherwise we start in SENT. If we get back a PONG from
37 * within either state, we move up to CONFIRMED (the PONG will always
38 * be sent back encrypted with the key we sent to the other peer).
39 */
40enum KxStateMachine
41{
42 /**
43 * No handshake yet.
44 */
45 KX_STATE_DOWN,
46
47 /**
48 * We've sent our session key.
49 */
50 KX_STATE_KEY_SENT,
51
52 /**
53 * We've received the other peers session key.
54 */
55 KX_STATE_KEY_RECEIVED,
56
57 /**
58 * The other peer has confirmed our session key with a message
59 * encrypted with his session key (which we got). Key exchange
60 * is done.
61 */
62 KX_STATE_UP
63};
64
65
66/**
67 * Information about the status of a key exchange with another peer. 33 * Information about the status of a key exchange with another peer.
68 */ 34 */
69struct GSC_KeyExchangeInfo 35struct GSC_KeyExchangeInfo;
70{
71 /**
72 * Identity of the peer.
73 */
74 struct GNUNET_PeerIdentity peer;
75
76 /**
77 * SetKeyMessage to transmit (initialized the first
78 * time our status goes past 'KX_STATE_KEY_SENT').
79 */
80 struct SetKeyMessage skm;
81
82 /**
83 * PING message we transmit to the other peer.
84 */
85 struct PingMessage ping;
86
87 /**
88 * SetKeyMessage we received and did not process yet.
89 */
90 struct SetKeyMessage *skm_received;
91
92 /**
93 * PING message we received from the other peer and
94 * did not process yet (or NULL).
95 */
96 struct PingMessage *ping_received;
97
98 /**
99 * PONG message we received from the other peer and
100 * did not process yet (or NULL).
101 */
102 struct PongMessage *pong_received;
103
104 /**
105 * Non-NULL if we are currently looking up HELLOs for this peer.
106 * for this peer.
107 */
108 struct GNUNET_PEERINFO_IteratorContext *pitr;
109
110 /**
111 * Public key of the neighbour, NULL if we don't have it yet.
112 */
113 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key;
114
115 /**
116 * We received a PONG message before we got the "public_key"
117 * (or the SET_KEY). We keep it here until we have a key
118 * to decrypt it. NULL if no PONG is pending.
119 */
120 struct PongMessage *pending_pong;
121
122 /**
123 * Key we use to encrypt our messages for the other peer
124 * (initialized by us when we do the handshake).
125 */
126 struct GNUNET_CRYPTO_AesSessionKey encrypt_key;
127
128 /**
129 * Key we use to decrypt messages from the other peer
130 * (given to us by the other peer during the handshake).
131 */
132 struct GNUNET_CRYPTO_AesSessionKey decrypt_key;
133
134 /**
135 * At what time did we generate our encryption key?
136 */
137 struct GNUNET_TIME_Absolute encrypt_key_created;
138
139 /**
140 * At what time did the other peer generate the decryption key?
141 */
142 struct GNUNET_TIME_Absolute decrypt_key_created;
143
144 /**
145 * When should the session time out (if there are no PONGs)?
146 */
147 struct GNUNET_TIME_Absolute timeout;
148
149 /**
150 * At what frequency are we currently re-trying SET_KEY messages?
151 */
152 struct GNUNET_TIME_Relative set_key_retry_frequency;
153
154 /**
155 * ID of task used for re-trying SET_KEY and PING message.
156 */
157 GNUNET_SCHEDULER_TaskIdentifier retry_set_key_task;
158
159 /**
160 * ID of task used for sending keep-alive pings.
161 */
162 GNUNET_SCHEDULER_TaskIdentifier keep_alive_task;
163
164 /**
165 * What was our PING challenge number (for this peer)?
166 */
167 uint32_t ping_challenge;
168
169 /**
170 * What is our connection status?
171 */
172 enum KxStateMachine status;
173
174};
175 36
176 37
177/** 38/**