diff options
author | t3sserakt <t3ss@posteo.de> | 2022-01-06 15:32:56 +0100 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2022-01-06 15:34:01 +0100 |
commit | 85697ed9ad40cdeffc642ccd6d63811cbd91c9b1 (patch) | |
tree | 003058a75af2e861f9a70d633292c3d40c1b5a1e /src/transport | |
parent | d65ae53a5abf9388a0cc6a27e705af331fa5069e (diff) | |
parent | f59876f79b520f174161a40928ddbba1fab87215 (diff) | |
download | gnunet-85697ed9ad40cdeffc642ccd6d63811cbd91c9b1.tar.gz gnunet-85697ed9ad40cdeffc642ccd6d63811cbd91c9b1.zip |
Merge branch 'master' of ssh://git.gnunet.org/gnunet
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-communicator-tcp.c | 30 | ||||
-rw-r--r-- | src/transport/gnunet-communicator-udp.c | 20 |
2 files changed, 25 insertions, 25 deletions
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c index 2a5e33e2b..3bfdeaa90 100644 --- a/src/transport/gnunet-communicator-tcp.c +++ b/src/transport/gnunet-communicator-tcp.c | |||
@@ -115,7 +115,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
115 | struct TcpHandshakeSignature | 115 | struct TcpHandshakeSignature |
116 | { | 116 | { |
117 | /** | 117 | /** |
118 | * Purpose must be #GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE | 118 | * Purpose must be #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE |
119 | */ | 119 | */ |
120 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 120 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
121 | 121 | ||
@@ -153,7 +153,7 @@ struct TcpHandshakeSignature | |||
153 | struct TcpHandshakeAckSignature | 153 | struct TcpHandshakeAckSignature |
154 | { | 154 | { |
155 | /** | 155 | /** |
156 | * Purpose must be #GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK | 156 | * Purpose must be #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK |
157 | */ | 157 | */ |
158 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 158 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
159 | 159 | ||
@@ -190,7 +190,7 @@ struct TCPConfirmation | |||
190 | struct GNUNET_PeerIdentity sender; | 190 | struct GNUNET_PeerIdentity sender; |
191 | 191 | ||
192 | /** | 192 | /** |
193 | * Sender's signature of type #GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE | 193 | * Sender's signature of type #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE |
194 | */ | 194 | */ |
195 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; | 195 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; |
196 | 196 | ||
@@ -225,7 +225,7 @@ struct TCPConfirmationAck | |||
225 | struct GNUNET_PeerIdentity sender; | 225 | struct GNUNET_PeerIdentity sender; |
226 | 226 | ||
227 | /** | 227 | /** |
228 | * Sender's signature of type #GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK | 228 | * Sender's signature of type #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK |
229 | */ | 229 | */ |
230 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; | 230 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; |
231 | 231 | ||
@@ -297,7 +297,7 @@ struct TCPRekey | |||
297 | struct GNUNET_CRYPTO_EcdhePublicKey ephemeral; | 297 | struct GNUNET_CRYPTO_EcdhePublicKey ephemeral; |
298 | 298 | ||
299 | /** | 299 | /** |
300 | * Sender's signature of type #GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY | 300 | * Sender's signature of type #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY |
301 | */ | 301 | */ |
302 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; | 302 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; |
303 | 303 | ||
@@ -315,7 +315,7 @@ struct TCPRekey | |||
315 | struct TcpRekeySignature | 315 | struct TcpRekeySignature |
316 | { | 316 | { |
317 | /** | 317 | /** |
318 | * Purpose must be #GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY | 318 | * Purpose must be #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY |
319 | */ | 319 | */ |
320 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 320 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
321 | 321 | ||
@@ -1313,7 +1313,7 @@ do_rekey (struct Queue *queue, const struct TCPRekey *rekey) | |||
1313 | { | 1313 | { |
1314 | struct TcpRekeySignature thp; | 1314 | struct TcpRekeySignature thp; |
1315 | 1315 | ||
1316 | thp.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY); | 1316 | thp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY); |
1317 | thp.purpose.size = htonl (sizeof(thp)); | 1317 | thp.purpose.size = htonl (sizeof(thp)); |
1318 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1318 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1319 | "do_rekey size %u\n", | 1319 | "do_rekey size %u\n", |
@@ -1340,7 +1340,7 @@ do_rekey (struct Queue *queue, const struct TCPRekey *rekey) | |||
1340 | GNUNET_TIME_absolute_ntoh (thp.monotonic_time))); | 1340 | GNUNET_TIME_absolute_ntoh (thp.monotonic_time))); |
1341 | GNUNET_assert (ntohl ((&thp)->purpose.size) == sizeof (*(&thp))); | 1341 | GNUNET_assert (ntohl ((&thp)->purpose.size) == sizeof (*(&thp))); |
1342 | if (GNUNET_OK != | 1342 | if (GNUNET_OK != |
1343 | GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY, | 1343 | GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY, |
1344 | &thp, | 1344 | &thp, |
1345 | &rekey->sender_sig, | 1345 | &rekey->sender_sig, |
1346 | &queue->target.public_key)) | 1346 | &queue->target.public_key)) |
@@ -1464,7 +1464,7 @@ send_challenge (struct ChallengeNonceP challenge, struct Queue *queue) | |||
1464 | tca.monotonic_time = | 1464 | tca.monotonic_time = |
1465 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); | 1465 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); |
1466 | thas.purpose.purpose = htonl ( | 1466 | thas.purpose.purpose = htonl ( |
1467 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK); | 1467 | GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK); |
1468 | thas.purpose.size = htonl (sizeof(thas)); | 1468 | thas.purpose.size = htonl (sizeof(thas)); |
1469 | thas.sender = my_identity; | 1469 | thas.sender = my_identity; |
1470 | thas.receiver = queue->target; | 1470 | thas.receiver = queue->target; |
@@ -1527,7 +1527,7 @@ inject_rekey (struct Queue *queue) | |||
1527 | GNUNET_CRYPTO_ecdhe_key_get_public (&queue->ephemeral, &rekey.ephemeral); | 1527 | GNUNET_CRYPTO_ecdhe_key_get_public (&queue->ephemeral, &rekey.ephemeral); |
1528 | rekey.monotonic_time = | 1528 | rekey.monotonic_time = |
1529 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); | 1529 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); |
1530 | thp.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_TCP_REKEY); | 1530 | thp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_REKEY); |
1531 | thp.purpose.size = htonl (sizeof(thp)); | 1531 | thp.purpose.size = htonl (sizeof(thp)); |
1532 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1532 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1533 | "inject_rekey size %u\n", | 1533 | "inject_rekey size %u\n", |
@@ -1725,7 +1725,7 @@ try_handle_plaintext (struct Queue *queue) | |||
1725 | } | 1725 | } |
1726 | 1726 | ||
1727 | thas.purpose.purpose = htonl ( | 1727 | thas.purpose.purpose = htonl ( |
1728 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK); | 1728 | GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK); |
1729 | thas.purpose.size = htonl (sizeof(thas)); | 1729 | thas.purpose.size = htonl (sizeof(thas)); |
1730 | thas.sender = tca->sender; | 1730 | thas.sender = tca->sender; |
1731 | thas.receiver = my_identity; | 1731 | thas.receiver = my_identity; |
@@ -1733,7 +1733,7 @@ try_handle_plaintext (struct Queue *queue) | |||
1733 | thas.challenge = tca->challenge; | 1733 | thas.challenge = tca->challenge; |
1734 | 1734 | ||
1735 | if (GNUNET_SYSERR == GNUNET_CRYPTO_eddsa_verify ( | 1735 | if (GNUNET_SYSERR == GNUNET_CRYPTO_eddsa_verify ( |
1736 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE_ACK, | 1736 | GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE_ACK, |
1737 | &thas, | 1737 | &thas, |
1738 | &tca->sender_sig, | 1738 | &tca->sender_sig, |
1739 | &tca->sender.public_key)) | 1739 | &tca->sender.public_key)) |
@@ -2472,7 +2472,7 @@ transmit_kx (struct Queue *queue, | |||
2472 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, | 2472 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, |
2473 | &tc.challenge, | 2473 | &tc.challenge, |
2474 | sizeof(tc.challenge)); | 2474 | sizeof(tc.challenge)); |
2475 | ths.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE); | 2475 | ths.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE); |
2476 | ths.purpose.size = htonl (sizeof(ths)); | 2476 | ths.purpose.size = htonl (sizeof(ths)); |
2477 | ths.sender = my_identity; | 2477 | ths.sender = my_identity; |
2478 | ths.receiver = queue->target; | 2478 | ths.receiver = queue->target; |
@@ -2625,7 +2625,7 @@ decrypt_and_check_tc (struct Queue *queue, | |||
2625 | sizeof(*tc), | 2625 | sizeof(*tc), |
2626 | &ibuf[sizeof(struct GNUNET_CRYPTO_EcdhePublicKey)], | 2626 | &ibuf[sizeof(struct GNUNET_CRYPTO_EcdhePublicKey)], |
2627 | sizeof(*tc))); | 2627 | sizeof(*tc))); |
2628 | ths.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE); | 2628 | ths.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE); |
2629 | ths.purpose.size = htonl (sizeof(ths)); | 2629 | ths.purpose.size = htonl (sizeof(ths)); |
2630 | ths.sender = tc->sender; | 2630 | ths.sender = tc->sender; |
2631 | ths.receiver = my_identity; | 2631 | ths.receiver = my_identity; |
@@ -2633,7 +2633,7 @@ decrypt_and_check_tc (struct Queue *queue, | |||
2633 | ths.monotonic_time = tc->monotonic_time; | 2633 | ths.monotonic_time = tc->monotonic_time; |
2634 | ths.challenge = tc->challenge; | 2634 | ths.challenge = tc->challenge; |
2635 | ret = GNUNET_CRYPTO_eddsa_verify ( | 2635 | ret = GNUNET_CRYPTO_eddsa_verify ( |
2636 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE, | 2636 | GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_TCP_HANDSHAKE, |
2637 | &ths, | 2637 | &ths, |
2638 | &tc->sender_sig, | 2638 | &tc->sender_sig, |
2639 | &tc->sender.public_key); | 2639 | &tc->sender.public_key); |
diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c index 201e94e80..b6edff485 100644 --- a/src/transport/gnunet-communicator-udp.c +++ b/src/transport/gnunet-communicator-udp.c | |||
@@ -164,7 +164,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
164 | struct UdpHandshakeSignature | 164 | struct UdpHandshakeSignature |
165 | { | 165 | { |
166 | /** | 166 | /** |
167 | * Purpose must be #GNUNET_SIGNATURE_COMMUNICATOR_UDP_HANDSHAKE | 167 | * Purpose must be #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE |
168 | */ | 168 | */ |
169 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 169 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
170 | 170 | ||
@@ -227,7 +227,7 @@ struct UDPConfirmation | |||
227 | struct GNUNET_PeerIdentity sender; | 227 | struct GNUNET_PeerIdentity sender; |
228 | 228 | ||
229 | /** | 229 | /** |
230 | * Sender's signature of type #GNUNET_SIGNATURE_COMMUNICATOR_UDP_HANDSHAKE | 230 | * Sender's signature of type #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE |
231 | */ | 231 | */ |
232 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; | 232 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; |
233 | 233 | ||
@@ -284,7 +284,7 @@ struct UDPAck | |||
284 | struct UdpBroadcastSignature | 284 | struct UdpBroadcastSignature |
285 | { | 285 | { |
286 | /** | 286 | /** |
287 | * Purpose must be #GNUNET_SIGNATURE_COMMUNICATOR_UDP_BROADCAST | 287 | * Purpose must be #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST |
288 | */ | 288 | */ |
289 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 289 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
290 | 290 | ||
@@ -315,7 +315,7 @@ struct UDPBroadcast | |||
315 | 315 | ||
316 | /** | 316 | /** |
317 | * Sender's signature of type | 317 | * Sender's signature of type |
318 | * #GNUNET_SIGNATURE_COMMUNICATOR_UDP_BROADCAST | 318 | * #GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST |
319 | */ | 319 | */ |
320 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; | 320 | struct GNUNET_CRYPTO_EddsaSignature sender_sig; |
321 | }; | 321 | }; |
@@ -2202,14 +2202,14 @@ verify_confirmation (const struct GNUNET_CRYPTO_EcdhePublicKey *ephemeral, | |||
2202 | { | 2202 | { |
2203 | struct UdpHandshakeSignature uhs; | 2203 | struct UdpHandshakeSignature uhs; |
2204 | 2204 | ||
2205 | uhs.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_UDP_HANDSHAKE); | 2205 | uhs.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE); |
2206 | uhs.purpose.size = htonl (sizeof(uhs)); | 2206 | uhs.purpose.size = htonl (sizeof(uhs)); |
2207 | uhs.sender = uc->sender; | 2207 | uhs.sender = uc->sender; |
2208 | uhs.receiver = my_identity; | 2208 | uhs.receiver = my_identity; |
2209 | uhs.ephemeral = *ephemeral; | 2209 | uhs.ephemeral = *ephemeral; |
2210 | uhs.monotonic_time = uc->monotonic_time; | 2210 | uhs.monotonic_time = uc->monotonic_time; |
2211 | return GNUNET_CRYPTO_eddsa_verify ( | 2211 | return GNUNET_CRYPTO_eddsa_verify ( |
2212 | GNUNET_SIGNATURE_COMMUNICATOR_UDP_HANDSHAKE, | 2212 | GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE, |
2213 | &uhs, | 2213 | &uhs, |
2214 | &uc->sender_sig, | 2214 | &uc->sender_sig, |
2215 | &uc->sender.public_key); | 2215 | &uc->sender.public_key); |
@@ -2350,7 +2350,7 @@ sock_read (void *cls) | |||
2350 | "received UDPBroadcast from %s\n", | 2350 | "received UDPBroadcast from %s\n", |
2351 | GNUNET_a2s ((const struct sockaddr *) addr_verify, salen)); | 2351 | GNUNET_a2s ((const struct sockaddr *) addr_verify, salen)); |
2352 | ub = (const struct UDPBroadcast *) buf; | 2352 | ub = (const struct UDPBroadcast *) buf; |
2353 | uhs.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_UDP_BROADCAST); | 2353 | uhs.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST); |
2354 | uhs.purpose.size = htonl (sizeof(uhs)); | 2354 | uhs.purpose.size = htonl (sizeof(uhs)); |
2355 | uhs.sender = ub->sender; | 2355 | uhs.sender = ub->sender; |
2356 | sender = ub->sender; | 2356 | sender = ub->sender; |
@@ -2366,7 +2366,7 @@ sock_read (void *cls) | |||
2366 | GNUNET_i2s (&sender)); | 2366 | GNUNET_i2s (&sender)); |
2367 | GNUNET_CRYPTO_hash ((struct sockaddr *) addr_verify, salen, &uhs.h_address); | 2367 | GNUNET_CRYPTO_hash ((struct sockaddr *) addr_verify, salen, &uhs.h_address); |
2368 | if (GNUNET_OK == | 2368 | if (GNUNET_OK == |
2369 | GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_COMMUNICATOR_UDP_BROADCAST, | 2369 | GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST, |
2370 | &uhs, | 2370 | &uhs, |
2371 | &ub->sender_sig, | 2371 | &ub->sender_sig, |
2372 | &ub->sender.public_key)) | 2372 | &ub->sender.public_key)) |
@@ -2699,7 +2699,7 @@ mq_send_kx (struct GNUNET_MQ_Handle *mq, | |||
2699 | uc.sender = my_identity; | 2699 | uc.sender = my_identity; |
2700 | uc.monotonic_time = | 2700 | uc.monotonic_time = |
2701 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); | 2701 | GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg)); |
2702 | uhs.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_UDP_HANDSHAKE); | 2702 | uhs.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE); |
2703 | uhs.purpose.size = htonl (sizeof(uhs)); | 2703 | uhs.purpose.size = htonl (sizeof(uhs)); |
2704 | uhs.sender = my_identity; | 2704 | uhs.sender = my_identity; |
2705 | uhs.receiver = receiver->target; | 2705 | uhs.receiver = receiver->target; |
@@ -3644,7 +3644,7 @@ iface_proc (void *cls, | |||
3644 | bi->salen = addrlen; | 3644 | bi->salen = addrlen; |
3645 | bi->found = GNUNET_YES; | 3645 | bi->found = GNUNET_YES; |
3646 | bi->bcm.sender = my_identity; | 3646 | bi->bcm.sender = my_identity; |
3647 | ubs.purpose.purpose = htonl (GNUNET_SIGNATURE_COMMUNICATOR_UDP_BROADCAST); | 3647 | ubs.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST); |
3648 | ubs.purpose.size = htonl (sizeof(ubs)); | 3648 | ubs.purpose.size = htonl (sizeof(ubs)); |
3649 | ubs.sender = my_identity; | 3649 | ubs.sender = my_identity; |
3650 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3650 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |