aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-10-28 14:50:02 +0000
committerBart Polot <bart@net.in.tum.de>2013-10-28 14:50:02 +0000
commit54930ef7699d3a193ead7ff47c6f8de8939f0a3e (patch)
treebe033d10544e797981e4a4ccd85dc65e39f1563c /src
parent93ddb2f4a73f7867dc9cc850cccb6c1ab8d23fd0 (diff)
downloadgnunet-54930ef7699d3a193ead7ff47c6f8de8939f0a3e.tar.gz
gnunet-54930ef7699d3a193ead7ff47c6f8de8939f0a3e.zip
- missing header
Diffstat (limited to 'src')
-rw-r--r--src/mesh/mesh_protocol_enc.h125
1 files changed, 116 insertions, 9 deletions
diff --git a/src/mesh/mesh_protocol_enc.h b/src/mesh/mesh_protocol_enc.h
index 78c3666b1..1511071c6 100644
--- a/src/mesh/mesh_protocol_enc.h
+++ b/src/mesh/mesh_protocol_enc.h
@@ -96,6 +96,118 @@ struct GNUNET_MESH_ConnectionACK
96 /* TODO: signature */ 96 /* TODO: signature */
97}; 97};
98 98
99
100/**
101 * Message transmitted with the signed ephemeral key of a peer. The
102 * session key is then derived from the two ephemeral keys (ECDHE).
103 *
104 * As far as possible, same as CORE's EphemeralKeyMessage.
105 */
106struct GNUNET_MESH_KX
107{
108
109 /**
110 * Message type is GNUNET_MESSAGE_TYPE_MESH_KX.
111 */
112 struct GNUNET_MessageHeader header;
113
114 /**
115 * Status of the sender (should be in "enum PeerStateMachine"), nbo.
116 */
117 int32_t sender_status GNUNET_PACKED;
118
119 /**
120 * An ECC signature of the 'origin' asserting the validity of
121 * the given ephemeral key.
122 */
123 struct GNUNET_CRYPTO_EddsaSignature signature;
124
125 /**
126 * Information about what is being signed.
127 */
128 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
129
130 /**
131 * At what time was this key created (beginning of validity).
132 */
133 struct GNUNET_TIME_AbsoluteNBO creation_time;
134
135 /**
136 * When does the given ephemeral key expire (end of validity).
137 */
138 struct GNUNET_TIME_AbsoluteNBO expiration_time;
139
140 /**
141 * Ephemeral public ECC key (always for NIST P-521) encoded in a format suitable
142 * for network transmission as created using 'gcry_sexp_sprint'.
143 */
144 struct GNUNET_CRYPTO_EcdhePublicKey ephemeral_key;
145
146 /**
147 * Public key of the signing peer (persistent version, not the ephemeral public key).
148 */
149 struct GNUNET_PeerIdentity origin_identity;
150};
151
152
153/**
154 * We're sending an (encrypted) PING to the other peer to check if he
155 * can decrypt. The other peer should respond with a PONG with the
156 * same content, except this time encrypted with the receiver's key.
157 */
158struct GNUNET_MESH_KX_Ping
159{
160 /**
161 * Message type is GNUNET_MESSAGE_TYPE_MESH_KX_PING.
162 */
163 struct GNUNET_MessageHeader header;
164
165 /**
166 * Seed for the IV
167 */
168 uint32_t iv GNUNET_PACKED;
169
170 /**
171 * Intended target of the PING, used primarily to check
172 * that decryption actually worked.
173 */
174 struct GNUNET_PeerIdentity target;
175
176 /**
177 * Random number chosen to make reply harder.
178 */
179 uint32_t nonce GNUNET_PACKED;
180};
181
182
183/**
184 * Response to a PING. Includes data from the original PING.
185 */
186struct GNUNET_MESH_KX_Pong
187{
188 /**
189 * Message type is GNUNET_MESSAGE_TYPE_MESH_KX_PONG.
190 */
191 struct GNUNET_MessageHeader header;
192
193 /**
194 * Seed for the IV
195 */
196 uint32_t iv GNUNET_PACKED;
197
198 /**
199 * Intended target of the PING, used primarily to check
200 * that decryption actually worked.
201 */
202 struct GNUNET_PeerIdentity target;
203
204 /**
205 * Same nonce as in the received PING message.
206 */
207 uint32_t nonce GNUNET_PACKED;
208};
209
210
99/** 211/**
100 * Tunnel(ed) message. 212 * Tunnel(ed) message.
101 */ 213 */
@@ -107,9 +219,9 @@ struct GNUNET_MESH_Encrypted
107 struct GNUNET_MessageHeader header; 219 struct GNUNET_MessageHeader header;
108 220
109 /** 221 /**
110 * ID of the packet (hop by hop). 222 * Initialization Vector for payload encryption.
111 */ 223 */
112 uint32_t pid GNUNET_PACKED; 224 uint32_t iv GNUNET_PACKED;
113 225
114 /** 226 /**
115 * ID of the connection. 227 * ID of the connection.
@@ -117,9 +229,9 @@ struct GNUNET_MESH_Encrypted
117 struct GNUNET_HashCode cid; 229 struct GNUNET_HashCode cid;
118 230
119 /** 231 /**
120 * Initialization Vector for payload encryption. 232 * ID of the packet (hop by hop).
121 */ 233 */
122 uint64_t iv GNUNET_PACKED; 234 uint32_t pid GNUNET_PACKED;
123 235
124 /** 236 /**
125 * Number of hops to live. 237 * Number of hops to live.
@@ -127,11 +239,6 @@ struct GNUNET_MESH_Encrypted
127 uint32_t ttl GNUNET_PACKED; 239 uint32_t ttl GNUNET_PACKED;
128 240
129 /** 241 /**
130 * Always 0.
131 */
132 uint32_t reserved GNUNET_PACKED;
133
134 /**
135 * Encrypted content follows. 242 * Encrypted content follows.
136 */ 243 */
137}; 244};